Skip to content

Make every .bazelrc import the top level .bazelrc #1644

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

Merged

Conversation

mbland
Copy link
Contributor

@mbland mbland commented Nov 8, 2024

Description

Makes the Bazel configuration for every test repository consistent with the main repository. Supersedes #1638.

Removes test_version/.bazel{rc,version}, since test_version.sh was always copying the top level .bazel{rc,version} files into the test repo to begin with. Updates scripts/sync-bazelversion.sh such that it won't replace test_version/.bazelversion on future runs.

Also fixes a bug in test/shell/test_scala_proto_library.sh whereby it never successfully read the top level .bazelversion file.

Motivation

With this change, scripts/toggle-workspace.sh from #1638 isn't really necessary, since this allows changes from the top level .bazelrc to propagate to all nested repos. I no longer need that script to easily and safely switch between WORKSPACE and Bzlmod while working on changes for #1482.

I only realized this while working on my new branch to use the latest abseil-cpp 20240722.0 and protobuf v28.3, which is based on my branch to update to ScalaPB 0.11.17, gRPC 1.68.1, and Guava 33.3.1-jre, which is itself based on #1642.


As an aside, the upshot of that protobuf upgrade work so far:

  • Later versions of Protobuf appear to require ScalaPB 1.0.0-alpha.1, which causes a single test to hang, test_scala_version 2.11.12 from test_version.sh. Appears to be another ProtoScalaPBRule aspect worker hanging, this time on //src/main/scala/scalarules/test/twitter_scrooge:java_jar_not_on_classpath.

  • The latest abseil-cpp and protobuf will build under Bazel 6.5.0 with the compiler flags from [6.5.0] Upgrade abseil-cpp to fix build on macos_arm64 bazelbuild/bazel#20785, but those cause protobuf to rebuild even more frequently. These flags aren't required under Bazel 7.4.0, so the problem isn't as pronounced.

@mbland
Copy link
Contributor Author

mbland commented Nov 8, 2024

Hmm, looks like the test_reproducibility job broke due to a failure to download Bazel. In other words, the breakage is unrelated to this change; all the other test jobs passed.

2024/11/08 23:06:26 Downloading https://releases.bazel.build/6.5.0/release/bazel-6.5.0-linux-x86_64...
2024/11/08 23:06:26 could not download Bazel: failed to download bazel: failed to download bazel:
  could not copy from https://releases.bazel.build/6.5.0/release/bazel-6.5.0-linux-x86_64 to
  /var/lib/buildkite-agent/.cache/bazelisk/downloads/_tmp/download1892374034:
  stream error: stream ID 1; INTERNAL_ERROR; received from peer

Makes the Bazel configuration for every test repository consistent with
the main repository.

Removes `test_version/.bazel{rc,version}`, since `test_version.sh` was
always copying the top level `.bazel{rc,version}` files into the test
repo to begin with. Updates `scripts/sync-bazelversion.sh` such that it
won't replace `test_version/.bazelversion` on future runs.

Also fixes a bug in `test/shell/test_scala_proto_library.sh` whereby it
never successfully read the top level `.bazelversion` file.
Copy link
Collaborator

@simuons simuons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@liucijus liucijus merged commit 4faf94f into bazel-contrib:master Nov 12, 2024
2 checks passed
@mbland mbland deleted the bzlmod-import-top-level-bazelrc branch November 12, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants