-
Notifications
You must be signed in to change notification settings - Fork 249
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this appears to have broken the windows CI jobs - this must be causing it to pick up some environment that is having an undesirable effect; I don't know enough about the windows toolchain to know what that might be though!
Are you able to take a look at the windows failures?
I don't have a Window machine but at a guess it seems that
Annoyingly Bazel does not print out the build environment when the test succeeds so there is no way in determining what was inside Any thoughts on how to approach this? |
Digging in a bit deeper to this, what is happening is pkgconfig is failing to build on Windows. It seems that
At first, I thought it have something to do with the following environment variable overwriting the include dirs that contain
However, the code in question shouldn't interact with |
@jsharpe all lights are finally green! There were two things preventing Windows builds from working correctly:
It is a bit strange that these flags are being set in the first place since not only are they not required for compilation, they actually break it. I believe these come from the configuration of the Windows VMs for Buildkite and Bazel CI, although I could not locate the sources that result in these environment variables being set. I suspect that these variables should be cleared or we should run CI with The fix I put in place was to only consider the environment variables listed in |
…contrib#1230) Co-authored-by: James Sharpe <[email protected]>
This resolves a bug in
_get_make_variables
that causes the user environmental variables such asLDFLAGS
to be ignored.In the case of
LDFLAGS
, this happens whencxx_linker_executable
is empty and results in completely ignoring[user_env_vars[user_var]]
sincetoolchain_val
isNone
.I believe this branch was put in place to guard against adding
None
to a list. I have solved this by removing the branch and ensuring thattoolchain_val
is always a list even if variables likecxx_linker_executable
are empty.