-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: add experimental_expose_build_files flag #1345
base: main
Are you sure you want to change the base?
feat: add experimental_expose_build_files flag #1345
Conversation
doc = "Allows to expose internal build files required for package compilation. " + | ||
"This option is experimental and should be used at your own risk. " + | ||
"The structure and labels of exposed build files may change in future releases " + | ||
"without requiring a major version bump.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reformat this a multiline string (""" """
)? I find that they are easier to maintain.
@@ -175,8 +175,19 @@ PATCH_ATTRS = { | |||
), | |||
} | |||
|
|||
EXPERIMENTAL_ATTRS = { | |||
"experimental_expose_build_files": attr.bool( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really have an experimental flag policy. Perhaps we should rename it to publicly_expose_all_targets
. WDYT?
def _build_file_visibility(repository_ctx): | ||
experimental_expose_build_files = getattr(repository_ctx.attr, "experimental_expose_build_files", False) | ||
return ["//visibility:public"] if experimental_expose_build_files else ["//:__subpackages__"] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attempt to solve #932.
Following the example given in the linked issue, with the new flag
experimental_expose_build_files
, it is possible to granularly expose the build files of individual packages, as an example: