Skip to content

Allow bazelrc to use Environment Variables. #4635

@tejal29

Description

@tejal29

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions