-
Notifications
You must be signed in to change notification settings - Fork 516
[build] Update to Bazel 9 #5937
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
base: main
Are you sure you want to change the base?
Conversation
|
The generated output of |
9a3034d to
c5bee37
Compare
c5bee37 to
9ea8c01
Compare
| # Enable optimizations to reduce coverage overhead while maintaining good coverage quality | ||
| build:coverage --copt=-O2 | ||
| build:coverage --copt=-DNDEBUG | ||
| build:coverage --combined_report=lcov |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
|
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. |
| 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) |
There was a problem hiding this comment.
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.
No description provided.