-
Notifications
You must be signed in to change notification settings - Fork 27k
build: update to @bazel/bazel 1.0.0 #33367
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
Conversation
|
@gregmagolan could you please rebase this PR and resolve a conflict? Thank you. |
Also removes `build:remote --spawn_strategy=remote` from .bazelrc. It seems that with Bazel 1.0.0 setting `--incompatible_list_based_execution_strategy_selection=false` no longer works around the issue with npm_package that it did when it was added. The error that was originally observed has returned after updating to Bazel 1.0.0: ``` ERROR: /home/circleci/ng/packages/angular_devkit/build_optimizer/BUILD:66:1: Assembling npm package packages/angular_devkit/build_optimizer/npm_package failed: No usable spawn strategy found for spawn with mnemonic Action. Your --spawn_strategy, --genrule_strategy or --strategy flags are probably too strict. Visit bazelbuild/bazel#7480 for migration advice ``` This commit removes both `—incompatible_list_based_execution_strategy_selection=false` as well as `build:remote --spawn_strategy=remote` which means that Bazel will do the default behavior of picking the first available strategy from the default list, which is `remote,worker,sandboxed,local`. See bazelbuild/bazel#7480 for more details.
|
@AndrewKushnir Done |
josephperrott
left a comment
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.
Thanks for doing all this update! A few comments, mostly about making sure that we are applying active flags since the .bazelrc.notoolchain file alot of these came from was pretty dated.
.bazelrc
Outdated
|
|
||
| # Load default settings for Remote Build Execution. | ||
| import %workspace%/third_party/github.com/bazelbuild/bazel-toolchains/bazelrc/.bazelrc.notoolchain | ||
| # Starting with Bazel 0.27.0 strategies do not need to be explicitly |
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.
I think we should be fine to not comment on why we no longer have something in the code. As this is now the standard, it will become more obsolete as a comment as time goes on. Unless I am misunderstanding the situation and issue that you reference in this comment.
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.
👍 You have it correct and it will become obsolete. The comment comes from https://github.com/bazelbuild/bazel-toolchains/blob/master/bazelrc/bazel-1.0.0.bazelrc#L45 but in this context (which is not versioned) I think you're right that it is better to leave it out as it will become dated.
| import %workspace%/third_party/github.com/bazelbuild/bazel-toolchains/bazelrc/.bazelrc.notoolchain | ||
| # Starting with Bazel 0.27.0 strategies do not need to be explicitly | ||
| # defined. See https://github.com/bazelbuild/bazel/issues/7480 | ||
| build:remote --define=EXECUTOR=remote |
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.
We should note that this --define=EXECUTOR=remote will be able to be removed once https://github.com/bazelbuild/bazel/issues/7254 is fixed.
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.
👍
.bazelrc
Outdated
| build:remote --remote_executor=remotebuildexecution.googleapis.com | ||
|
|
||
| # Enable encryption. | ||
| build:remote --tls_enabled=true |
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.
We should be able to remove this as --tls_enabled is a noop: https://docs.bazel.build/versions/1.0.0/command-line-reference.html#flag--tls_enabled
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.
👍
| strip_prefix = "bazel-toolchains-0.28.2", | ||
| url = "https://github.com/bazelbuild/bazel-toolchains/archive/0.28.2.tar.gz", | ||
| sha256 = "0b36eef8a66f39c8dbae88e522d5bbbef49d5e66e834a982402c79962281be10", | ||
| strip_prefix = "bazel-toolchains-1.0.1", |
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.
Should this be toolchains 1.0.0 since we are going to bazel 1.0.0?
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.
Its sometimes off by a patch version. https://github.com/bazelbuild/bazel-toolchains/releases/tag/1.0.1 is still for Bazel 1.0.0
.bazelrc
Outdated
| build:remote --define=EXECUTOR=remote | ||
|
|
||
| # Enable remote execution so actions are performed on the remote systems. | ||
| build:remote --remote_executor=remotebuildexecution.googleapis.com |
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.
Can we move this remote_executor flag to line 134 to be located with the --remote_cache and --remote_instance_name flags?
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.
👍
.bazelrc
Outdated
| build:remote --tls_enabled=true | ||
|
|
||
| # Set a higher timeout value, just in case. | ||
| build:remote --remote_timeout=3600 |
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.
I know this is what we had previously coming from the our /third_party/.. code, but 3600 seconds seems excessive. If our remote builds either for execution and/or cache hits are taking an hour, I would rather fail earlier.
It seems to me that this makes more sense to be set as something like 600 (10 minutes) which is probably still longer than we are truly okay with it taking.
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.
👍
.bazelrc
Outdated
| # Enable authentication. This will pick up application default credentials by | ||
| # default. You can use --auth_credentials=some_file.json to use a service | ||
| # account credential instead. | ||
| build:remote --auth_enabled=true |
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.
This can be removed as it is actually already enabled with --google_default_credentials. auth_enabled is the old name of the flag: https://github.com/bazelbuild/bazel/blob/d2de8ee925710b757a637bc8ad1036546a030756/src/main/java/com/google/devtools/build/lib/authandtls/AuthAndTLSOptions.java#L30
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.
👍
josephperrott
left a comment
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.
Thanks for doing all this update! A few comments, mostly about making sure that we are applying active flags since the .bazelrc.notoolchain file alot of these came from was pretty dated.
|
Thanks for the detailed review @josephperrott! Updating... |
josephperrott
left a comment
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.
LGTM
|
Note: this was reverted because of a Windows CI failure with Bazel 1.0.0 https://app.circleci.com/jobs/github/angular/angular/501770: Investigating... |
|
NOTE: I attempted to update to @bazel/bazel 1.1.0 in this PR but it created another issue in CI with docker access permissions: Looks like due to a change in rbe_autoconfig with bazel_tools 1.1.0. Will leave that battle for another day. |
Also removes `build:remote --spawn_strategy=remote` from .bazelrc. It seems that with Bazel 1.0.0 setting `--incompatible_list_based_execution_strategy_selection=false` no longer works around the issue with npm_package that it did when it was added. The error that was originally observed has returned after updating to Bazel 1.0.0: ``` ERROR: /home/circleci/ng/packages/angular_devkit/build_optimizer/BUILD:66:1: Assembling npm package packages/angular_devkit/build_optimizer/npm_package failed: No usable spawn strategy found for spawn with mnemonic Action. Your --spawn_strategy, --genrule_strategy or --strategy flags are probably too strict. Visit bazelbuild/bazel#7480 for migration advice ``` This commit removes both `—incompatible_list_based_execution_strategy_selection=false` as well as `build:remote --spawn_strategy=remote` which means that Bazel will do the default behavior of picking the first available strategy from the default list, which is `remote,worker,sandboxed,local`. See bazelbuild/bazel#7480 for more details. Not updating to Bazel 1.1.0 yet due to a docker permissions CI issue that was observed on the angular repo that is unresolved. See #33367 (comment). PR Close #33476
Not updating to Bazel 1.1.0 yet due to a docker permissions CI issue that was observed on the angular repo that is unresolved. See #33367 (comment). PR Close #33476
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Also removes
build:remote --spawn_strategy=remotefrom .bazelrc. It seems that with Bazel 1.0.0 setting--incompatible_list_based_execution_strategy_selection=falseno longer works around the issue with npm_package that it did when it was added. The error that was originally observed has returned after updating to Bazel 1.0.0:This commit removes both
—incompatible_list_based_execution_strategy_selection=falseas well asbuild:remote --spawn_strategy=remotewhich means that Bazel will do the default behavior of picking the first available strategy from the default list, which isremote,worker,sandboxed,local. See bazelbuild/bazel#7480 for more details.