Bridging headers only import relative paths when creating DSYM
Created by: davidxiasc
When building mixed ObjC/Swift apple binaries that have a bridging header, the bridging header will only check headers by the relative path when generating the DSYM.
This can be illustrated by this example project: https://github.com/davidxiasc/buck-dsym-bridging
If you run buck build :Test#dwarf-with-dsym,iphoneos-arm64
you will get the following error, complaining that Foo.h
cannot be found, even though it is under Source/Foo.h
. Note that the compiler is able to detect SameDirectory.h
as it is located in the same directory as the bridging header.
<path>/Bridging-Header.h:2:9: error: 'Foo.h' file not found
#import "Foo.h"
^
<unknown>:0: error: failed to import bridging header 'Bridging-Header.h'
Command failed with exit code 1.
command: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc, -frontend, -sdk, /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk, -target, arm64-apple-ios10.0, -import-objc-header, Bridging-Header.h, -Xcc, -Ibuck-out/gen/Test#headers,iph...
<truncated>
...
stderr: <path>/Bridging-Header.h:2:9: error: 'Foo.h' file not found
#import "Foo.h"
^
<unknown>:0: error: failed to import bridging header 'Bridging-Header.h'
When running <swift compile>.
When building rule //:Test#dwarf-with-dsym,iphoneos-arm64,swift-compile.
However, if instead you run buck :Test#dwarf,iphoneos-arm64
, the binary builds correctly.
Oddly, running buck build :Test#dwarf-with-dsym,iphoneos-arm64
after buck :Test#dwarf,iphoneos-arm64
(dirty state) passes, but doesn't actually generate any DSYM.