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

Fix _get_make_variables ignoring user environment variables #1230

Merged
merged 4 commits into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions foreign_cc/private/make_env_vars.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,14 @@ def _get_make_variables(workspace_name, tools, flags, user_env_vars, make_comman
vars = {}

for flag in _MAKE_FLAGS:
flag_value = getattr(flags, _MAKE_FLAGS[flag])
if flag_value:
vars[flag] = flag_value

# Merge flags lists
for user_var in user_env_vars:
toolchain_val = vars.get(user_var)
if toolchain_val:
vars[user_var] = toolchain_val + [user_env_vars[user_var]]
toolchain_flags = getattr(flags, _MAKE_FLAGS[flag], [])
user_flags = [
user_flag
for user_flag in user_env_vars.get(flag, "").split(" ")
if user_flag
]
if toolchain_flags or user_flags:
vars[flag] = toolchain_flags + user_flags

tools_dict = {}
for tool in _MAKE_TOOLS:
Expand Down