bazel-contrib / bazel-contrib/rules_python

Unable to use whl dependency which is compiled from source due (arch not provided in pypi)

Aperta
#2,113 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub
need: repro
Lingua principale
Starlark
Stelle
688
Fork
721
Merge medio
15h 7m
PR unite (30g)
76

Descrizione

# 🐞 bug report

### Affected Rule

he issue is caused by the rule: pip_parse

### Is this a regression?

No

### Description

I'm developing a tensorflow addon with custom ops on MacBook with Intel CPU. All tensorflow versions below 2.17 had prebuilt *macosx_*_x86_64.whl packages. But since v2.17 there are only arm64 versions. The only way i can use fresh tensorflow is to built it itself. As result i have a custom tensorflow whl for my arch.

But this custom-arch self-compiled whl does not exists in PyPi, pip_parse can't find it. And build fails...

**Is there any workaround to use locally-built whl?**

## 🔬 Minimal Reproduction

Exception is related to PyPi package dependency (tensorflow in my case) with specific version and arch (MacOS x86_64 in my case).

## 🔥 Exception or Error



===== stderr start =====
ERROR: Could not find a version that satisfies the requirement tensorflow==2.17.0 (from versions: 2.12.0rc0, 2.12.0rc1, 2.12.0, 2.12.1, 2.13.0rc0, 2.13.0rc1, 2.13.0rc2, 2.13.0, 2.13.1, 2.14.0rc0, 2.14.0rc1, 2.14.0, 2.14.1, 2.15.0rc0, 2.15.0rc1, 2.15.0, 2.15.1, 2.16.0rc0, 2.16.1, 2.16.2)
ERROR: No matching distribution found for tensorflow==2.17.0
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/private/var/tmp/_bazel_alex/9f232a1fa475e5223cc8bd12f98cbb55/external/rules_python~0.34.0/python/private/pypi/whl_installer/wheel_installer.py", line 205, in
main()
File "/private/var/tmp/_bazel_alex/9f232a1fa475e5223cc8bd12f98cbb55/external/rules_python~0.34.0/python/private/pypi/whl_installer/wheel_installer.py", line 190, in main
subprocess.run(pip_args, check=True, env=env)
File "/private/var/tmp/_bazel_alex/9f232a1fa475e5223cc8bd12f98cbb55/external/rules_python~0.34.0~python~python_3_11_x86_64-apple-darwin/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/private/var/tmp/_bazel_alex/9f232a1fa475e5223cc8bd12f98cbb55/external/rules_python~0.34.0~python~python_3_11_host/python', '-m', 'pip', '--isolated', 'wheel', '--no-deps', '-r', '/var/folders/46/2h_pg_7s1r70lcfx37hb67nw0000gn/T/tmpoiw9bif1']' returned non-zero exit status 1.
===== stderr end =====

## 🌍 Your Environment

**Operating System:**

  

MacOS X 14.5 (23F79)

**Output of `bazel version`:**

  

Bazelisk version: 1.20.0
Build label: 6.5.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jan 23 16:54:12 2024 (1706028852)
Build timestamp: 1706028852
Build timestamp as int: 1706028852

**Rules_python version:**

  

0.34.0

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with the pip_parse rule and the failing path in python/private/pypi/whl_installer/wheel_installer.py, then reproduce the tensorflow==2.17.0 failure on macOS x86_64. Determine how a locally built, architecture-specific wheel could be supplied or resolved; done means the reported dependency can be processed without the PyPI distribution lookup failing.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
build-system
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.