Repository navigation
Closed
Labels
P2We'll consider working on this in future. (Assignee optional)team-Remote-ExecIssues and PRs for the Execution (Remote) teamtype: bugtype: feature request
Milestone
Description
Description of the problem / feature request:
If a flag that defaults to null is passed in .bazelrc or bazel.rc, it is impossible to set it to null on the command line.
Feature requests: what underlying problem are you trying to solve with this feature?
Enable remote caching by default, but be able to disable it on the command line. To do this I specify the remote caching flags in bazel.rc, but wish to override them on the command line, which isn't possible.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
bazel.rc:
build --google_credentials=/path/to/key
build --google_default_credentials
build --google_auth_scopes=https://www.googleapis.com/auth/cloud-source-tools
build --bes_backend=buildeventservice.googleapis.com
build --bes_best_effort=false
build --bes_timeout=10s
build --project_id=123456
build --remote_cache=remotebuildexecution.googleapis.com
build --remote_instance_name=projects/myproject
build --spawn_strategy=remote
build --genrule_strategy=remote
build --tls_enabled=1
build --remote_accept_cached=true
It is now impossible to set --google_credentials to null so that it doesn't look for a key:
sgreens@sgreens0$ bazel build ... --google_credentials=
ERROR: Could not open auth credentials file '': (No such file or directory)
INFO: Streaming Build Event Protocol to buildeventservice.googleapis.com build_request_id: xxx invocation_id: xxx
ERROR: Build Event Protocol upload failed: Could not open auth credentials file '': (No such file or directory)
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:871)
at com.google.devtools.build.lib.events.Event.<init>(Event.java:52)
at com.google.devtools.build.lib.events.Event.error(Event.java:165)
at com.google.devtools.build.lib.events.Event.error(Event.java:200)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:474)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:218)
at com.google.devtools.build.lib.runtime.CommandExecutor.exec(CommandExecutor.java:58)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:851)
at com.google.devtools.build.lib.server.GrpcServerImpl.access$2100(GrpcServerImpl.java:109)
at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:916)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:871)
at com.google.devtools.build.lib.events.Event.<init>(Event.java:52)
at com.google.devtools.build.lib.events.Event.error(Event.java:165)
at com.google.devtools.build.lib.events.Event.error(Event.java:200)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:474)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:218)
at com.google.devtools.build.lib.runtime.CommandExecutor.exec(CommandExecutor.java:58)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:851)
at com.google.devtools.build.lib.server.GrpcServerImpl.access$2100(GrpcServerImpl.java:109)
at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:916)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
What operating system are you running Bazel on?
Rodete
What's the output of bazel info release?
0.10.0
Have you found anything relevant by searching the web?
Reacted by Aaron Bull Schaefer, Akshay Shah, Paris Morgan and Albert Lloveras
Metadata
Metadata
Assignees
Labels
P2We'll consider working on this in future. (Assignee optional)team-Remote-ExecIssues and PRs for the Execution (Remote) teamtype: bugtype: feature request
Activity
philwo commentedon Feb 15, 2018
Thanks for the report @sgreenstein! This looks like a pretty straightforward fix. I'll change our options for remote execution / caching to not use
nullto indicate the default, but instead an empty string.philwo commentedon Feb 15, 2018
FYI @buchgr
buchgr commentedon Mar 7, 2018
will fix.
[-]Flags specified in bazel.rc cannot be set back to null[/-][+]support disabling --remote_* flags on the command line.[/+]jparismorgan commentedon Jul 11, 2022
Hi there, I am also impacted by the same issue. @philwo / @buchgr, do you know if this is still planned to be fixed? @sgreenstein, did you find a workaround to this? Thanks!
Allow TLS flags to be reset (#29312)
Allow unsetting remote execution, remote caching, and auth flags on t…