Open uri-canva opened 1 year ago
there's an additional problem here:
ERROR: /Users/mlevental/dev_projects/xls/xls/passes/BUILD:179:11: Linking xls/passes/libunroll_pass.pic.a failed: (Exit 1): sandbox-exec failed: error executing command
(cd /private/var/tmp/_bazel_mlevental/77aa60ef93768a50da7e847fcf47eca8/sandbox/darwin-sandbox/17524/execroot/com_google_xls && \
exec env - \
BAZEL_CXXOPTS='-std=c++17' \
BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 \
PATH='/Users/mlevental/.cabal/bin:/Users/mlevental/.ghcup/bin:/opt/homebrew/opt/binutils/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/bison/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/opt/qt@5/bin:/opt/homebrew/bin:/opt/homebrew/opt/bison/bin:/opt/homebrew/bin/:/opt/homebrew/opt/libtool/libexec/gnubin:/Users/mlevental/miniforge3/bin:/Users/mlevental/miniforge3/condabin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/local/bin:/opt/local/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/Users/mlevental/.cargo/bin:/opt/homebrew/opt/ccache/libexec:/Users/mlevental/Library/Application Support/JetBrains/Toolbox/scripts' \
PWD=/proc/self/cwd \
TMPDIR=/var/folders/5r/nhx6kb2j2bq9zh1lng031l800000gn/T/ \
/usr/bin/sandbox-exec -f /private/var/tmp/_bazel_mlevental/77aa60ef93768a50da7e847fcf47eca8/sandbox/darwin-sandbox/17524/sandbox.sb /var/tmp/_bazel_mlevental/install/492267a38d620c777a8b281ba7e366a6/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_mlevental/77aa60ef93768a50da7e847fcf47eca8/sandbox/darwin-sandbox/17524/stats.out' /opt/homebrew/opt/libtool/libexec/gnubin/libtool @bazel-out/darwin_arm64-opt/bin/xls/passes/libunroll_pass.pic.a-2.params)
libtool: error: you must specify an output file
Usage: /opt/homebrew/opt/libtool/libexec/gnubin/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
I.e., that while the GNU libtool is found, it's not passed the correct argument; I tried patching libtool itself (because I don't know how to configure which options to pass it through bazel itself) and in addition to the mode (link
) you need to pass --tag
and the output file name. The lack of these three things (and possibly others) is preventing me from compiling a bazel project on my M1.
Uninstalled gnu libtool then gets me back to apple's libtool but then symbols aren't resolved at runtime (despite successful linking during the link stage).
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
Just checked, there are still references to /usr/bin/xcrun
in the wrapper.
Fwiw I don't think there was ever a goal of supporting builds without even the CLT. I imagine the best solution if you wanted that would be to use a custom cc toolchain like toolchains_llvm. I think some changes would still be required though.
I think builds without that environment variable already work with CLT and without Xcode though. I thought it was meant to support toolchains provided through other means like brew etc.
If not then maybe it's pointless to have it?
The point is to allow you to use the CLT without a full Xcode install (and has the side benefit of making your build more similar to Linux builds if you care about cross platform, at the cost of some platform specific improvements)
What I mean is that bazel never needed full Xcode install as far as I remember, regardless of whether you use BAZEL_USE_CPP_ONLY_TOOLCHAIN
. Maybe it was necessary in older, pre-open source versions?
Description of the bug:
BAZEL_USE_CPP_ONLY_TOOLCHAIN
on Darwin is meant to disable the Xcode toolchain resolution and use the common Unix toolchain resolution based on what binaries are available on thePATH
and set with environment variables. However it will still hardcode several apple tools, like/usr/bin/libtool
,/usr/bin/gcc
and/usr/bin/install_name_tool
(incc_wrapper.sh
).What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Expected output: successful build using the binaries on your
PATH
. Actual output:Which operating system are you running Bazel on?
macOS 12.5 21G72
What is the output of
bazel info release
?release 5.2.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response