-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Bazel fails to build jaxlib: While resolving toolchains for target @org_tensorflow//tensorflow/tools/git:gen_git_source: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. #13227
Comments
@katre Is this the problem you fixed recently? |
What version of Bazel is this? @yurivict: You can provide more debugging information by re-running the Bazel invocation with the flag @oquenchil: I suspect the problem here is that we don't have a CC toolchain for FreeBSD, and so toolchain resolution is failing. Toolchain resolution is run for CC rules even if the result isn't used, and so if a toolchain isn't present this error would be the result. Options:
@yurivict: Unfortunately, our FreeBSD support isn't in great shape. We do have some support, but the engineer who added it has since left the team and we don't have any FreeBSD testing, so I am not surprised that the code is not working. We need a volunteer who is knowledgeable about FreeBSD and can run tests, since this is not something we are currently supporting. |
This issue is caused by Tensorflow overwriting the
In addition, we need to patch bazelrc to pick up diff --git a/.bazelrc b/.bazelrc
index da136a8d7..9e1ef1250 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -106,6 +106,8 @@ build:linux --copt=-Wno-array-parameter
build:macos --config=posix
+build:freebsd --config=posix
+
# Suppress all warning messages.
build:short_logs --output_filter=DONT_MATCH_ANYTHING
and use the actual platform tag to build the wheel, because diff --git a/build/build_wheel.py b/build/build_wheel.py
index cb85e2c67..12cd63072 100644
--- a/build/build_wheel.py
+++ b/build/build_wheel.py
@@ -19,6 +19,7 @@
import argparse
import datetime
+import distutils
import functools
import glob
import os
@@ -274,17 +275,9 @@ def edit_jaxlib_version(sources_path):
def build_wheel(sources_path, output_path, cpu):
"""Builds a wheel in `output_path` using the source tree in `sources_path`."""
- platform_name, cpu_name = {
- ("Linux", "x86_64"): ("manylinux2014", "x86_64"),
- ("Linux", "aarch64"): ("manylinux2014", "aarch64"),
- ("Linux", "ppc64le"): ("manylinux2014", "ppc64le"),
- ("Darwin", "x86_64"): ("macosx_10_14", "x86_64"),
- ("Darwin", "arm64"): ("macosx_11_0", "arm64"),
- ("Windows", "AMD64"): ("win", "amd64"),
- }[(platform.system(), cpu)]
python_tag_arg = (f"--python-tag=cp{sys.version_info.major}"
f"{sys.version_info.minor}")
- platform_tag_arg = f"--plat-name={platform_name}_{cpu_name}"
+ platform_tag_arg = f"--plat-name={distutils.util.get_platform()}"
cwd = os.getcwd()
if os.environ.get('JAXLIB_NIGHTLY'):
edit_jaxlib_version(sources_path) After these, compile for cpu works. |
@jxy if you want to send PRs to JAX and to TensorFlow with those fixes and tag me, I'll review/approve them. The second patch to JAX can't be checked in as is: in particular, for JAX we support cross-compilation (and we rely on that for Mac ARM builds) so the CPU of the running Python interpreter may not match the target CPU. |
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 or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post |
Compiler: clang-10
OS: FreeBSD 12.2
See the original bug report here: jax-ml/jax#6076
The text was updated successfully, but these errors were encountered: