bazel-xcode / PodToBUILD

An easy way to integrate CocoaPods into Bazel
Apache License 2.0
322 stars 69 forks source link

Switch to Bazel 4, migrate ObjcProvider compile info to CcCompilationContext #174

Closed dgcoffman closed 3 years ago

dgcoffman commented 3 years ago

Resolves https://github.com/pinterest/PodToBUILD/issues/170 https://github.com/pinterest/PodToBUILD/issues/171 https://github.com/pinterest/PodToBUILD/issues/173

farcaller commented 3 years ago

I'm trying to build the React Exmple app off this branch, and after running make && bazel build //PodsHost:ios-app I get random errors on headers missing, e.g.:

bazel build //PodsHost:ios-app
INFO: Analyzed target //PodsHost:ios-app (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /Users/farcaller/src/rn-bazel/PodToBUILD/Examples/React/Vendor/React/BUILD.bazel:2006:13: Compiling Vendor/React/React/CxxBridge/RCTCxxBridge.mm failed: (Exit 1): wrapped_clang failed: error executing command external/local_config_cc/wrapped_clang -arch x86_64 '-stdlib=libc++' '-std=gnu++11' '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign ... (remaining 81 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox wrapped_clang failed: error executing command external/local_config_cc/wrapped_clang -arch x86_64 '-stdlib=libc++' '-std=gnu++11' '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign ... (remaining 81 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Vendor/React/React/CxxBridge/RCTCxxBridge.mm:19:9: fatal error: 'React/RCTDevSettings.h' file not found
#import <React/RCTDevSettings.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Target //PodsHost:ios-app failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 71.352s, Critical Path: 36.85s
INFO: 45 processes: 9 internal, 36 darwin-sandbox.
FAILED: Build did NOT complete successfully
INFO: Build options --apple_platform_type, --compilation_mode, --cpu, and 3 more have changed, discarding analysis cache.
INFO: Analyzed target //PodsHost:ios-app (34 packages loaded, 14031 targets configured).
INFO: Found 1 target...
ERROR: /Users/farcaller/src/rn-bazel/PodToBUILD/Examples/React/Vendor/React/BUILD.bazel:5344:13: Compiling Vendor/React/React/CoreModules/RCTWebSocketModule.mm failed: (Exit 1): wrapped_clang failed: error executing command external/local_config_cc/wrapped_clang -arch x86_64 '-stdlib=libc++' '-std=gnu++11' '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign ... (remaining 85 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox wrapped_clang failed: error executing command external/local_config_cc/wrapped_clang -arch x86_64 '-stdlib=libc++' '-std=gnu++11' '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign ... (remaining 85 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Vendor/React/React/CoreModules/RCTWebSocketModule.mm:14:9: fatal error: 'React/RCTSRWebSocket.h' file not found
#import <React/RCTSRWebSocket.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Target //PodsHost:ios-app failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 182.230s, Critical Path: 40.33s
INFO: 265 processes: 136 internal, 129 darwin-sandbox.
FAILED: Build did NOT complete successfully

Looks like some include paths didn't propagate properly?

dgcoffman commented 3 years ago

@farcaller I think you need the specific BAZEL_OPTS from Examples/React/Makefile. Does cd Examples/React && make all work for you?

farcaller commented 3 years ago

Thanks for 47f2d72, makes a bit more sense now!

loyaltyarm commented 3 years ago

Just curious if there is a plan to cut a release with this merged? Thanks in advance!