You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On macOS (darwin), if the command-line developer tools are installed but XCode is not, then bazel uses /usr/bin/libtool as ar_executable. That behavior doesn't seem to make sense since (1) libtool and ar take different command-line arguments and (2) /usr/bin/ar is itself already available.
We use libtool because ar is deprecated (oneliner in http://www.manpages.info/macosx/libtool.1.html, who knows if it will be ever removed). Ideally you should assume nothing about C++ tools and command lines and instead ask C++ rules to give you the information needed. Except that C++ rules as of today won't give you good answers, but we're working on it:
[https://docs.google.com/document/d/1g91BWJITcYw_X-VxsDC0VgUn5E9g0kRBGoBSpoO41gA/edit](Skylark API to the C++ toolchain) - this is what you'll use to get the same command line as C++ rules would use.
Implement C++ Starlark API #4570 Skylark API to C++ action generation (and providers). Without looking into details I think this is what you'll need for rules haskell and rules rust.
We expect that both will be available by the end of Q2. I'll close this issue now since we don't plan to change the ar/libtool situation and we'll focus on proper APIs instead.
Thanks!
Description of the problem / feature request:
On macOS (darwin), if the command-line developer tools are installed but XCode is not, then bazel uses
/usr/bin/libtool
asar_executable
. That behavior doesn't seem to make sense since (1)libtool
andar
take different command-line arguments and (2)/usr/bin/ar
is itself already available.The relevant code in master is here:
bazel/tools/cpp/unix_cc_configure.bzl
Line 436 in b80eb18
I'm unable to track down the reason for this behavior. It appears to have originated in this commit:
8fa5ae6#diff-3c392a08593f9fcb15e8267d7acc132dR67
Skylark build currently have to add logic to work around this behavior; we ran into it for rules_haskell (tweag/rules_haskell#223) and it's already been encountered in rules_rust: https://github.com/bazelbuild/rules_rust/blob/df95c3e3cd5afd87a69fa71dc9a56a0d0baa7823/rust/toolchain.bzl#L20
At minimum, it would help to add a comment explaining the reason so that downstream rule writers can know how to deal with it.
What operating system are you running Bazel on?
macOS Sierra
What's the output of
bazel info release
?What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?The text was updated successfully, but these errors were encountered: