Skip to content

bazel deps query with platform-specific pypi deps fails #2223

@rickeylev

Description

@rickeylev

🐞 bug report

Affected Rule

Somethinng in the pypi integration

Is this a regression?

Maybe? I used to be able to do ibazel build //docs:docs to have docs automatically
rebuilt while working on them. Now bazel gives an error during the query for deps ibazel
performs.

Description

bazel query 'deps(//docs:docs) fails with an error. I think what's happening is a windows-specific dependency gets evaluated, which triggers a repo rule, and then wheel_installer fails.

🔬 Minimal Reproduction

Run bazel query 'deps(//docs:docs)'

🔥 Exception or Error

Full error: https://gist.github.com/rickeylev/d32a94e6823cb1541babc8565d88ccf8

I suspect the most relevant parts are

repo.execute: whl_library.BuildWheelFromSource(_main~pip_internal~dev_pip_311_colorama_sdist_08695f5c, colorama==0.4.6 ;sys_platform == 'win32'): ...
----
Ignoring colorama: markers 'sys_platform == "win32"' don't match your environment
----
  File "/home/user/p/rickeylev/rules_python/python/private/pypi/whl_installer/wheel_installer.py", line 198, in main
    whl = Path(next(iter(glob.glob("*.whl"))))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

Hm, maybe the issue is wheel_installer isn't expecting an "empty" response?

cc @aignas

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