Skip to content

Commit

Permalink
Clean up .bazelrc file and improve default module file generation
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 590239306
Change-Id: I8cb5dca3661c943c73dec75c346848484c2695e9
  • Loading branch information
meteorcloudy authored and copybara-github committed Dec 12, 2023
1 parent 2ccbe0f commit 15d4a05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ build:windows_arm64 --extra_toolchains=@local_config_cc//:cc-toolchain-arm64_win
# with the target.
build:windows_arm64 --java_runtime_version=remotejdk_11

# Enable Bzlmod
common:bzlmod --enable_bzlmod
common:bzlmod --check_direct_dependencies=error
common:bzlmod --experimental_downloader_config=bazel_downloader.cfg
common --config=bzlmod
common --lockfile_mode=update
# Check direct Bazel module dependencies are up-to-date
common --check_direct_dependencies=error

# Add mirrors for certain download URLs
common --experimental_downloader_config=bazel_downloader.cfg

# Enable modern C++ features
build:linux --cxxopt=-std=c++17
Expand Down
4 changes: 2 additions & 2 deletions src/test/tools/bzlmod/update_default_lock_file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ function generate_lock_file() {
trap 'cleanup $tmpdir' EXIT

cd "${tmpdir}"
touch WORKSPACE
touch REPO.bazel
bazel=$(rlocation io_bazel/src/bazel)

echo "Running: $bazel mod deps"
$bazel mod deps
cp ./MODULE.bazel.lock $BUILD_WORKING_DIRECTORY/src/test/tools/bzlmod/MODULE.bazel.lock
cp ./MODULE.bazel.lock $BUILD_WORKSPACE_DIRECTORY/src/test/tools/bzlmod/MODULE.bazel.lock
}

generate_lock_file
2 changes: 1 addition & 1 deletion src/test/tools/bzlmod/verify_default_lock_file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ source "$(rlocation "io_bazel/src/test/shell/integration_test_setup.sh")" \
|| { echo "integration_test_setup.sh not found!" >&2; exit 1; }

function test_verify_lock_file() {
touch WORKSPACE
touch REPO.bazel
rm -f MODULE.bazel
cp $(rlocation io_bazel/src/test/tools/bzlmod/MODULE.bazel.lock) MODULE.bazel.lock
echo "Running: bazel mod deps --lockfile_mode=error" >& "$TEST_log"
Expand Down

0 comments on commit 15d4a05

Please sign in to comment.