-
Notifications
You must be signed in to change notification settings - Fork 78
Split CC to make sure we get the correct basename of the compiler #54
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
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.
Hum, I think this might be a little bit trickier.
There isn't really a spec for the CC
env var, though I think the de facto standard is what make
defines.
https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
The issue is that make
expands the commands like a shell, which allows use quotes, eg. CC="'this path/contains spaces!/my cursed compiler'" --some-arg
.
This patch does not take quoting into account. I would expect the example I presented to work.
The current implementation does not support quoting anyway, so we could possibly merge this without that. But if we are changing the handling to align with the behavior of common build systems, we probably should make it work as expected.
Also, simply splitting on spaces also does not take into account that spaces might be escaped, eg. CC=this\ path/contains\ spaces!/my\ cursed\ compiler --some-arg
, so it will break things.
I think we really need to expand the text to arguments.
Here's my naive implementation: https://gist.github.com/FFY00/0029d3001b384ff974360cd6c69b39f8
getting the runtime library option might break, but compilers with spaces in them is already broken in distutils. |
Looks like the state is worse than what I was expecting then 😅 I am not sure if this is the right fix, though I would probably tend to yes. @jaraco what do you think? |
I initially thought I wasn't going to have an opinion on the PR, but then I looked at the change, and had much of the same reaction as FFY00. I'd like not to introduce broken support for parsing the CC var with respect to spaces... and in particular, I'd like not to use |
Co-authored-by: "Jason R. Coombs" <[email protected]>
See the test for an example where basename of CC value fails.