Skip to content

Commit a3f9500

Browse files
author
Tamas Vajk
committed
Handle all -isystem variants 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
1 parent f31db8b commit a3f9500

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cargo/private/cargo_build_script.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ def _pwd_flags_fsanitize_ignorelist(args):
248248
return _prefix_pwd_to_flag(args, ["-fsanitize-ignorelist="])
249249

250250
def _pwd_flags_isystem(args):
251-
"""Prefix execroot-relative paths in -isystem and -Xclang -internal-isystem arguments with ${pwd}."""
252-
return _prefix_pwd_to_flag(args, ["-isystem", "-internal-isystem"])
251+
"""Prefix execroot-relative paths in -isystem-like arguments with ${pwd}."""
252+
return _prefix_pwd_to_flag(args, ["-isystem", "-isystem-after", "-internal-isystem", "-cxx-isystem", "-stdlib++-isystem"])
253253

254254
def _pwd_flags_L(args):
255255
"""Prefix execroot-relative paths in -L arguments with ${pwd}."""

0 commit comments

Comments
 (0)