Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce use_same_package_name #39

Open
wants to merge 1 commit into
base: mercury
Choose a base branch
from

Conversation

wavewave
Copy link
Collaborator

to use the specified name as GHC package name.

In some special cases (especially GHC boot libraries), the package name needs to be given as specified.

@wavewave
Copy link
Collaborator Author

wavewave commented Oct 3, 2024

Maybe we can have more features related to this, to control the --this-unit-id flag.

to use the specified name as GHC package name.

In some special cases (especially GHC boot libraries), the package name
needs to be given as specified.
@wavewave wavewave changed the base branch from wavewave/boot-dep-graph to mercury October 3, 2024 13:11
@wavewave wavewave marked this pull request as ready for review October 3, 2024 13:11
@@ -188,6 +188,7 @@ haskell_library = prelude_rule(
"linker_flags": attrs.list(attrs.arg(), default = []),
"platform": attrs.option(attrs.string(), default = None),
"platform_linker_flags": attrs.list(attrs.tuple(attrs.regex(), attrs.list(attrs.arg())), default = []),
"use_same_package_name": attrs.bool(default = False),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be an optional package_id attribute instead? The default behavior would still be the current behavior, i.e. equivalent with use_same_package_name = False, but then when package_id is set it's a bit more flexible and allows users direct control over the package id if needed. (For reference Bazel rules_haskell has something like this too.)

Also, to clarify. IIUC this actually directly influences -this-unit-id, correct? So, maybe the name package_id is more appropriate than package_name, or maybe it should directly be called unit_id?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that sounds reasonable and with clearer semantics (name means many things). I will change this to optional explicit package-id. Thanks for suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants