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

Make crate module extension os and arch dependent #2939

Conversation

cerisier
Copy link
Contributor

This PR is follow up to #2453 and marks the crate extension as os_dependent and arch_dependent.

For crate.from_cargo, the extension specifies reproducibility via the reproducible attribute of extension_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 on rust_host_tools (which are os / arch dependent), the entry in the lockfile for the module extension includes the checksum of the rustc and cargo 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.

@cerisier
Copy link
Contributor Author

cc @UebelAndre since that's a quick one

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Seems reasonable - thanks!

@illicitonion illicitonion added this pull request to the merge queue Oct 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 20, 2024
@illicitonion illicitonion added this pull request to the merge queue Oct 20, 2024
Merged via the queue into bazelbuild:main with commit d08b20d Oct 20, 2024
4 checks passed
@cerisier cerisier deleted the cross-platform-lock-file-for-crate-extension branch October 28, 2024 20:47
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