-
Couldn't load subscription status.
- Fork 517
Write lockfile external only #3699
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
base: main
Are you sure you want to change the base?
Conversation
6aed689 to
32e534d
Compare
32e534d to
6873aac
Compare
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.
This looks great to me, thank you! Just two small testing addition suggestions :)
| assert!(!filtered_lockfile | ||
| .packages | ||
| .iter() | ||
| .any(|pkg| pkg.name.as_str() == "child")); |
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.
| assert!(!filtered_lockfile | |
| .packages | |
| .iter() | |
| .any(|pkg| pkg.name.as_str() == "child")); | |
| assert!(!filtered_lockfile | |
| .packages | |
| .iter() | |
| .any(|pkg| pkg.name.as_str() == "child")); | |
| assert!(filtered_lockfile | |
| .packages | |
| .iter() | |
| .any(|pkg| pkg.name.as_str() == "anyhow")); |
|
|
||
| # https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html | ||
| crate_index_remove_internal_deps = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate") | ||
| crate_index_remove_internal_deps.from_cargo( |
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.
I'm tempted to add a second from_cargo with the un-stripped Cargo.lock, and a second number_printer target pointing at the unstripped repo, so that we can see both Cargo.lock files work and are up to date - WDYT?
Description
Another attempt to improve #3522
Current status/plan on the issue above was
Cargo.lockfile into aCargo.bazel.lockfile by removing internal depscrate.from_cargowith theCargo.bazel.lockfile andskip_cargo_lockfile_overwrite = TrueMODULE.bazel.lockwhich should have less merge conflicts since the sha ofCargo.bazel.lockdoes not change that oftenThis works, but we need to make sure
Cargo.lockis up to date. This requires another step, so we replace a slow automated step (cargo splicing) with an extra manual/non-bazel step (updating theCargo.lockfile).New idea to iterate
crate.from_cargowith theCargo.bazel.lockfile but instead of usingskip_cargo_lockfile_overwrite = Truestrip_internal_dependencies_from_cargo_lockfileflagThis would save us the pre-commit hook as well as the manual step to update the
Cargo.lockfile. I already did a quick verification andremove_internal_dependencies_from_cargo_lockfileachieves the same results as the python implementation I listed in #3522Open Points
This is an early draft to collect feedback. Once we aligned how exactly we want to proceed, I would like to