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

Allow bazelrc to use Environment Variables. #4635

Closed
tejal29 opened this issue Feb 14, 2018 · 4 comments
Closed

Allow bazelrc to use Environment Variables. #4635

tejal29 opened this issue Feb 14, 2018 · 4 comments

Comments

@tejal29
Copy link

tejal29 commented Feb 14, 2018

ATTENTION! Please read and follow:

Description of the problem / feature request:

Right now, I could not find a way to use environment variables in .bazelrc.
What i want to do is

$export GIT_ROOT=/workspace/project_name
and then in /workspace/project_name/.bazelrc
$cat /workspace/project_name/.bazelrc
build --action_env=GIT_ROOT="$GIT_ROOT"  # where $GIT_ROOT is the environment variable.

Feature requests: what underlying problem are you trying to solve with this feature?

Pass on Environment variable to a bazel rule which runs a script.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

What operating system are you running Bazel on?

Linux and mac

What's the output of bazel info release?

latest

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

Have you found anything relevant by searching the web?

Read,

Any other information, logs, or outputs that you want to share?

@aehlig
Copy link
Contributor

aehlig commented Feb 14, 2018 via email

@philwo
Copy link
Member

philwo commented Feb 15, 2018

Seems like this is solved, closing. Please reopen if necessary.

@philwo philwo closed this as completed Feb 15, 2018
@ittaiz
Copy link
Member

ittaiz commented Feb 15, 2018 via email

@philwo
Copy link
Member

philwo commented Feb 15, 2018

@ittaiz Yes, the case of "I want to have an environment variable available in the environment of my running actions" should be solved via --action_env=MY_VAR.

The case of "I want to use environment variables in my .bazelrc via string interpolation" like build --jobs=$BAZEL_MAX_JOBS is not solved, but it's not clear if we should even support it.

If you want / need that, I'd suggest to file a new FR for that :)

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

No branches or pull requests

4 participants