bazel-contrib / bazel-contrib/rules_foreign_cc

user-provided make variables should override resolved toolchain ones

Open
#1,033 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
737
Forks
270
PR merge metrics
No merged PRs in 30d

Description

When we pass environment variables for flags (e.g. `ARFLAGS`), I noticed that it appends to the resolved toolchain values. This is not always desired, and I expected it to be set to the value I gave it.

Like outside Bazel, if we want to inherit an environment flag, I'd expect the same to be true here. E.g. `ARFLAGS="${ARFLAGS:-} foobar"`. Or the classic `export PATH="${PATH}:/some/dir"`.

I'm posting here to start a discussion of what would be the best way to fix this without breaking the world. Or am I overlooking something obvious?

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by locating how environment flag variables such as ARFLAGS are combined with resolved toolchain values, then determine the compatibility requirements; done means user-provided values override those defaults while explicit inheritance patterns remain possible.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.