Skip to content
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

PyInfo() constructor does not use its has_py3_only_sources parameter #21971

Open
dws opened this issue Apr 11, 2024 · 1 comment · May be fixed by #22334
Open

PyInfo() constructor does not use its has_py3_only_sources parameter #21971

dws opened this issue Apr 11, 2024 · 1 comment · May be fixed by #22334
Labels

Comments

@dws
Copy link

dws commented Apr 11, 2024

Description of the bug:

Commit c475a9d introduced a new routine _PyInfo_init in src/main/starlark/builtins_bzl/common/python/providers.bzl which does the following:

        "has_py2_only_sources": has_py2_only_sources,
        "has_py3_only_sources": has_py2_only_sources,

I believe the second line there should be

        "has_py3_only_sources": has_py3_only_sources,

so that the value of a has_py3_only_sources parameter to the routine is reflected in its return value.

Which category does this issue belong to?

Python Rules

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

BUILD.bazel:

load(":pyinfo.bzl", "pyinfo")

pyinfo()

pyinfo.bzl:

def pyinfo():
    print("expect True: {}".format(PyInfo(transitive_sources = depset(), has_py3_only_sources = True).has_py3_only_sources))

Under Bazel 6.20, building the above prints expect True: True
Under Bazel 7..1.1, building the above prints expect True: False

Which operating system are you running Bazel on?

Ubuntu 20.04

What is the output of bazel info release?

release 7.1.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

Yes. The bad line was introduced in commit c475a9d

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@dws
Copy link
Author

dws commented Apr 11, 2024

@rickeylev FYI

@dws dws changed the title _PyInfo_init does not use its has_py3_only_sources parameter PyInfo() constructor does not use its has_py3_only_sources parameter Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants