Skip to content

Conversation

@fhanau
Copy link
Contributor

@fhanau fhanau commented Jan 20, 2026

No description provided.

@github-actions
Copy link

github-actions bot commented Jan 20, 2026

The generated output of @cloudflare/workers-types matches the snapshot in types/generated-snapshot 🎉

@fhanau fhanau force-pushed the felix/012026-bazel9 branch 3 times, most recently from 9a3034d to c5bee37 Compare January 21, 2026 00:47
@fhanau fhanau force-pushed the felix/012026-bazel9 branch 2 times, most recently from c5bee37 to 9ea8c01 Compare January 21, 2026 00:54
@fhanau fhanau changed the title [DRAFT][not for merge][build] Update to Bazel 9 [DRAFT][build] Update to Bazel 9 Jan 21, 2026
# Enable optimizations to reduce coverage overhead while maintaining good coverage quality
build:coverage --copt=-O2
build:coverage --copt=-DNDEBUG
build:coverage --combined_report=lcov
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All settings removed from this file have been flipped in Bazel 9.

# 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
Copy link
Contributor Author

@fhanau fhanau Jan 21, 2026

Choose a reason for hiding this comment

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

Without this, there were compile errors based on Werror when compiling workerd code that includes 3rd party headers which are now passed using -I. By enabling this new feature, we preserve the old behavior of passing includes with -isystem.
This is not the only way to address this problem: We could also ignore warnings where needed or patch 3rd party dependencies to fix the warnings and try to upstream those patches, but this approach feels like the most elegant.

# 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"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

workerd itself already has the rules_cc imports it needs, but brotli, perfetto, V8 and other external deps do not. It is much easier to autoload them until those have been updated.

@fhanau fhanau changed the title [DRAFT][build] Update to Bazel 9 [build] Update to Bazel 9 Jan 21, 2026
@fhanau
Copy link
Contributor Author

fhanau commented Jan 21, 2026

Managed to get this to work much earlier than expected 💪 Previous Bazel major releases have been relatively bug-prone – if this gains approval earlier I plan to not merge this until at least Friday to see if any major bugs surface until then.

@fhanau fhanau marked this pull request as ready for review January 21, 2026 03:06
@fhanau fhanau requested review from a team as code owners January 21, 2026 03:06
build --test_size_filters=-enormous

# use lower test timeouts: https://bazel.build/reference/test-encyclopedia#role-test-runner
# corresponds to small,medium,large,enormous tests (medium is default)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From the Bazel 9 release notes: [Incompatible] The canonical names of repos created with use_repo_rule have changed to be more stable. This may require updating command-line flags such as --override_repository if you're using canonical repo names; however, note that --override_repository now also supports apparent repo names (see below). see if compile_flags.txt or external paths elsewhere needs to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants