bazel-contrib / bazel-contrib/rules_foreign_cc
Bazel Doesn't Pass --action_env to BootStrapGNUMake
- Dominant language
- Starlark
- Stars
- 737
- Forks
- 270
- PR merge metrics
- No merged PRs in 30d
Description
This question extends my previous post: : https://github.com/bazel-contrib/rules_foreign_cc/issues/1367
I am using rules_foreign_cc in Bazel to build a project, but I noticed that BootStrapGNUMake does not inherit environment variables set using --action_env.
**Problem:**
Bazel first builds BootStrapGNUMake (an internal GNU Make instance) before executing make.
Environment variables set with --action_env are not visible during this stage.
Since BootStrapGNUMake runs before make, it does not inherit the environment variables.
**What I Tried:**
Using --action_env=VAR=value in the Bazel command.
Setting env = {...} and build_data = {..} inside the make rule.
None of these approaches worked, as BootStrapGNUMake runs in an isolated environment.
**Question:**
How can I pass environment variables to BootStrapGNUMake?
Is there a proper way to ensure the required environment variables are available before make executes?
Contributor guide
Research direction
No source files or tests are named. Start by reproducing the issue with --action_env and inspect how BootStrapGNUMake is invoked before make; done means establishing a supported way for the required environment variables to reach that bootstrap step.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100