compile_pip_requirements on Windows (GitHub workers) fails; bug is probably in the runfiles library
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- github-actions, python
- 領域
- build-system, ci-cd
調査の方向性
python/runfiles/runfiles.pyから始め、特にCurrentRepositoryとRlocationを確認してから、private/pypi/dependency_resolver/dependency_resolver.pyを調べ、リンク先のWindowsの例で発生する失敗を再現してください。runfilesのルートと呼び出し元が異なるドライブ上にある場合でも、GitHubのWindowsワーカーでcompile_pip_requirementsが成功し、そのケースのcoverageがあることが完了の条件です。
索引モデルが issue の本文から書いたものです。
説明
🐞 bug report
Affected Rule
The issue is caused by the rule: compile_pip_requirements (but probably an issue in the runfiles library)
Is this a regression?
Yes, the previous version in which this bug was not present was: 1.7.0
Description
On the GitHub workers on MS-Windows, compile_pip_requirements rules fail with an error such as
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python+\python\runfiles\runfiles.py", line 306, in Rlocation
source_repo = self.CurrentRepository(frame=2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python+\python\runfiles\runfiles.py", line 384, in CurrentRepository
caller_runfiles_path = os.path.relpath(caller_path, self._python_runfiles_root)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen ntpath>", line 777, in relpath
ValueError: path is on mount 'C:', start on mount 'D:'
🔬 Minimal Reproduction
https://github.com/phst/rules_python-bug-runfiles-windows
See e.g. the action logs at https://github.com/phst/rules_python-bug-runfiles-windows/actions/runs/22157518229
🔥 Exception or Error
==================== Test output for //:requirements.test:
Traceback (most recent call last):
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\_main\_requirements.test_stage2_bootstrap.py", line 499, in
main()
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\_main\_requirements.test_stage2_bootstrap.py", line 493, in main
_run_py_path(main_filename, args=sys.argv[1:])
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\_main\_requirements.test_stage2_bootstrap.py", line 287, in _run_py_path
runpy.run_path(main_filename, run_name="__main__")
File "", line 291, in run_path
File "", line 98, in _run_module_code
File "", line 88, in _run_code
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python+\python\private\pypi\dependency_resolver\dependency_resolver.py", line 270, in
main()
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python++config+pypi__click\click\core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python++config+pypi__click\click\core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python++config+pypi__click\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python++config+pypi__click\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python+\python\private\pypi\dependency_resolver\dependency_resolver.py", line 111, in main
resolved_srcs = [_locate(bazel_runfiles, src) for src in srcs]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python+\python\private\pypi\dependency_resolver\dependency_resolver.py", line 111, in
resolved_srcs = [_locate(bazel_runfiles, src) for src in srcs]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python+\python\private\pypi\dependency_resolver\dependency_resolver.py", line 82, in _locate
return bazel_runfiles.Rlocation(file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python+\python\runfiles\runfiles.py", line 306, in Rlocation
source_repo = self.CurrentRepository(frame=2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RUNNER~1\AppData\Local\Temp\Bazel.runfiles_flx90ick\runfiles\rules_python+\python\runfiles\runfiles.py", line 384, in CurrentRepository
caller_runfiles_path = os.path.relpath(caller_path, self._python_runfiles_root)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 777, in relpath
ValueError: path is on mount 'C:', start on mount 'D:'
================================================================================
🌍 Your Environment
Operating System:
Windows
Output of bazel version:
Bazelisk version: 1.28.1
INFO: Invocation ID: 0c29aa33-c4d6-490c-ae50-a131af7e76a6
Build label: 9.0.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Tue Jan 20 18:20:43 2026 (1768933243)
Build timestamp: 1768933243
Build timestamp as int: 1768933243
Rules_python version:
1.8.4
Anything else relevant?
See https://github.com/bazel-contrib/rules_python/pull/3086#issuecomment-3765803662 for the initial report.
Locally rolling back https://github.com/bazel-contrib/rules_python/commit/a506d774dd60eedf6fce94dcccd2c233553b06d4 fixes the issue.
Back-porting the fix to https://github.com/bazel-contrib/rules_python/issues/3579 locally does not fix the issue.
- 主要言語
- Starlark
- スター
- 690
- フォーク
- 722
- 平均マージ
- 1日 55分
- マージ済み PR(30日)
- 38
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bazel-contrib/rules_python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
bazel-contrib/rules_python#4179 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bazel-contrib/rules_python#4164 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bazel-contrib/rules_python#3821 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
bazel-contrib/rules_python#4181 ·
-
Release 2.4.0 オープンtype: release
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
bazel-contrib/rules_python#4175 · コメント 3 件 ·
bazel-contrib/rules_python の issue をすべて見る
似ている issue
-
typst-0.12 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
commercialhaskell/stackage#8127 ·
-
bug build
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
facebookincubator/velox#19194 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
agentic-workflows maintenance
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nebari-dev/jhub-apps#742 ·