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

Py2/3 generated sources clash in runfiles #6482

Closed
brandjon opened this issue Oct 23, 2018 · 2 comments
Closed

Py2/3 generated sources clash in runfiles #6482

brandjon opened this issue Oct 23, 2018 · 2 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Rules-Python Native rules for Python type: bug

Comments

@brandjon
Copy link
Member

When a target depends on the same generated source file in both PY2 and PY3 modes, it's arbitrary which one wins in the runfiles. Here foobar depends on source file a.py and generated source file b.py through both PY2 and PY3 binary targets. In the runfiles, a.py symlinks to the source file, which is the same in both modes, but b.py symlinks to the file generated in the PY2 output root (the one without "-py3" in the path), silently ignoring the PY3 one.

genrule(
    name = "b",
    outs = [":b.py"],
    cmd = "touch $(location :b.py)",
)

py_binary(
    name = "foo",
    srcs = ["a.py", ":b"],
    main = "a.py",
    default_python_version = "PY3",
)

py_binary(
    name = "bar",
    srcs = ["a.py", ":b"],
    main = "a.py",
    default_python_version = "PY2",
)

sh_binary(
    name = "foobar",
    srcs = [":script.sh"],
    data = [":foo", ":bar"],
)
@brandjon brandjon added type: bug P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-Python Native rules for Python labels Oct 23, 2018
@brandjon brandjon self-assigned this Oct 23, 2018
@github-actions
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Apr 12, 2023
@github-actions
Copy link

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team (@bazelbuild/triage). Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Rules-Python Native rules for Python type: bug
Projects
None yet
Development

No branches or pull requests

1 participant