Make crate module extension os and arch dependent #2939
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is follow up to #2453 and marks the
crate
extension asos_dependent
andarch_dependent
.For
crate.from_cargo
, the extension specifies reproducibility via thereproducible
attribute ofextension_metadata
which makes Bazel skip the extension when writing the lockfile.But in the case of
crate.from_specs
, the current implementation marks the extension as non reproducible since the crates will not be backed by a lockfile.And because the
crate
module extension depends onrust_host_tools
(which are os / arch dependent), the entry in the lockfile for the module extension includes the checksum of therustc
andcargo
binaries for whatever host it was resolved for.This makes the bazel lock file platform dependent in that case.
This PR will result in a new os/arch specific entry in the lockfile for users of
crate.from_specs
.And will have no impact for users of
crate.from_cargo
.Thanks to @fmeum for the guidance.