docs: Add recommendations for lockfile #3467
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.
I did some experiments on this example to evaluate the
lockfile
attribute vs. usingMODULE.bazel.lock
:I ran
bazel test //... --profile=...
. After every run, I did abazel clean && bazel shutdown
to start clean.MODULE.bazel.lock
file only): Nocargo-bazel
call found in the profile generatedlockfile
, runCARGO_BAZEL_REPIN=true bazel mod tidy
, thenbazel test
): Nocargo-bazel
call found in the profile generatedMODULE.bazel.lock
):cargo-bazel
was called, but cargo splicing was very fast. TheMODULE.bazel.lock
was recreatedMODULE.bazel.lock
and run with--lockfile_mode=off
):cargo-bazel
was called, similar to aboveThis suggests:
MODULE.bazel.lock
file up to date, nocargo-bazel
is called regardless of using thelockfile
or notMODULE.bazel.lock
is not tracked in VCS thelockfile
seems to be helpful and should be usedMODULE.bazel.lock
file and thelockfile
a bit more in detail, shows they store similar information. Thelockfile
is a bit more well structured json (for the rust specific content) while theMODULE.bazel.lock
file seems to store the entire content generated for every crate in a single string.