-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Comments
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.
specifying --action_env with just the variable names tells bazel to inherit
that variable from the caller environment. So, adding
build --action_evn=GIT_ROOT
to the respective rc-file and an exporting GIT_ROOT in your shell provides
the information to actions without the need of changing the syntax of rc-files.
…--
Klaus Aehlig
Google Germany GmbH, Erika-Mann-Str. 33, 80636 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Paul Terence Manicle, Halimah DeLaine Prado
|
Seems like this is solved, closing. Please reopen if necessary. |
Just to make sure- the general feature isn’t solved but the specific case,
right?
…On Thu, 15 Feb 2018 at 17:56 Philipp Wollermann ***@***.***> wrote:
Closed #4635 <#4635>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4635 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF0Q7-biDeWbgQDmjPPYOBCkbNmAPks5tVFOjgaJpZM4SEvZd>
.
|
@ittaiz Yes, the case of "I want to have an environment variable available in the environment of my running actions" should be solved via The case of "I want to use environment variables in my .bazelrc via string interpolation" like If you want / need that, I'd suggest to file a new FR for that :) |
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
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?
The text was updated successfully, but these errors were encountered: