AhmFM
AhmFM

Reputation: 1782

bazel build on mac os sonoma 14.2.1 fails on `Compiling absl/base/log_severity.cc`

Team,

I just upgraded to sonoma and intalled xcode and command line tools. My bazel build broke compiling lib. not sure if it is upgrade but I need to fix issue. Appreciate pointers.

> Darwin estatead-mlt 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:10 PST 2023; root:xnu-10002.61.3~2/RELEASE_X86_64 x86_64

>clang++ --version

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

xcode-select version 2405

xcrun version 68

bazel 6.3.2

Command> ./bazel build //src/secrets/...
INFO: Invocation ID: 2d2acb96-b605-490a-bf2b-f90644a8dc84
INFO: Analyzed 36 targets (0 packages loaded, 0 targets configured).
INFO: Found 36 targets...
ERROR: /private/var/tmp/_bazel_estatead/e6e1d0cbd051dd43ed59dca5541f019d/external/com_google_absl/absl/base/BUILD.bazel:53:11: Compiling absl/base/log_severity.cc [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target @com_google_absl//absl/base:log_severity) external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 44 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
clang: error: unknown argument: '-fno-canonical-system-headers'
ERROR: /private/var/tmp/_bazel_estatead/e6e1d0cbd051dd43ed59dca5541f019d/external/com_google_absl/absl/base/BUILD.bazel:53:11: Compiling absl/base/log_severity.cc [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target @com_google_absl//absl/base:log_severity) external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 44 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
clang: error: unknown argument: '-fno-canonical-system-headers'
INFO: Elapsed time: 13.051s, Critical Path: 11.22s
INFO: 14 processes: 14 internal.
FAILED: Build did NOT complete successfully

Upvotes: 0

Views: 321

Answers (1)

theBearHat
theBearHat

Reputation: 1

The following worked for me. Deleting the xcode CommandLineTools. Reinstalling it. Finally, deleting all data from the bazel local cache.

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install 
rm -r ~/.bazel-cache/disk-cache/

After that bazel was building once again. Deleting the bazel cache was needed for me to get bazel to build correctly when running tests using IntelliJ.

Upvotes: 0

Related Questions