Skip to content

Conversation

@justinhorvitz
Copy link

Currently, rules_rust uses a config_setting that matches --stamp=1 to detect whether the --stamp option is enabled in the current configuration. This PR removes the config_setting in favor of calling ctx.configuration.stamp_binaries(), which is restricted, but available to rules rust because it is on the restricted starlark API allowlist: https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/packages/BuiltinRestriction.java;l=73;drc=135a03ba5dbad5a1a26ef3bde9815ea244a093d7.

The motivation for making this change is to improve Google-internal detection of stamped actions for cross-user caching eligibility. The ctx.configuration.stamp_binaries() call is limited to the case of stamp = -1, whereas the config_setting dependency was unconditional. Notably, for rust_library rules with the default attribute of stamp = 0, we are now able to certify that the rule is not affected by the --stamp flag value.

Google-internal bug number: 419546090

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.

1 participant