-
Notifications
You must be signed in to change notification settings - Fork 402
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
Add incompatible_make_rust_providers_target_independent
flag
#967
Conversation
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.
LGTM, thank you!
@@ -339,3 +340,11 @@ def is_exec_configuration(ctx): | |||
|
|||
# TODO(djmarcin): Is there any better way to determine cfg=exec? | |||
return ctx.genfiles_dir.path.find("-exec-") == -1 | |||
|
|||
def transform_deps(deps, make_rust_providers_target_independent): |
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.
Once we flip the flag this function may be removed, could you document that in the stardoc, potentially adding a todo referencing the issue.
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.
Done.
rust/toolchain.bzl
Outdated
@@ -229,6 +230,8 @@ def _rust_toolchain_impl(ctx): | |||
if ctx.attr.target_triple and ctx.file.target_json: | |||
fail("Do not specify both target_triple and target_json, either use a builtin triple or provide a custom specification file.") | |||
|
|||
make_rust_providers_target_independent = getattr(ctx.attr, "_incompatible_make_rust_providers_target_independent")[IncompatibleFlagInfo] |
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.
If you're certain that the current rule has the attribute, (therefore you don't need to provide the default value when attr is missing) you don't have to use the getattr
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.
Done.
This flag guards the incompatible changes needed in order to be able to compile files in aspects. For more information see #966.