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
I am trying to build tensorflow main branch using bazel 7.5.0 natively on riscv64 linux.
After adding "@platforms//cpu:riscv64": "riscv64", to tensorflow/tools/pip_package/BUILD,
I got a cryptic error when running ~/bazel7/output/bazel build //tensorflow/tools/pip_package:wheel --repo_env=WHEEL_NAME=tensorflow_cpu --repo_env=HERMETIC_PYTHON_VERSION=3.12
INFO: Reading 'startup' options from /home/kxxt/tensorflow/.bazelrc: --windows_enable_symlinks
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=236
INFO: Reading rc options for 'build' from /home/kxxt/tensorflow/.bazelrc:
Inherited 'common' options: --announce_rc --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility --noenable_bzlmod --noincompatible_enable_cc_toolchain_resolution --noincompatible_enable_android_toolchain_resolution --experimental_repo_remote_exec --java_runtime_version=remotejdk_21
INFO: Reading rc options for 'build' from /home/kxxt/tensorflow/.bazelrc:
'build' options: --repo_env=ML_WHEEL_TYPE=snapshot --repo_env=ML_WHEEL_BUILD_DATE= --repo_env=ML_WHEEL_VERSION_SUFFIX= --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --features=-force_no_whole_archive --host_features=-force_no_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2
INFO: Found applicable config definition build:short_logs in file /home/kxxt/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /home/kxxt/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:linux in file /home/kxxt/tensorflow/.bazelrc: --host_copt=-w --copt=-Wno-all --copt=-Wno-extra --copt=-Wno-deprecated --copt=-Wno-deprecated-declarations --copt=-Wno-ignored-attributes --copt=-Wno-array-bounds --copt=-Wunused-result --copt=-Werror=unused-result --copt=-Wswitch --copt=-Werror=switch --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=dynamic_kernels --experimental_guard_against_concurrent_changes
INFO: Found applicable config definition build:dynamic_kernels in file /home/kxxt/tensorflow/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
ERROR: no such package '@@pypi_keras_nightly//': The repository '@@pypi_keras_nightly' could not be resolved: Repository '@@pypi_keras_nightly' is not defined
ERROR: /home/kxxt/tensorflow/tensorflow/BUILD:1763:11: no such package '@@pypi_keras_nightly//': The repository '@@pypi_keras_nightly' could not be resolved: Repository '@@pypi_keras_nightly' is not defined and referenced by '//tensorflow:tensorflow_py_no_contrib'
ERROR: Analysis of target '//tensorflow/tools/pip_package:wheel' failed; build aborted: Analysis failed
INFO: Elapsed time: 2.564s, Critical Path: 0.02s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
FAILED:
Fetching repository @@png; starting
Fetching repository @@llvm-project; starting
Fetching repository @@curl; starting
Fetching repository @@absl_py; starting
Fetching repository @@pasta; starting
Fetching repository @@com_google_absl; startin
@pypi_keras_nightly is not defined directly in tensorflow repo. I think it is probably generated by rules_python.
But I am completely unsure why it would not be defined on riscv64 linux. On x86_64 linux it works fine.
tensorflow is using rules_python 0.39 with a patch. I tried to update the patch to include a prebuilt python interpreter for riscv64 but that didn't work:
diff --git a/third_party/py/rules_python.patch b/third_party/py/rules_python.patch
index aab0c23d4d2..944d4637fa0 100644
--- a/third_party/py/rules_python.patch+++ b/third_party/py/rules_python.patch@@ -37,32 +37,65 @@ index c805fd7a..e57e6138 100644
Label("//python/private/pypi/requirements_parser:resolve_target_platforms.py"),
Label("//python/private/pypi/whl_installer:platform.py"),
]
+diff --git a/python/private/pypi/whl_target_platforms.bzl b/python/private/pypi/whl_target_platforms.bzl+index bdc44c69..8f2a1a82 100644+--- a/python/private/pypi/whl_target_platforms.bzl++++ b/python/private/pypi/whl_target_platforms.bzl+@@ -32,6 +32,7 @@ _CPU_ALIASES = {+ "ppc": "ppc",+ "ppc64": "ppc",+ "ppc64le": "ppc",++ "riscv64": "riscv64",+ "s390x": "s390x",+ "arm": "arm",+ "armv6l": "arm",+diff --git a/python/private/python_bootstrap_template.txt b/python/private/python_bootstrap_template.txt+index 0f9c90b3..567bdc88 100644+--- a/python/private/python_bootstrap_template.txt++++ b/python/private/python_bootstrap_template.txt+@@ -52,7 +52,14 @@ def GetWindowsPathWithUNCPrefix(path):+ # removed from common Win32 file and directory functions.+ # Related doc: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later+ import platform+- if platform.win32_ver()[1] >= '10.0.14393':++ version = None++ # The try-except block is needed to fix the flakiness of RBE tests++ # on Windows 2022 using hermetic python 3.12.8.++ try:++ version = platform.win32_ver()[1]++ except (ValueError, KeyError):++ version = platform.win32_ver()[1]++ if version and version >= '10.0.14393':+ return path++ # import sysconfig only now to maintain python 2.6 compatibility
diff --git a/python/versions.bzl b/python/versions.bzl
-index 774c24d1..91e59f9b 100644+index 774c24d1..f88e52eb 100644
--- a/python/versions.bzl
+++ b/python/versions.bzl
-@@ -561,6 +561,20 @@ TOOL_VERSIONS = {+@@ -561,6 +561,21 @@ TOOL_VERSIONS = {
},
"strip_prefix": "python",
},
+ "3.12.8": {
-+ "url": "20241206/cpython-{python_version}+20241206-{platform}-{build}.tar.gz",++ "url": "20250115/cpython-{python_version}+20250115-{platform}-{build}.tar.gz",
+ "sha256": {
-+ "aarch64-apple-darwin": "e3c4aa607717b23903ca2650d5c3ee24f89b97543e2db2b0f463bddc7a9e92f3",-+ "aarch64-unknown-linux-gnu": "ce674b55442b732973afb2932c281bb1ded4ad7e22bcf9b07071165770758c7e",-+ "ppc64le-unknown-linux-gnu": "b7214790b273de9ed0532420054b72ba1393d62d2fc844ec55ade193771bd90c"-+ "s390x-unknown-linux-gnu": "73102f5dbd7d1e7e9c2f2c80aedf2893d99a7fa407f6674ec8b2f57ba07daee5",-+ "x86_64-apple-darwin": "3ba35c706577d755e8e52a4c161a042464577c0e695e2a605362fa469e26de10",-+ "x86_64-pc-windows-msvc": "767b4be3ddf6b99e5ade519789c1615c191d8cf99d5aff4685cc18b48931f1e6",-+ "x86_64-unknown-linux-gnu": "b9d6ee5ddac1198e72d53112698773fc8bb597de095592eb849ca794306699ba",-+ "x86_64-unknown-linux-musl": "6f305888703691dd04cfff85284d23ea0b0146ed7c4415e472f1fb72b3f32cdf",++ "aarch64-apple-darwin": "e29003b69465c33692830032d9d237d84ea43a2e8461db9134641640fb49f040",++ "aarch64-unknown-linux-gnu": "2e08c1d4de239290b9fc3bef90f121349819b473149083470d16081dd293050c",++ "ppc64le-unknown-linux-gnu": "6fcef3b6d211be4146b50d344228d6b54c3dbca5e589035aefbfc2137ebe3091",++ "riscv64-unknown-linux-gnu": "a9bf3ef15ec3472f19cb4596c00a9ecfd77ec829d2c15f420b2918dd41551edd",++ "s390x-unknown-linux-gnu": "e472f0a7dd0c6fcf23482d3de23f851880b5f2b715141c72658aa7784ad7d14c",++ "x86_64-apple-darwin": "b81ae8ea17fce6e173649120fcc4eda123bb8df54890894bbec432f527fbe75c",++ "x86_64-pc-windows-msvc": "86ee8267900240c96369adb2cbc1af8f543f860d2e22be5adb7362f3cbe61059",++ "x86_64-unknown-linux-gnu": "e5435e717c934ed30d4066f64e858497c27f37c1ba547f403b050d9221e50ea4",++ "x86_64-unknown-linux-musl": "ba3ad57d694ec091e39e7d1eec1ebca234c575fd1f8d1ccb9fd782f35e609f01",
+ },
+ "strip_prefix": "python",
+ },
"3.13.0": {
"url": "20241016/cpython-{python_version}+20241016-{platform}-{build}.{ext}",
"sha256": {
-@@ -589,7 +603,7 @@ MINOR_MAPPING = {+@@ -589,7 +604,7 @@ MINOR_MAPPING = {
"3.9": "3.9.20",
"3.10": "3.10.15",
"3.11": "3.11.10",
@@ -70,24 +103,4 @@ index 774c24d1..91e59f9b 100644
+ "3.12": "3.12.8",
"3.13": "3.13.0",
}
--diff --git a/python/private/python_bootstrap_template.txt b/python/private/python_bootstrap_template.txt-index 0f9c90b3..567bdc88 100644---- a/python/private/python_bootstrap_template.txt-+++ b/python/private/python_bootstrap_template.txt-@@ -52,7 +52,14 @@ def GetWindowsPathWithUNCPrefix(path):- # removed from common Win32 file and directory functions.- # Related doc: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later- import platform-- if platform.win32_ver()[1] >= '10.0.14393':-+ version = None-+ # The try-except block is needed to fix the flakiness of RBE tests-+ # on Windows 2022 using hermetic python 3.12.8.-+ try:-+ version = platform.win32_ver()[1]-+ except (ValueError, KeyError):-+ version = platform.win32_ver()[1]-+ if version and version >= '10.0.14393':- return path-- # import sysconfig only now to maintain python 2.6 compatibility+
My question is how could I debug a missing generated @pypi_{PACKAGE} repo on riscv64? And why would those generated repos be missing depending on architecture?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am trying to build tensorflow main branch using bazel 7.5.0 natively on riscv64 linux.
After adding
"@platforms//cpu:riscv64": "riscv64",
totensorflow/tools/pip_package/BUILD
,I got a cryptic error when running
~/bazel7/output/bazel build //tensorflow/tools/pip_package:wheel --repo_env=WHEEL_NAME=tensorflow_cpu --repo_env=HERMETIC_PYTHON_VERSION=3.12
@pypi_keras_nightly
is not defined directly in tensorflow repo. I think it is probably generated by rules_python.But I am completely unsure why it would not be defined on riscv64 linux. On x86_64 linux it works fine.
tensorflow is using rules_python 0.39 with a patch. I tried to update the patch to include a prebuilt python interpreter for riscv64 but that didn't work:
My question is how could I debug a missing generated
@pypi_{PACKAGE}
repo on riscv64? And why would those generated repos be missing depending on architecture?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions