-
-
Notifications
You must be signed in to change notification settings - Fork 638
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
generate-lockfiles
writes tool lockfiles twice
#21625
Comments
I can reproduce this. Notes:
Minimal (executable) reproducer: cd $(mktemp -d)
cat > pants.toml <<EOF
[GLOBAL]
pants_version = "2.22.0"
backend_packages = [
"pants.backend.python",
"pants.backend.python.lint.black",
]
[python]
interpreter_constraints = ["==3.12.*"]
enable_resolves = true
[python.resolves]
python-default = "default.lock"
black = "black.lock"
EOF
cat > BUILD <<EOF
python_requirement(name="black", requirements=["black"], resolve="black")
python_requirement(name="requests", requirements=["requests"])
EOF
echo "*** Okay: using --resolve=black => only written once"
pants generate-lockfiles --resolve=black
echo "*** BUG: written twice"
pants generate-lockfiles
echo "*** Okay: doesn't match a backend => only written once"
cat > pants.toml <<EOF
[GLOBAL]
pants_version = "2.22.0"
backend_packages = [
"pants.backend.python",
]
[python]
interpreter_constraints = ["==3.12.*"]
enable_resolves = true
[python.resolves]
python-default = "default.lock"
black = "black.lock"
EOF
pants generate-lockfiles Output (with my trimming):
|
Bisecting on the release versions suggests this regressed between 2.22.0.dev2 (writes once) and 2.22.0.dev3 (writes twice). Diff: release_2.22.0.dev2...release_2.22.0.dev3 Skimming that list makes me wonder about 20f3924 / #20787 being the cause, but I have not confirmed this. |
There's a codepath that's supposed to implement the shadowing pants/src/python/pants/core/goals/generate_lockfiles.py Lines 407 to 409 in 6afd222
|
The shadowing codepath isn't working because both the user resolve and the tool resolve have the same lockfiles path, even though Doing some more thinking, there are actually a few bugs here:
|
Describe the bug
Pants version
2.23.0rc2
OS
MacOS
Additional info
Repro, using
txtar
format.The text was updated successfully, but these errors were encountered: