Skip to content
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

Use Bazelisk and update to Bazel 7.4.0 #61

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
common --config=rules
common:v7.2 --config=rules_v7.2

Choose a reason for hiding this comment

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

Do you know why this existed to begin with?

Why have a rules section when we could just put those options under the commands themselves? E.g. instead of build:rules --disk_cache=.bazel_cache, we could do build --disk_cache=.bazel_cache.

Copy link
Author

Choose a reason for hiding this comment

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

These configs existed because way back when Bazel was new the tests and rules had separate config.

Also because of us wanting to have a single place for the disk cache, which I realize I broke by removing this. I'll deal with that.

common --config=rules
import %workspace%/.bazelrc_shared
15 changes: 2 additions & 13 deletions .bazelrc_shared
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,5 @@ build --verbose_failures

test --test_output=all

build:rules --disk_cache=.bazel_cache
build:tests --disk_cache=../.bazel_cache

common:rules_v7.2 --config=noop

Choose a reason for hiding this comment

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

Do you know what this deleted portion was doing?

Copy link
Author

Choose a reason for hiding this comment

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

The per version config existed so we could set flags for certain versions of Bazel and not others. Back before 1.0 things would change often enough that we'd often need a different set of flags for each version.

Now that we're really only supporting 1 version of Bazel (because we only use these rules internally) we haven't had to do that for a while.

The noop config was a way to have a version config that did nothing. The version configs were automatically generated by the old tools/bazel, so you had to have them point to something, even if they did nothing.


# route potentially unrouted configs to a terminating noop config
# it's a noop because we use the default value
common:rules --config=noop
common:tests --config=noop
common:v7.2 --config=rules_v7.2

# pick something trivial as a "noop"
common:noop --logging=3
common:rules --disk_cache=.bazel_cache
common:tests --disk_cache=../.bazel_cache
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.4.0
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-24.04]
bazel_version: [7.2.0]
bazel_version: [bazelbuild/7.4.0]
steps:
- uses: actions/checkout@v3
- uses: bazel-contrib/[email protected]
with:
bazelisk-version: 1.22.1
- run: ./scripts/ci.sh build
- run: ./scripts/ci.sh lint
- run: ./scripts/ci.sh test
20 changes: 10 additions & 10 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rules/scala/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def scala_artifacts():
]

def scala_repositories(
java_launcher_version = "7.2.0",
java_launcher_version = "7.4.0",
java_launcher_template_sha = "ee4aa47ae5e639632c67be5cc0ccbc4e941a67a1b884a1ce0c4329357a4b62b2"):
maven_install(
name = "annex",
Expand Down
2 changes: 0 additions & 2 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
set -eox pipefail
cd "$(dirname "$0")/.."

. ./scripts/prepare-path.sh --force

case "$1" in

"build")
Expand Down
2 changes: 0 additions & 2 deletions scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
set -o pipefail
cd "$(dirname "$0")/.."

. ./scripts/prepare-path.sh --force

if [ "$1" != check ]; then
bazel build $(bazel query 'kind("scala_format_test", //...)')
bazel query 'kind("scala_format_test", //...)' --output package | while read package; do bazel-bin/"$package"/*-format .; done
Expand Down
38 changes: 0 additions & 38 deletions scripts/prepare-path.sh

This file was deleted.

2 changes: 0 additions & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
set -o pipefail
cd "$(dirname "$0")/.."

. ./scripts/prepare-path.sh --force

find tests -name test -type f | sort | while read f; do
echo running ${f#"tests/"}...
output=$($f 2>&1) || ( echo "$output" && exit 1 )
Expand Down
20 changes: 10 additions & 10 deletions tests/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 0 additions & 103 deletions tools/bazel

This file was deleted.

Loading