Skip to content

Conversation

kxxt
Copy link
Contributor

@kxxt kxxt commented Oct 14, 2025

Fix #2729

Copy link
Contributor

Summary of Changes

Hello @kxxt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the rules_python framework by integrating linux_riscv64 support into the _pip_repository_impl function. This crucial update ensures that Python package dependencies can be correctly resolved and built on RISC-V 64-bit architectures, directly addressing and fixing a known build issue for projects like TensorFlow on this platform. The change improves the overall robustness and platform compatibility of the Bazel Python rules.

Highlights

  • Platform Support: Added linux_riscv64 to the list of supported platforms within the _pip_repository_impl function, enabling broader compatibility.
  • Bug Fix: This change resolves a reported build issue for TensorFlow on RISC-V 64-bit systems, specifically addressing the problem discussed in GitHub issue Repository '@@pypi_{PACKAGE_NAME}' is not defined error on riscv64 #2729.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly adds linux_riscv64 to the list of supported platforms in _pip_repository_impl, which is a good first step towards supporting this architecture. However, the fix appears to be incomplete. For full support, especially for parsing wheel filenames, the wheel platform tag parser also needs to be updated to recognize the riscv64 architecture. I've left a detailed comment on the .bzl file change with guidance on how to complete the implementation.

@kxxt kxxt force-pushed the rv-pip branch 3 times, most recently from f108a9b to 8c0d41d Compare October 14, 2025 12:06
CI fails with connection timed out
@kxxt
Copy link
Contributor Author

kxxt commented Oct 14, 2025

It appears that docs/readthedocs.org:rules-python CI is failing due to network errors.

@aignas
Copy link
Collaborator

aignas commented Oct 15, 2025

FYI @meteorcloudy, @rickeylev, recently the macos build has been flaking a lot download errors like this.

https://buildkite.com/bazel/rules-python-python/builds/13390/steps/canvas?sid=0199e5be-8ed2-4523-bbc5-0e7a944731c8

Gonna merge it with a bypass.

@aignas
Copy link
Collaborator

aignas commented Oct 15, 2025

@kxxt, could you please retest your PR with the latest? We have enabled a particular feature of rules_python (#3225) and I am wondering if your PR is sufficient to still have the tensorflow building correctly.

@kxxt
Copy link
Contributor Author

kxxt commented Oct 15, 2025

@kxxt, could you please retest your PR with the latest? We have enabled a particular feature of rules_python (#3225) and I am wondering if your PR is sufficient to still have the tensorflow building correctly.

Thanks for the heads-up. I tested this PR by converting it to a patch based on rules_python 1.6.0 to use in tensorflow's //third_party/py. I will try to test it with rules_python 1.7.0.

infiWang pushed a commit to infiWang/tensorflow that referenced this pull request Oct 15, 2025
@meteorcloudy
Copy link
Contributor

Yes, sorry we are having some CI outage for macOS workers: bazelbuild/continuous-integration#2385

@kxxt
Copy link
Contributor Author

kxxt commented Oct 18, 2025

@kxxt, could you please retest your PR with the latest? We have enabled a particular feature of rules_python (#3225) and I am wondering if your PR is sufficient to still have the tensorflow building correctly.

Hi, @aignas. I tested this PR again by bumping tensorflow's rules_python to 1.7.0-rc0, which includes the
aforementioned commit(1ebc93f).

The build of tensorflow fails but I think that's because of other changes in rules_python.
Nevertheless, the build of @pypi_numpy//:pkg is successful, which is what this PR is trying to solve:

INFO: Analyzed target @@pypi_numpy//:pkg (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target @@pypi_numpy//:pkg up-to-date:
  bazel-bin/external/pypi_numpy/site-packages/numpy/_core/tests/__init__.py
  bazel-bin/external/pypi_numpy/site-packages/numpy/_core/tests/examples/__init__.py
  bazel-bin/external/pypi_numpy/site-packages/numpy/_core/tests/examples/cython/__init__.py
  bazel-bin/external/pypi_numpy/site-packages/numpy/_core/tests/examples/limited_api/__init__.py
  bazel-bin/external/pypi_numpy/site-packages/numpy/doc/__init__.py
  bazel-bin/external/pypi_numpy/site-packages/numpy/random/_examples/__init__.py
  bazel-bin/external/pypi_numpy/site-packages/numpy/random/_examples/cffi/__init__.py
  bazel-bin/external/pypi_numpy/site-packages/numpy/random/_examples/numba/__init__.py
  bazel-bin/external/pypi_numpy/site-packages/numpy/typing/tests/data/__init__.py
  bazel-bin/external/pypi_numpy/site-packages/numpy/typing/tests/data/pass/__init__.py
INFO: Elapsed time: 4.430s, Critical Path: 0.06s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants