Skip to content

Update the version of rules_python to 0.31.0 and add py_repositories() call in WORKSPACE file #2115

Open
@PankhudiJ17

Description

@PankhudiJ17
  • BUILD INFORMATION:
Repository: io
Tag: v0.37.1
Python Version(s): Tested with Python 3.10.11 and 3.11.3
Operating System: Linux (ppc64le architecture)
                  NAME="Ubuntu"
                  VERSION="22.04.5 LTS (Jammy Jellyfish)"
Architecture: ppc64le
Bazel Version: 6.5.0
TensorFlow Version: 2.16.1
Build Command: bazel build -s --verbose_failures $BAZEL_OPTIMIZATION --copt="-Wno-error=array-parameter=" --copt="-I/usr/include/tirpc" //tensorflow_io/... //tensorflow_io_gcs_filesystem/... --cpu=ppc
  • We are attempting to build tensorflow/io on the ppc64le architecture but encountered an error related to the Python repository:
ERROR: /root/.cache/bazel/_bazel_root/7e563aa8f1493c3ba33faa85b32d7a3c/external/python/BUILD.bazel:10:6: no such package '@python_ppc64le-unknown-linux-gnu//': The repository '@python_ppc64le-unknown-linux-gnu' could not be resolved: Repository '@python_ppc64le-unknown-linux-gnu' is not defined and referenced by '@python//:python_headers'
ERROR: Analysis of target '//tensorflow_io/core/grpc:endpoint_py_pb2_grpc' failed; build aborted:
INFO: Elapsed time: 67.216s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (135 packages loaded, 4252 targets configured)
    currently loading: @com_google_absl//absl ... (2 packages)
    Fetching repository @com_github_prometheus_common; Restarting. 17s
    Fetching repository @com_github_prometheus_client_golang; Restarting. 17s
    Fetching repository @com_github_prometheus_prom2json; Restarting. 17s
    Fetching repository @com_github_prometheus_client_model; Restarting. 17s
    Fetching repository @bazel_gazelle_go_repository_tools; starting 17s
    Fetching repository @aws-sdk-cpp; starting 15s
    Fetching /root/.cache/bazel/_bazel_root/7e563aa8f1493c3ba33faa85b32d7a3c/external/aws-sdk-cpp; Extracting 1.8.187.tar.gz 9s
    Fetching repository @thrift; starting ... (12 fetches)
  • This error occurs because the repository @python_ppc64le-unknown-linux-gnu is not defined, causing Bazel to fail when attempting to resolve Python dependencies.
    We have tested building TensorFlow IO with both Python 3.10.11 and Python 3.11.3 and encountered the same issue.

  • Temporary Solution/Workaround:
    We resolved the issue by updating the version of rules_python from 0.23.1 to 0.31.0 and explicitly adding the py_repositories() call in the WORKSPACE file.

  • Here are the changes we made:

diff --git a/WORKSPACE b/WORKSPACE
index 19c30f7e..b2bb29b8 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -27,6 +27,17 @@ http_archive(
     ],
)
+http_archive(
+    name = "rules_python",
+    sha256 = "c68bdc4fbec25de5b5493b8819cfc877c4ea299c0dcb15c244c5a00208cde311",
+    strip_prefix = "rules_python-0.31.0",
+    url = "[[https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz"](https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz%22)](https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz%22](https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz%22)),
+)
+
+
+load("@rules_python//python:repositories.bzl", "py_repositories")
+
+py_repositories()
  • After applying these changes, the build was successful.

Please let us know your thoughts on this solution or if you have any further suggestions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions