Skip to content
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

support disabling --remote_* flags on the command line. #4595

Open
sgreenstein opened this issue Feb 7, 2018 · 4 comments
Open

support disabling --remote_* flags on the command line. #4595

sgreenstein opened this issue Feb 7, 2018 · 4 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug type: feature request

Comments

@sgreenstein
Copy link
Contributor

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?

https://stackoverflow.com/questions/48652798/how-do-i-unset-flags-set-in-bazelrc/

@philwo philwo self-assigned this Feb 15, 2018
@philwo philwo added type: bug P2 We'll consider working on this in future. (Assignee optional) category: remote execution / caching labels Feb 15, 2018
@philwo
Copy link
Member

philwo commented 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 null to indicate the default, but instead an empty string.

@philwo
Copy link
Member

philwo commented Feb 15, 2018

FYI @buchgr

@buchgr buchgr assigned buchgr and unassigned philwo Mar 7, 2018
@buchgr
Copy link
Contributor

buchgr commented Mar 7, 2018

will fix.

@buchgr buchgr added this to the Remote Execution milestone Aug 6, 2018
@buchgr buchgr changed the title Flags specified in bazel.rc cannot be set back to null support disabling --remote_* flags on the command line. Jan 16, 2019
@buchgr buchgr added team-Remote-Exec Issues and PRs for the Execution (Remote) team type: feature request and removed category: remote execution / caching labels Jan 16, 2019
@buchgr buchgr removed their assignment Jan 9, 2020
@meisterT meisterT removed this from the Remote Execution milestone May 12, 2020
@aiuto aiuto added this to the Bazel Offline Mode milestone Dec 11, 2021
@jparismorgan
Copy link

jparismorgan commented 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!

@meisterT meisterT added untriaged and removed P2 We'll consider working on this in future. (Assignee optional) labels Jun 13, 2024
@tjgq tjgq added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug type: feature request
Projects
None yet
Development

No branches or pull requests

9 participants