chipsalliance / homebrew-verible

Apache License 2.0
16 stars 8 forks source link

Can't use homebrew to install verible----bazel error #26

Closed Entwinedime closed 2 weeks ago

Entwinedime commented 1 year ago

Behavior

brew install verible ==> Fetching chipsalliance/verible/verible ==> Cloning https://github.com/chipsalliance/verible.git Updating /Users/entwinedime/Library/Caches/Homebrew/verible--git ==> Checking out tag v0.0-3389-ga1cd07b1 HEAD is now at a1cd07b1 Merge pull request #1982 from ivan444/rm_sha HEAD is now at a1cd07b1 Merge pull request #1982 from ivan444/rm_sha ==> Installing verible from chipsalliance/verible ==> bazel build --jobs=8 --compilation_mode=opt --copt=-mcpu=apple-m1 --linkopt=-Wl,-rpath,@loader_path/../lib --verbose_failures //verilog/tools/... Last 15 lines from /Users/entwinedime/Library/Logs/Homebrew/verible/01.bazel: ERROR: /private/tmp/verible-20230810-19224-ebczqm/verilog/tools/kythe/BUILD:60:8: Linking verilog/tools/kythe/scope-resolver_test failed: (Exit 254): cc_wrapper.sh failed: error executing command (from target //verilog/tools/kythe:scope-resolver_test) (cd /private/tmp/verible-20230810-19224-ebczqm/.brew_home/_bazel/d904e7b2168a9c8f65214cbcae5ab84b/sandbox/processwrapper-sandbox/793/execroot/com_google_verible && \ exec env - \ PATH=/opt/homebrew/Library/Homebrew/shims/shared:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/opt/riscv-openocd/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/bin:/bin:/usr/sbin:/sbin \ PWD=/proc/self/cwd \ external/local_config_cc/cc_wrapper.sh @bazel-out/darwin_arm64-opt/bin/verilog/tools/kythe/scope-resolver_test-2.params)

Configuration: 991bab295ce624414b320b195dd92bc6b08805991f102d136aad2a8c5f923b14

Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging clang: error: unable to execute command: Segmentation fault: 11 clang: error: linker command failed due to signal (use -v to see invocation) INFO: Elapsed time: 79.768s, Critical Path: 6.02s INFO: 2712 processes: 1923 internal, 789 processwrapper-sandbox. FAILED: Build did NOT complete successfully

Specifications

ethanuppal commented 5 months ago

Same issue

isirfanm commented 2 months ago

same issue on Mac M1 Sonoma 14.5

mgottscho commented 1 month ago

same issue on Mac M3 Max Sonoma 14.6.1

hzeller commented 1 month ago

Someone with access to a mac needs to debug this locally. It seems there is an issue with clang crashing with a segfault. Maybe some reference to a compiler that can deal with M1 needs to be updated ?

Also, the homebrew script seems to be not working anymore, possibly some expected syntax changes ?

hzeller commented 1 month ago

Maybe @johanvdhaegen knows ?

mgottscho commented 1 month ago

Fixed it for myself, it was a $PATH issue. I have two homebrew installs - one x86-64 (emulated) and one arm64. The x86-64 one is under /usr/local and the arm64 one is under /opt. Only the former was added to $PATH. So when I did /opt/homebrew/bin/brew install verible, it fetched bazel and tried to use it during the install, but since that directory tree was not on my path, it failed.

johanvdhaegen commented 3 weeks ago

Line 10 in verible.rb (env :std) prevents homebrew from finding bazel; instead it picks up bazel from the outside environment, which does not work for the CI builds or if bazel is not available before the build.

Some additional formula fixes are needed to re-enable the CI builds. I'll submit a PR soon.