diff options
author | 2018-02-06 08:56:05 -0800 | |
---|---|---|
committer | 2018-02-06 08:58:12 -0800 | |
commit | 149e95b37954684678830038b19a6cf323ae308e (patch) | |
tree | bbc1a786723f5168474d32fd52a1dbf0e3e557c1 /src/test/shell | |
parent | f0544d71599039b50151ac47d060b680288379ab (diff) |
Converts wrapped_clang from a bash script to a C++ source file which is compiled as part of bazel's repository bootstrap. This should make crosstool's clang invocations faster. An added benefit of this is that wrapped_clang.cc supports the "DSYM_HINT" flags specified through the CROSSTOOL, so with this change, apple_binary gets support for the --apple_generate_dsym flag.
The dSYM generation issue has been flagged multiple times:
https://github.com/bazelbuild/bazel/issues/4312
https://github.com/bazelbuild/bazel/issues/3940
https://github.com/bazelbuild/bazel/issues/3372
RELNOTES: apple_binary can now generate dSYM outputs with the --apple_generate_dsym=true flag.
PiperOrigin-RevId: 184688215
Diffstat (limited to 'src/test/shell')
-rwxr-xr-x | src/test/shell/bazel/apple/bazel_apple_test.sh | 29 | ||||
-rwxr-xr-x | src/test/shell/bazel/remote_execution_test.sh | 7 |
2 files changed, 36 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 f3e0ae3305..d90d6f0b13 100755 --- a/src/test/shell/bazel/apple/bazel_apple_test.sh +++ b/src/test/shell/bazel/apple/bazel_apple_test.sh @@ -347,4 +347,33 @@ EOF assert_contains "IOS UNKNOWN" bazel-genfiles/a/ioso } +function test_apple_binary_dsym_builds() { + 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 = ["main.m"], +) +EOF + cat > package/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" diff --git a/src/test/shell/bazel/remote_execution_test.sh b/src/test/shell/bazel/remote_execution_test.sh index 87ad193dcb..dff25048a1 100755 --- a/src/test/shell/bazel/remote_execution_test.sh +++ b/src/test/shell/bazel/remote_execution_test.sh @@ -96,6 +96,13 @@ EOF } function test_cc_test() { + if [[ "$PLATFORM" == "darwin" ]]; then + # TODO(b/37355380): This test is disabled due to RemoteWorker not supporting + # setting SDKROOT and DEVELOPER_DIR appropriately, as is required of + # action executors in order to select the appropriate Xcode toolchain. + return 0 + fi + mkdir -p a cat > a/BUILD <<EOF package(default_visibility = ["//visibility:public"]) |