diff options
author | 2018-06-12 12:21:44 -0700 | |
---|---|---|
committer | 2018-06-12 12:24:49 -0700 | |
commit | 56d98ae42c5a9626e3a749c27637a2ddb9b69d3d (patch) | |
tree | 42e0be02080173d27c8fc39527a111a10d4f2225 /src/test | |
parent | 400fffe8b2df50c5b57ced5d9a8b46e40d529d4e (diff) |
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
Diffstat (limited to 'src/test')
-rwxr-xr-x | src/test/shell/bazel/apple/bazel_apple_test.sh | 29 |
1 files changed, 29 insertions, 0 deletions
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 <<EOF +apple_binary( + name = "main_binary", + deps = [":main_lib"], + platform_type = "ios", + minimum_os_version = "10.0", +) +objc_library( + name = "main_lib", + srcs = ["the main.m"], +) +EOF + cat > "package/the main.m" <<EOF +int main() { + return 0; +} +EOF + + bazel build --verbose_failures //package:main_binary \ + --apple_crosstool_transition \ + --ios_multi_cpus=i386,x86_64 \ + --xcode_version=$XCODE_VERSION \ + --apple_generate_dsym=true \ + || fail "should build apple_binary with dSYMs" +} + run_suite "apple_tests" |