-
Notifications
You must be signed in to change notification settings - Fork 431
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
Inconsistent cargo bazel lockfile between MacOS and Linux #2212
Comments
I encountered the exact same issue in the past few weeks. It is related to a (current) hard limitation of The problem with this approach is that One quick & dirty solution could be to add a It looks like we could improve This whole story was already discovered by @illicitonion a while ago in #1662 - could you maybe give your two cents to help move in one direction or another? Some extra relevant links: |
Thanks for looking into this. As this seems blocked though by changes we’d need on cargo, what would be viable options to workaround this issue for the meantime? |
This sounds like the right approach (until |
I’ve gotten around the issue for now by running cargo sync on the different platforms and adding them manually via annotations. As such, looks like whatever would automate this would work for my case. |
I touched base with some |
This PR makes a number of small changes to our Bazel setup: 1. Updates `cargo-gazelle` so it generates the correct amount of newlines 2. Changes the `test_output` setting in `.bazelrc` from `streamed` to `all`, `streamed` looked nice but forced the execution of tests to be serial. 3. Change the ci-builder image to read the Bazel version from the `.bazelversion` file 4. Update `.bazelrc` to add some settings for remote caching 5. Upgrade to rules_rust `v0.48` (previously we were on `v0.44`) 6. Delete `Cargo.Bazel.lock`. Ideally we would include the lock file, but unfortunately the lockfile generation can be inconsistent between macOS and Linux, see bazelbuild/rules_rust#2212. Our builds are still based off of the `Cargo.lock` file, the only difference is it takes an extra couple seconds to re-gen BUILD files for third party crates. A fix for this is either switching to `crates_vendored` or using Bazel Modules. We can do either in a follow up. 7. Add more settings to `.bazelrc`, taking suggestions from what [here](https://blog.aspect.build/bazelrc-flags) 8. Update the Rocksdb build so `librocksdb-sys` doesn't build `snappy` on its own and instead uses the one built by Bazel ### Motivation This is the final step before committing our generated `BUILD.bazel` files. ### Tips for reviewer It's easier if you review commit by commit. ### Checklist - [ ] This PR has adequate test coverage / QA involvement has been duly considered. ([trigger-ci for additional test/nightly runs](https://trigger-ci.dev.materialize.com/)) - [ ] This PR has an associated up-to-date [design doc](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/README.md), is a design doc ([template](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/00000000_template.md)), or is sufficiently small to not require a design. <!-- Reference the design in the description. --> - [ ] If this PR evolves [an existing `$T ⇔ Proto$T` mapping](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/command-and-response-binary-encoding.md) (possibly in a backwards-incompatible way), then it is tagged with a `T-proto` label. - [ ] If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label ([example](MaterializeInc/cloud#5021)). <!-- Ask in #team-cloud on Slack if you need help preparing the cloud PR. --> - [x] This PR includes the following [user-facing behavior changes](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/guide-changes.md#what-changes-require-a-release-note): - N/a
This change expands the use of `cargo tree` to resolve features for different combinations of `host -> target` platform triples where before `cargo-bazel` was only capable of resolving host dependencies for the current host platform and not a foreign platform. A lengthy description of how this was done can be found at `crate_universe/src/metadata/cargo_tree_resolver.rs - TreeResolver::create_rustc_wrapper`. closes #2212 --------- Co-authored-by: Daniel Wagner-Hall <dawagner@gmail.com>
Given a rust project with the dependency:
pbjson_types
, the generated cargo bazel lockfile differs when generated on Mac and Linux.See sample project here. The diff switching from the mac generated one to the linux one is on this commit.
Mac build is from an M2 Sonoma. Linux build is from a docker ubuntu arm64 image.
The text was updated successfully, but these errors were encountered: