Closed vmax closed 6 years ago
I am meeting exactly the same question.
It seems like to be an environment related issue, since it had worked pretty well before I updated some packages through App Store and bazel itself.
My bazel:
$ bazel version
Build label: 0.15.0-homebrew
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jun 26 12:42:27 2018 (1530016947)
Build timestamp: 1530016947
Build timestamp as int: 1530016947
My error message :
(18:55:23) INFO: Current date is 2018-06-28
(18:55:23) INFO: Analysed 73 targets (0 packages loaded).
(18:55:23) INFO: Found 73 targets...
(18:55:27) ERROR: /Users/yu/.cache/bazel/_bazel_yu/a0ef8c220ea214c47900c6dfb6f89ce6/external/com_google_protobuf/BUILD:260:1: Linking of rule '@com_google_protobuf//:js_embed' failed (Exit 1): cc_wrapper.sh failed: error executing command
(cd /Users/yu/.cache/bazel/_bazel_yu/a0ef8c220ea214c47900c6dfb6f89ce6/execroot/com_github_argcv_argcv && \
exec env - \
PATH=/usr/local/bin:/usr/bin \
PWD=/proc/self/cwd \
external/local_config_cc/cc_wrapper.sh -o bazel-out/host/bin/external/com_google_protobuf/js_embed bazel-out/host/bin/external/com_google_protobuf/_objs/js_embed/external/com_google_protobuf/src/google/protobuf/compiler/js/embed.o -Wl,-no-as-needed -Wl,-z,relro,-z,now -undefined dynamic_lookup -headerpad_max_install_names -lstdc++ -lm -Wl,-S)
Use --sandbox_debug to see verbose messages from the sandbox
ld: unknown option: -no-as-needed
clang: error: linker command failed with exit code 1 (use -v to see invocation)
(18:55:27) INFO: Elapsed time: 3.542s, Critical Path: 2.86s
(18:55:27) INFO: 11 processes: 11 darwin-sandbox.
(18:55:27) FAILED: Build did NOT complete successfully
It worked pretty fine in bazel-0.14.1
Going to the release page and download the binary release for mac through url https://github.com/bazelbuild/bazel/releases/download/0.14.1/bazel-0.14.1-darwin-x86_64
It resolve the problem.
bazelbuild/bazel#5468
@vmax @yuikns Thanks for the reports. Closing as this looks like a bazel issue: https://github.com/bazelbuild/bazel/issues/5468
What version of protobuf and what language are you using? Version:
3.6.0.1
Language:Java
What operating system (Linux, Windows, ...) and version?
macOS 10.13.5
What runtime / compiler are you using (e.g., python version or gcc version)
What did you do?
bazel build //:protobuf
What did you expect to see Build completing successfully
What did you see instead?
Anything else we should know about your project / environment Using
clang
andld
from Command Line Tools 9.4 It may be connected since it worked before