Skip to content
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
33 changes: 16 additions & 17 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@ build --test_size_filters=-enormous
# corresponds to small,medium,large,enormous tests (medium is default)
build --test_timeout=3,15,60,240

# As part of starlarkification, Bazel 8 removes a number of rules which now need to be imported from
# other repositories. In the long term, load() statements will be needed to import these rules. For
# now, we can still autoload the affected repositories when needed. Do this only for a remaining
# protobuf components instead of the larger default autoload set – perfetto isn't importing all
# required rules yet, but we don't want to accidentally rely on autoloading more dependencies.
common --incompatible_autoload_externally="+ProtoInfo"

# Bazel 9 forward compatibility: Disable native repo rules.
build --incompatible_disable_native_repo_rules
# As part of starlarkification, Bazel 8 and 9 remove a number of rules which now need to be imported
# from other repositories. In the long term, load() statements will be needed to import these rules.
# For now, we can still autoload the affected repositories when needed. Do this only for a remaining
# protobuf components and rules_cc (needed with Bazel 9).
common --incompatible_autoload_externally="+ProtoInfo,+cc_binary,+cc_import,+cc_library,+cc_shared_library,+cc_test,+cc_toolchain"

# bazel7 enables Build without the Bytes (BwoB) by default. This significantly speeds up builds
# using the remote cache since less data needs to be fetched.
Expand All @@ -34,16 +30,20 @@ import %workspace%/build/ci.bazelrc
import %workspace%/build/rust_lint.bazelrc
import %workspace%/build/tools/clang_tidy/clang_tidy.bazelrc

# Prevents bazel cache invalidation when switching terminals
build --incompatible_strict_action_env

# Use compat repo mapping to avoid O(n^2) repo mapping size, speeding up bazel repo mapping phase
# and conserving space
build --incompatible_compact_repo_mapping_manifest

# Continue building locally when remote cache entries fail to materialize
build --incompatible_remote_local_fallback_for_remote_cache

# TODO(soon): Flipped by default in Bazel 9, add required variables to --repo_env and enable
build --noincompatible_repo_env_ignores_action_env

# Use -isystem for cc_library includes attribute – this prevents warnings for misbehaving external
# code.
build:linux --features=external_include_paths --host_features=external_include_paths

# Forward compatibility with future Bazel versions:
# Disable deprecated cfg = "host" Bazel rule setting. Blocked on perfetto.
# common --incompatible_disable_starlark_host_transitions

# Our dependencies (ICU, zlib, etc.) produce a lot of these warnings, so we disable them.
build --per_file_copt='external@-Wno-error'
build --per_file_copt='external@-Wno-suggest-override'
Expand Down Expand Up @@ -473,7 +473,6 @@ coverage --config=wpt-test
coverage --test_size_filters=-enormous
coverage --test_timeout=240,240,240,240
coverage --build_tests_only
coverage --combined_report=lcov

# This config is defined internally and enabled on many machines.
# Defining it as empty just so these machines can run build commands from the workerd repo
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.5.1
9.0.0
4 changes: 3 additions & 1 deletion build/cc_ast_dump.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def _cc_ast_dump_impl(ctx):
user_compile_flags = ["-Wno-unused-command-line-argument", "-Xclang", "-ast-dump=json", "-fsyntax-only"] + ctx.fragments.cpp.copts + ctx.fragments.cpp.cxxopts,
include_directories = cc_info.compilation_context.includes,
quote_include_directories = cc_info.compilation_context.quote_includes,
system_include_directories = cc_info.compilation_context.system_includes,
# we need to pass external_includes, but there is no equivalent parameter in
# create_compile_variables – pass alongside system_includes.
system_include_directories = depset(transitive = [cc_info.compilation_context.system_includes, cc_info.compilation_context.external_includes]),
framework_include_directories = cc_info.compilation_context.framework_includes,
preprocessor_defines = cc_info.compilation_context.defines,
)
Expand Down
5 changes: 0 additions & 5 deletions build/deps/build_deps.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@
"name": "rules_cc",
"type": "bazel_dep"
},
// Rust
{
"name": "rules_rust",
"type": "bazel_dep"
},
// Node.js
{
"name": "aspect_rules_esbuild",
Expand Down
3 changes: 0 additions & 3 deletions build/deps/gen/build_deps.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,5 @@ bazel_dep(name = "rules_oci", version = "2.2.7")
# rules_python
bazel_dep(name = "rules_python", version = "1.8.0")

# rules_rust
bazel_dep(name = "rules_rust", version = "0.68.1")

# rules_shell
bazel_dep(name = "rules_shell", version = "0.6.1")
14 changes: 14 additions & 0 deletions build/deps/rust.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ RUST_TARGET_TRIPLES = [
"aarch64-unknown-linux-gnu",
]

# rules_rust
bazel_dep(name = "rules_rust", version = "0.68.1")

# Under Bazel 9, Rust coverage is broken when using experimental_split_coverage_postprocessing.
# TODO(cleanup): https://github.com/bazelbuild/rules_rust/pull/3812 should fix this, we're using
# that commit for now. Switch back to regular release once resolved.
archive_override(
module_name = "rules_rust",
integrity = "sha256-dtn87CNPspDl5xEfAGEl0eQ4HBf07vpxIdMNPRHqMqM=",
strip_prefix = "bazelbuild-rules_rust-cb9d412",
type = "tgz",
url = "https://github.com/bazelbuild/rules_rust/tarball/cb9d412afdb95578bd533b60483eecb373119c36",
)

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
allocator_library = "@rules_rust//ffi/rs:empty",
Expand Down
6 changes: 6 additions & 0 deletions build/tools/clang_tidy/clang_tidy.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def _clang_tidy_aspect_impl(target, ctx):
includes = compilation_context.includes.to_list()
quote_includes = compilation_context.quote_includes.to_list()
system_includes = compilation_context.system_includes.to_list()
external_includes = compilation_context.external_includes.to_list()
headers = compilation_context.headers

# disable clang tidy if no-clang-tidy tag is defined.
Expand Down Expand Up @@ -84,6 +85,10 @@ def _clang_tidy_aspect_impl(target, ctx):
quote_includes,
transitive = [dep.quote_includes for dep in deps],
)
external_includes = depset(
external_includes,
transitive = [dep.external_includes for dep in deps],
)
headers = depset(
headers.to_list(),
transitive = [dep.headers for dep in deps],
Expand Down Expand Up @@ -130,6 +135,7 @@ def _clang_tidy_aspect_impl(target, ctx):
args.add_all(includes, before_each = "-I")
args.add_all(quote_includes, before_each = "-iquote")
args.add_all(system_includes, before_each = "-isystem")
args.add_all(external_includes, before_each = "-isystem")

args.add_all(toolchain_flags)

Expand Down
4 changes: 2 additions & 2 deletions compile_flags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-stdlib=libc++
-xc++
-nostdinc
-Ibazel-bin/external/+_repo_rules+com_cloudflare_lol_html/_virtual_includes/lolhtml
-Ibazel-bin/external/+new_local_repository+com_cloudflare_lol_html/_virtual_includes/lolhtml
-Ibazel-bin/external/perfetto+/
-Iexternal/ada-url+/
-Iexternal/abseil-cpp+/
Expand Down Expand Up @@ -46,7 +46,7 @@
-isystemexternal/+_repo_rules2+v8/include/cppgc
-isystembazel-bin/src
-isystemexternal/brotli+/c/include
-isystemexternal/+_repo_rules3+com_googlesource_chromium_icu/source/common
-isystembazel-bin/external/+git_repository+com_googlesource_chromium_icu/_virtual_includes/icu/third_party/icu/source/common
-isystemexternal/zlib+
-isystembazel-bin/src/rust/cxx-integration/_virtual_includes/lib.rs@cxx
-isystembazel-bin/src/rust/cxx-integration-test/_virtual_includes/lib.rs@cxx
Expand Down
Loading