Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure_unix_toolchain: Allow overriding path to libtool on macOS #122

Open
veprbl opened this issue Nov 21, 2021 · 1 comment
Open

configure_unix_toolchain: Allow overriding path to libtool on macOS #122

veprbl opened this issue Nov 21, 2021 · 1 comment
Labels
P3 Accepted issue. Team is likely to fix this issue in the future, but no short-term promises are made.

Comments

@veprbl
Copy link

veprbl commented Nov 21, 2021

Description of the problem / feature request:

The path to the archive manipulation tool is hardcoded on macOS

overriden_tools["ar"] = "/usr/bin/libtool"

It would be nice to have a mechanizm to override this value externally, for example by adding a AR/BAZEL_AR environment variable.

Feature requests: what underlying problem are you trying to solve with this feature?

In nixpkgs we build our own toolchain for macOS from open source components. The static library builds rely on ar, and rules_cc hardcode it to be called at /usr/bin/libtool, which does not belong to our toolchain. Our builds are supposed to not rely on Apple SDK, and, in fact, it need not be even installed. We would like to supply our working version of libtool, the same way we specify CC, but apparently there isn't a way to do so.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

What operating system are you running Bazel on?

macOS

What's the output of bazel info release?

release 3.7.2- (@non-git)

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

What version of rules_cc do you use? Can you paste the workspace rule used to fetch rules_cc? What other relevant dependencies does your project have?

Same as tensorflow 2.7.0: 01d4a48

What Bazel options do you use to trigger the issue? What C++ toolchain do you use?

The toolchain is "stdenv" for x86_64-darwin from nixpkgs based on:

clang version 7.1.0 (tags/RELEASE_710/final)

Have you found anything relevant by searching the web?

No

Any other information, logs, or outputs that you want to share?

ERROR: /private/tmp/nix-build-tensorflow-2.7.0.drv-0/output/external/com_google_protobuf/BUILD:301:11: Linking of rule '@com_google_protobuf//:protoc_lib' failed (Exit 1): libtool failed: error executing command /usr/bin/libtool -static -s -o bazel-out/host/bin/external/com_google_protobuf/libprotoc_lib.a bazel-out/host/bin/external/com_google_protobuf/_objs/protoc_lib/code_generator.o ... (remaining 80 argument(s) skipped)

@uri-canva
Copy link

Related: #134

@comius comius added the P3 Accepted issue. Team is likely to fix this issue in the future, but no short-term promises are made. label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Accepted issue. Team is likely to fix this issue in the future, but no short-term promises are made.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants