Handle all -isystem variant flags in cargo build script path rewriting#3996
Open
tamasvajk wants to merge 1 commit intobazelbuild:mainfrom
Open
Handle all -isystem variant flags in cargo build script path rewriting#3996tamasvajk wants to merge 1 commit intobazelbuild:mainfrom
-isystem variant flags in cargo build script path rewriting#3996tamasvajk wants to merge 1 commit intobazelbuild:mainfrom
Conversation
0d42a06 to
a3f9500
Compare
-stdlib++-isystem in cargo build script path rewriting-isystem variant flags in cargo build script path rewriting
Add -stdlib++-isystem, -isystem-after, and -cxx-isystem to the set
of flags whose following path argument gets prefixed with ${pwd}.
These are standard Clang flags for specifying system include paths
that were not handled, causing cargo build scripts to fail in the
sandbox when the CC toolchain uses them.
See the Clang documentation for the full set of isystem-like flags:
https://clang.llvm.org/docs/ClangCommandLineReference.html
a3f9500 to
3f9484c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Handle all
-isystemvariant flags in cargo build script path rewriting.Problem
When Bazel passes CC toolchain flags to cargo build scripts, paths following
-isystemare prefixed with${pwd}so they resolve correctly inside the sandbox. However, several other Clang flags that take system include paths were not handled:-stdlib++-isystem— C++ standard library headers-isystem-after— appended to SYSTEM include search path-cxx-isystem— C++ SYSTEM include search pathSee the Clang command line reference for the full set.
This caused cargo build scripts to fail when the CC toolchain used any of these flags, because paths weren't rewritten for the sandbox.
Fix
Add
-stdlib++-isystem,-isystem-after, and-cxx-isystemto the flag list in_pwd_flags_isystem.