shims/super/cc: remove isysroot space to fix cpp #6749
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
brew style
with your changes locally?brew tests
with your changes locally?This is a fix to #5153, where the
cpp
shim was broken in Xcode 10 and later.It turns out that Xcode's
cpp
is just a dumb script. Here's a snippet from it:It splits arguments by spaces, and completely breaks down when we pass
-isysroot sdk
. The entire flow revolves around$#
,$1
andshift
which work by splitting by spaces so sees-isysroot
andsdk
as separate arguments. Here is a demonstration of what happens:The script does have special handling for
-imacros
,-include
,-idirafter
,-iprefix
and-iwithprefix
to work with spaces (or rather require spaces), but not-isysroot
.When interacting with clang directly,
-isysroot
works both with and without spaces between-isysroot
and the path. In fact, originally spaces weren't supported there either - that's a later innovation. MacPorts doesn't put a space after-isysroot
for that reason, albeit that older toolchain support isn't a concern in Homebrew.Considering
-isysroot
without spaces still works today, I propose removing the space as that fixes all the problems without having to do specialcpp
handling. Note that-isystem
already behaves this way.