Skip to content

Commit 7ef087b

Browse files
committed
fix: move flags that should only be set with bazel 6 to bazel6.bazelrc recommended settings
1 parent 71260d8 commit 7ef087b

File tree

7 files changed

+37
-22
lines changed

7 files changed

+37
-22
lines changed

.aspect/bazelrc/bazel6.bazelrc

+12
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,15 @@ build --reuse_sandbox_directories
1313
# Avoid this flag being enabled by remote_download_minimal or remote_download_toplevel
1414
# See https://meroton.com/blog/bazel-6-errors-build-without-the-bytes/
1515
build --noexperimental_action_cache_store_output_metadata
16+
17+
# Speed up all builds by not checking if output files have been modified. Lets you make changes to
18+
# the output tree without triggering a build for local debugging. For example, you can modify
19+
# [rules_js](https://github.com/aspect-build/rules_js) 3rd party npm packages in the output tree
20+
# when local debugging.
21+
# Docs: https://github.com/bazelbuild/bazel/blob/1af61b21df99edc2fc66939cdf14449c2661f873/src/main/java/com/google/devtools/build/lib/pkgcache/PackageOptions.java#L185
22+
# NB: This flag is in bazel6.bazelrc as when used in Bazel 7 is has been observed to break
23+
# "build without the bytes" --remote_download_outputs=toplevel. See https://github.com/aspect-build/bazel-lib/pull/711
24+
# for more info.
25+
build --noexperimental_check_output_files
26+
fetch --noexperimental_check_output_files
27+
query --noexperimental_check_output_files

.aspect/bazelrc/bazel7.bazelrc

-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ query --noexperimental_check_external_repository_files
99
# build.
1010
# Docs: https://bazel.build/reference/command-line-reference#flag--reuse_sandbox_directories
1111
build --reuse_sandbox_directories
12-
13-
# Avoid this flag being enabled by remote_download_minimal or remote_download_toplevel
14-
# See https://meroton.com/blog/bazel-6-errors-build-without-the-bytes/
15-
build --noexperimental_action_cache_store_output_metadata

.aspect/bazelrc/performance.bazelrc

-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
# Speed up all builds by not checking if output files have been modified. Lets you make changes to
2-
# the output tree without triggering a build for local debugging. For example, you can modify
3-
# [rules_js](https://github.com/aspect-build/rules_js) 3rd party npm packages in the output tree
4-
# when local debugging.
5-
# Docs: https://github.com/bazelbuild/bazel/blob/1af61b21df99edc2fc66939cdf14449c2661f873/src/main/java/com/google/devtools/build/lib/pkgcache/PackageOptions.java#L185
6-
build --noexperimental_check_output_files
7-
fetch --noexperimental_check_output_files
8-
query --noexperimental_check_output_files
9-
101
# Don't apply `--noremote_upload_local_results` and `--noremote_accept_cached` to the disk cache.
112
# If you have both `--noremote_upload_local_results` and `--disk_cache`, then this fixes a bug where
123
# Bazel doesn't write to the local disk cache as it treats as a remote cache.

lib/bazelrc_presets.bzl

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
44

55
ALL_PRESETS = [
66
"bazel6",
7+
"bazel7",
78
"ci",
89
"convenience",
910
"correctness",
@@ -38,6 +39,7 @@ def write_aspect_bazelrc_presets(
3839
name = "update_aspect_bazelrc_presets",
3940
presets = [
4041
"bazel6",
42+
"bazel7",
4143
"ci",
4244
"convenience",
4345
"correctness",

lib/tests/bazelrc_presets/all/bazel6.bazelrc

+12
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,15 @@ build --reuse_sandbox_directories
1313
# Avoid this flag being enabled by remote_download_minimal or remote_download_toplevel
1414
# See https://meroton.com/blog/bazel-6-errors-build-without-the-bytes/
1515
build --noexperimental_action_cache_store_output_metadata
16+
17+
# Speed up all builds by not checking if output files have been modified. Lets you make changes to
18+
# the output tree without triggering a build for local debugging. For example, you can modify
19+
# [rules_js](https://github.com/aspect-build/rules_js) 3rd party npm packages in the output tree
20+
# when local debugging.
21+
# Docs: https://github.com/bazelbuild/bazel/blob/1af61b21df99edc2fc66939cdf14449c2661f873/src/main/java/com/google/devtools/build/lib/pkgcache/PackageOptions.java#L185
22+
# NB: This flag is in bazel6.bazelrc as when used in Bazel 7 is has been observed to break
23+
# "build without the bytes" --remote_download_outputs=toplevel. See https://github.com/aspect-build/bazel-lib/pull/711
24+
# for more info.
25+
build --noexperimental_check_output_files
26+
fetch --noexperimental_check_output_files
27+
query --noexperimental_check_output_files
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Speed up all builds by not checking if external repository files have been modified.
2+
# Docs: https://github.com/bazelbuild/bazel/blob/1af61b21df99edc2fc66939cdf14449c2661f873/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java#L244
3+
build --noexperimental_check_external_repository_files
4+
fetch --noexperimental_check_external_repository_files
5+
query --noexperimental_check_external_repository_files
6+
7+
# Directories used by sandboxed non-worker execution may be reused to avoid unnecessary setup costs.
8+
# Save time on Sandbox creation and deletion when many of the same kind of action run during the
9+
# build.
10+
# Docs: https://bazel.build/reference/command-line-reference#flag--reuse_sandbox_directories
11+
build --reuse_sandbox_directories

lib/tests/bazelrc_presets/all/performance.bazelrc

-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
# Speed up all builds by not checking if output files have been modified. Lets you make changes to
2-
# the output tree without triggering a build for local debugging. For example, you can modify
3-
# [rules_js](https://github.com/aspect-build/rules_js) 3rd party npm packages in the output tree
4-
# when local debugging.
5-
# Docs: https://github.com/bazelbuild/bazel/blob/1af61b21df99edc2fc66939cdf14449c2661f873/src/main/java/com/google/devtools/build/lib/pkgcache/PackageOptions.java#L185
6-
build --noexperimental_check_output_files
7-
fetch --noexperimental_check_output_files
8-
query --noexperimental_check_output_files
9-
101
# Don't apply `--noremote_upload_local_results` and `--noremote_accept_cached` to the disk cache.
112
# If you have both `--noremote_upload_local_results` and `--disk_cache`, then this fixes a bug where
123
# Bazel doesn't write to the local disk cache as it treats as a remote cache.

0 commit comments

Comments
 (0)