Open Shikugawa opened 3 years ago
@Shikugawa I tried ever on MacOS and it seems to fail too, maybe we need another issue "Build and test CI on macOS"?
@kezhenxu94 Sounds good. But I'm not sure how to fail build on MacOS. Could you provide logs?
There are multiple failed cases:
git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
bazel build //...
ERROR: /private/var/tmp/_bazel_kezhenxu94/bbbd327888796972ebba4112d3e70ebd/external/upb/BUILD:127:18: in upb_proto_library rule @upb//:descriptor_upb_proto:
Traceback (most recent call last):
File "/private/var/tmp/_bazel_kezhenxu94/bbbd327888796972ebba4112d3e70ebd/external/upb/bazel/upb_proto_library.bzl", line 168, column 36, in _upb_proto_rule_impl
if type(cc_info.linking_context.libraries_to_link) == "list":
Error: 'LinkingContext' value has no field or method 'libraries_to_link'
ERROR: Analysis of target '//cpp2sky/internal:async_client_interface' failed; build aborted: Analysis of target '@upb//:descriptor_upb_proto' failed
INFO: Elapsed time: 0.144s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 1 target configured)
Fetching @remotejdk11_macos; fetching
diff --git a/.bazelrc b/.bazelrc
index b5e0104..a056e59 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -1,4 +1,7 @@
build --enable_platform_specific_config
+build --incompatible_require_linker_input_cc_api=false
+build --features=-supports_dynamic_linker
+build:macos --cxxopt=-std=c++17
build:linux --cxxopt=-std=c++17
build:windows --cxxopt=-std:c++17
bazel build //...
INFO: Build options --cxxopt and --features have changed, discarding analysis cache.
INFO: Analyzed 24 targets (71 packages loaded, 4088 targets configured).
INFO: Found 24 targets...
ERROR: /Users/kezhenxu94/workspace/cpp2sky/test/BUILD:17:8: Linking test/propagation_test failed: (Exit 1): cc_wrapper.sh failed: error executing command external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-fastbuild/bin/test/propagation_test-2.params
Use --sandbox_debug to see verbose messages from the sandbox cc_wrapper.sh failed: error executing command external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-fastbuild/bin/test/propagation_test-2.params
Use --sandbox_debug to see verbose messages from the sandbox
duplicate symbol 'cpp2sky::createSpanContext(std::__1::basic_string_view<char, std::__1::char_traits<char> >)' in:
bazel-out/darwin-fastbuild/bin/test/_objs/propagation_test/propagation_test.o
bazel-out/darwin-fastbuild/bin/source/libcpp2sky_lib.a(propagation_impl.o)
duplicate symbol 'cpp2sky::createSpanContextExtension(std::__1::basic_string_view<char, std::__1::char_traits<char> >)' in:
bazel-out/darwin-fastbuild/bin/test/_objs/propagation_test/propagation_test.o
bazel-out/darwin-fastbuild/bin/source/libcpp2sky_lib.a(propagation_impl.o)
ld: 2 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
INFO: Elapsed time: 19.792s, Critical Path: 0.97s
INFO: 11 processes: 11 internal.
FAILED: Build did NOT complete successfully
It still failed when running bezel build //...
, but the patch allows me to run bazel build //source/...
bazel build //source/...
INFO: Analyzed 4 targets (0 packages loaded, 0 targets configured).
INFO: Found 4 targets...
INFO: Elapsed time: 0.159s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
This issue is the follow-up of #71. Introduce CI for test on Windows. cc @makefriend8