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

chore: add bazel8 ci #1929

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .aspect/bazelrc/correctness.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test --test_verbose_timeout_warnings
# Allow the Bazel server to check directory sources for changes. Ensures that the Bazel server
# notices when a directory changes, if you have a directory listed in the srcs of some target.
# Recommended when using
# [copy_directory](https://github.com/aspect-build/bazel-lib/blob/main/docs/copy_directory.md) and
# [copy_directory](https://github.com/bazel-contrib/bazel-lib/blob/main/docs/copy_directory.md) and
# [rules_js](https://github.com/aspect-build/rules_js) since npm package are source directories
# inputs to copy_directory actions.
# Docs: https://bazel.build/reference/command-line-reference#flag--host_jvm_args
Expand Down
19 changes: 13 additions & 6 deletions .aspect/bazelrc/performance.bazelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Don't apply `--noremote_upload_local_results` and `--noremote_accept_cached` to the disk cache.
# If you have both `--noremote_upload_local_results` and `--disk_cache`, then this fixes a bug where
# Bazel doesn't write to the local disk cache as it treats as a remote cache.
# Docs: https://bazel.build/reference/command-line-reference#flag--incompatible_remote_results_ignore_disk
build --incompatible_remote_results_ignore_disk

# Directories used by sandboxed non-worker execution may be reused to avoid unnecessary setup costs.
# Save time on Sandbox creation and deletion when many of the same kind of action run during the
# build.
Expand All @@ -18,3 +12,16 @@ build --experimental_reuse_sandbox_directories
# author.
# Docs: https://bazel.build/reference/command-line-reference#flag--legacy_external_runfiles
build --nolegacy_external_runfiles

# Avoid creating a runfiles tree for binaries or tests until it is needed.
# Docs: https://bazel.build/reference/command-line-reference#flag--build_runfile_links
# See https://github.com/bazelbuild/bazel/issues/6627
#
# This may break local workflows that `build` a binary target, then run the resulting program
# outside of `bazel run`. In those cases, the script will need to call
# `bazel build --build_runfile_links //my/binary:target` and then execute the resulting program.
build --nobuild_runfile_links

# Needed prior to Bazel 8; see
# https://github.com/bazelbuild/bazel/issues/20577
coverage --build_runfile_links
15 changes: 15 additions & 0 deletions .github/workflows/bazel8.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Speed up all builds by not checking if external repository files have been modified.
# Docs: https://github.com/bazelbuild/bazel/blob/1af61b21df99edc2fc66939cdf14449c2661f873/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java#L244
common --noexperimental_check_external_repository_files

# Don't report when the root module's lower bound for a dependency happens to be less than the resolved version.
# This is expected and should NOT prompt an engineer to update our lower bound to match.
# WARNING: For repository 'aspect_bazel_lib', the root module requires module version [email protected],
# but got [email protected] in the resolved dependency graph.
common --check_direct_dependencies=off

# Directories used by sandboxed non-worker execution may be reused to avoid unnecessary setup costs.
# Save time on Sandbox creation and deletion when many of the same kind of action run during the
# build.
# Docs: https://bazel.build/reference/command-line-reference#flag--reuse_sandbox_directories
build --reuse_sandbox_directories
11 changes: 11 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
m=${v::1}
a=(
"major:$m, version:\"$v\""
"major:8, version:\"8.0.0\""
"major:6, version:\"6.5.0\""
)
printf -v j '{%s},' "${a[@]}"
Expand Down Expand Up @@ -135,6 +136,9 @@ jobs:
- bazel-version:
major: 6
bzlmod: 0
# Don't run tests with Bazel 8 pre-releases by default
- bazel-version:
major: 8
# Don't run workspace smoke test under bzlmod
- bzlmod: 1
folder: e2e/workspace
Expand Down Expand Up @@ -174,6 +178,13 @@ jobs:
- bzlmod: 0
folder: e2e/runfiles
include:
# Include only the bzlmod unit tests with bazel8
- bazel-version:
major: 8
bzlmod: 1
folder: .
os: ubuntu
config: local
- bazel-version:
major: 7
version: 7.4.0
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module(

# Lower-bounds (minimum) versions for direct runtime dependencies.
# Do not bump these unless rules_js requires a newer version to function.
bazel_dep(name = "aspect_bazel_lib", version = "2.8.1")
bazel_dep(name = "aspect_bazel_lib", version = "2.9.2")
Copy link
Member Author

@jbedard jbedard Oct 21, 2024

Choose a reason for hiding this comment

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

This is required for the bazelrc changes, specifically for bazel-contrib/bazel-lib@7d901b7

Copy link
Member

Choose a reason for hiding this comment

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

cool, can merge that as a pre-factor if it helps get this green and landed

bazel_dep(name = "bazel_features", version = "1.9.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "platforms", version = "0.0.5")
Expand Down
Loading