Skip to content

Commit 05b5924

Browse files
authored
Update config.yaml (#604)
1 parent 6966042 commit 05b5924

File tree

9 files changed

+276
-47
lines changed

9 files changed

+276
-47
lines changed

.aspect/workflows/config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ workspaces:
1010
- bzlmod-false:
1111
without: true
1212
- example
13-
13+
bazel:
14+
flags:
15+
- --config=ci
1416
tasks:
1517
- lint:
1618
- test:

.bazelrc

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
# Bazel settings that apply to this repository.
2-
# Take care to document any settings that you expect users to apply.
3-
# Settings that apply only to CI are in .github/workflows/ci.bazelrc
1+
import %workspace%/tools/preset.bazelrc
42

5-
# Don’t want to push a rules author to update their deps if not needed.
6-
# https://bazel.build/reference/command-line-reference#flag--check_direct_dependencies
7-
# https://bazelbuild.slack.com/archives/C014RARENH0/p1691158021917459?thread_ts=1691156601.420349&cid=C014RARENH0
8-
common --check_direct_dependencies=off
3+
common --config=ruleset
94

105
# Don't build protoc from the cc_binary, it's slow and spammy when cache miss
116
common --incompatible_enable_proto_toolchain_resolution
@@ -17,12 +12,3 @@ common --incompatible_config_setting_private_default_visibility
1712

1813
# Do not autoload any legacy symbols that are now provided in separate repos.
1914
common --incompatible_autoload_externally=
20-
21-
# Load any settings specific to the current user.
22-
# .bazelrc.user should appear in .gitignore so that settings are not shared with team members
23-
# This needs to be last statement in this
24-
# config, as the user configuration should be able to overwrite flags from this file.
25-
# See https://docs.bazel.build/versions/master/best-practices.html#bazelrc
26-
# (Note that we use .bazelrc.user so the file appears next to .bazelrc in directory listing,
27-
# rather than user.bazelrc as suggested in the Bazel docs)
28-
try-import %workspace%/.bazelrc.user

MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ register_toolchains("@sarif_parser_toolchains//:all")
4242

4343
####### Dev dependencies ########
4444

45+
bazel_dep(name = "bazelrc-preset.bzl", version = "1.1.0", dev_dependency = True)
46+
4547
# To allow /tools to be built from source
4648
# NOTE: when publishing to BCR, we patch this to be True, as we publish pre-built binaries with our releases.
4749
IS_RELEASE = False

docs/.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import %workspace%/../tools/preset.bazelrc
2+
13
# Never Compile protoc Again
24
# Don't build protoc from the cc_binary, it's slow and spammy when cache miss
35
common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT

example/.bazelrc

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import %workspace%/../tools/preset.bazelrc
2+
import %workspace%/tools/java17.bazelrc
3+
14
# Automatically apply --config=linux, --config=windows etc
25
common --enable_platform_specific_config
36

@@ -6,32 +9,6 @@ common --experimental_isolated_extension_usages
69

710
# Aspect recommended Bazel flags when using rules_java and rules_jvm_external
811

9-
# Pin java versions to desired language level
10-
# See https://bazel.build/docs/bazel-and-java#java-versions
11-
# and https://en.wikipedia.org/wiki/Java_version_history
12-
13-
# What version of Java are the source files in this repo?
14-
# See https://bazel.build/docs/user-manual#java-language-version
15-
common --java_language_version=17
16-
17-
# The Java language version used to build tools that are executed during a build
18-
# See https://bazel.build/docs/user-manual#tool-java-language-version
19-
common --tool_java_language_version=17
20-
21-
# The version of JVM to use to execute the code and run the tests.
22-
# NB: The default value is local_jdk which is non-hermetic.
23-
# See https://bazel.build/docs/user-manual#java-runtime-version
24-
common --java_runtime_version=remotejdk_17
25-
26-
# The version of JVM used to execute tools that are needed during a build.
27-
# See https://bazel.build/docs/user-manual#tool-java-runtime-version
28-
common --tool_java_runtime_version=remotejdk_17
29-
30-
# Repository rules, such as rules_jvm_external: put Bazel's JDK on the path.
31-
# Avoids non-hermeticity from dependency on a JAVA_HOME pointing at a system JDK
32-
# see https://github.com/bazelbuild/rules_jvm_external/issues/445
33-
common --repo_env=JAVA_HOME=../bazel_tools/jdk
34-
3512
common --incompatible_enable_proto_toolchain_resolution
3613
common --@aspect_rules_ts//ts:skipLibCheck=always
3714

@@ -42,8 +19,5 @@ startup --windows_enable_symlinks
4219
common:linux --action_env=BAZEL_CXXOPTS="-std=c++20"
4320
common:windows --action_env=BAZEL_CXXOPTS="/std:c++20"
4421

45-
# ensure that minimal other envvars are passed by clang-tidy run_shell
46-
common --incompatible_strict_action_env
47-
4822
# Do not autoload any legacy symbols that are now provided in separate repos.
4923
common --incompatible_autoload_externally=

example/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ bazel_dep(name = "aspect_rules_ts", version = "3.0.0")
1010
bazel_dep(name = "rules_buf", version = "0.3.0")
1111
bazel_dep(name = "bazel_features", version = "1.29.0")
1212
bazel_dep(name = "bazel_skylib", version = "1.4.2")
13-
bazel_dep(name = "toolchains_llvm", version = "0.10.3")
13+
bazel_dep(name = "toolchains_llvm", version = "1.1.2")
1414
bazel_dep(name = "toolchains_protoc", version = "0.3.7")
1515
bazel_dep(name = "rules_java", version = "8.5.0")
1616
bazel_dep(name = "rules_jvm_external", version = "6.5")

example/tools/java17.bazelrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Pin java versions to desired language level
2+
# See https://bazel.build/docs/bazel-and-java#java-versions
3+
# and https://en.wikipedia.org/wiki/Java_version_history
4+
5+
# What version of Java are the source files in this repo?
6+
# See https://bazel.build/docs/user-manual#java-language-version
7+
common --java_language_version=17
8+
9+
# The Java language version used to build tools that are executed during a build
10+
# See https://bazel.build/docs/user-manual#tool-java-language-version
11+
common --tool_java_language_version=17
12+
13+
# The version of JVM to use to execute the code and run the tests.
14+
# NB: The default value is local_jdk which is non-hermetic.
15+
# See https://bazel.build/docs/user-manual#java-runtime-version
16+
common --java_runtime_version=remotejdk_17
17+
18+
# The version of JVM used to execute tools that are needed during a build.
19+
# See https://bazel.build/docs/user-manual#tool-java-runtime-version
20+
common --tool_java_runtime_version=remotejdk_17

tools/BUILD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
load("@bazelrc-preset.bzl", "bazelrc_preset")
2+
3+
bazelrc_preset(
4+
name = "preset",
5+
strict = True,
6+
)

0 commit comments

Comments
 (0)