From 56d98ae42c5a9626e3a749c27637a2ddb9b69d3d Mon Sep 17 00:00:00 2001 From: Oscar Bonilla <6f6231@gmail.com> Date: Tue, 12 Jun 2018 12:21:44 -0700 Subject: CROSSTOOLS wrapped_clang: handle spaces in paths When bazel calls wrapped_clang, it single-quotes all arguments. However it passes flags with arguments quoted as a whole. That is, wrapped_clang will be called with arguments like these: wrapped_clang '-isysroot /a/path/with spaces' '/a/file with spaces.m' Before this commit, wrapped_clang was blindly splitting on space and calling clang with invalid arguments. Now it only splits on the _first_ space, and only if the argument starts with '-'. Closes #5147. PiperOrigin-RevId: 200259496 --- src/test/shell/bazel/apple/bazel_apple_test.sh | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/test') diff --git a/src/test/shell/bazel/apple/bazel_apple_test.sh b/src/test/shell/bazel/apple/bazel_apple_test.sh index db3063e707..18b093a9e0 100755 --- a/src/test/shell/bazel/apple/bazel_apple_test.sh +++ b/src/test/shell/bazel/apple/bazel_apple_test.sh @@ -385,4 +385,33 @@ EOF || fail "should build apple_binary with dSYMs" } +function test_apple_binary_spaces() { + rm -rf package + mkdir -p package + cat > package/BUILD < "package/the main.m" <