Skip to content

Commit

Permalink
bzlmod: Verify that the lockfile is platform-independent
Browse files Browse the repository at this point in the history
By committing a single lockfile and running CI with
`--lockfile_mode=error`, we can ensure that the same lockfile works
across OSes and architectures.

Since the lockfile can get pretty large, we exclude it from the release
archive and hence also don't check the lockfile.
  • Loading branch information
fmeum committed Aug 25, 2023
1 parent 96f4d66 commit 0c6c0c3
Show file tree
Hide file tree
Showing 6 changed files with 1,508 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ tasks:
- bazel run //:gazelle -- update pkg
- bazel run //:gazelle -- pkg
build_flags:
- "--allow_yanked_versions=all"
# Verify that the committed lockfile is platform-independent.
- "--lockfile_mode=error"
test_flags:
- "--allow_yanked_versions=all"
# Verify that the committed lockfile is platform-independent.
- "--lockfile_mode=error"
build_targets:
- "//..."
- "//:gazelle"
Expand Down
2 changes: 0 additions & 2 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ bcr_test_module:
run_test_module:
name: Run test module
platform: ${{ platform }}
build_flags:
- --experimental_isolated_extension_usages
shell_commands:
# Regenerate the BUILD file for the test module using Gazelle.
- rm pkg/BUILD.bazel
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.gitattributes export-ignore
# The lockfile is not used by downstream projects and tends to be large.
tests/bcr/MODULE.bazel.lock export-ignore
1 change: 1 addition & 0 deletions tests/bcr/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
common --enable_bzlmod
common --experimental_isolated_extension_usages
common --lockfile_mode=update
2 changes: 1 addition & 1 deletion tests/bcr/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.1
6.3.2
Loading

0 comments on commit 0c6c0c3

Please sign in to comment.