Skip to content

rules_python 1.4 tries to install windows only dependencies outside of windows #2825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jogo-openai opened this issue Apr 25, 2025 · 3 comments
Milestone

Comments

@jogo-openai
Copy link

🐞 bug report

Affected Rule

rules_python++pip+pypi

Is this a regression?

Yes, the issue is new in 1.4, last checked against rc2, and wasn't present in 1.3

Description

rules_python 1.4.0-rc2 tries to install windows only dependencies when not needed.

🔬 Minimal Reproduction

bazel query '@@rules_python++pip+pypi_311_humanfriendly//:all' --output=build

on 1.4 shows deps = select({"@@rules_python++pip+pypi_311_humanfriendly//:is_windows_x86_64": ["@pypi//pyreadline3:pkg"], "//conditions:default": []}),

1.4.0-rc2 rules_python++pip+pypi_311_humanfriendly/BUILD.bazel

load("@rules_python//python/private/pypi:whl_library_targets.bzl", "whl_library_targets_from_requires")
load("@pypi//:config.bzl", "target_platforms")

package(default_visibility = ["//visibility:public"])

whl_library_targets_from_requires(
    data_exclude = [],
    dep_template = "@pypi//{name}:{target}",
    entry_points = {
        "humanfriendly": "rules_python_wheel_entry_point_humanfriendly.py",
    },
    extras = [""],
    group_deps = [],
    group_name = "",
    metadata_name = "humanfriendly",
    metadata_version = "10.0",
    name = "humanfriendly-10.0-py2.py3-none-any.whl",
    requires_dist = [
        "monotonic ; python_version == \"2.7\"",
        "pyreadline ; sys_platform == \"win32\" and python_version<\"3.8\"",
        "pyreadline3 ; sys_platform == \"win32\" and python_version>=\"3.8\"",
    ],
    target_platforms = target_platforms,
)

1.3.0 rules_python++pip+pypi_311_humanfriendly/BUILD.bazel

load("@rules_python//python/private/pypi:whl_library_targets.bzl", "whl_library_targets")

package(default_visibility = ["//visibility:public"])

whl_library_targets(
    data_exclude = [],
    dep_template = "@pypi//{name}:{target}",
    dependencies = [],
    dependencies_by_platform = {},
    entry_points = {
        "humanfriendly": "rules_python_wheel_entry_point_humanfriendly.py",
    },
    group_deps = [],
    group_name = "",
    name = "humanfriendly-10.0-py2.py3-none-any.whl",
    tags = [
        "pypi_name=humanfriendly",
        "pypi_version=10.0",
    ],
)

🔥 Exception or Error

We don't have pyreadline3 in our dependency list.

no such package '@@rules_python++pip+pypi//pyreadline3': BUILD file not found in directory 'pyreadline3' of external repository @@rules_python++pip+pypi

🌍 Your Environment

builds targeted for mac/linux only

Output of bazel version:

  
Bazelisk version: 1.26.0
Bazelisk version: v1.21.0
INFO: Invocation ID: 5e20096c-bb49-4477-b691-4163d29c9abc
Build label: 8.1.1
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Tue Feb 25 18:53:44 2025 (1740509624)
Build timestamp: 1740509624
Build timestamp as int: 1740509624
  

Rules_python version:

  
1.4.0-rc2
  
@aignas aignas added this to the v1.4 milestone Apr 27, 2025
@aignas
Copy link
Collaborator

aignas commented Apr 27, 2025

Might be fixed by #2830

@aignas
Copy link
Collaborator

aignas commented Apr 29, 2025

1.4.0-rc3 has been released, please test if this is still an issue.

@jogo-openai
Copy link
Author

jogo-openai commented Apr 29, 2025

Just tested out 1.40.-rc4 and looks to be fixed, thank you

@aignas aignas closed this as completed Apr 29, 2025
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

No branches or pull requests

2 participants