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

"Resolving wheels disallowed" error when using --lock and --only-binary #2432

Closed
sjincho opened this issue Jun 21, 2024 · 3 comments · Fixed by #2433
Closed

"Resolving wheels disallowed" error when using --lock and --only-binary #2432

sjincho opened this issue Jun 21, 2024 · 3 comments · Fixed by #2433
Assignees

Comments

@sjincho
Copy link

sjincho commented Jun 21, 2024

I'm using pex 2.3.1 on Ubuntu 22.04.

If I create a lock file using:

pex3 lock create --output lock.json --only-binary ansicolors ansicolors

and run

pex --lock lock.json

it works w/o problem.

But running:

pex --lock lock.json --only-binary ansicolors

yields the following error:

Resolving wheels was disallowed, but the following project names are configured to only allow resolving pre-built wheels: ansicolors

In Pants 2.21.0, it seems like a change that uses pex to handle binary wheels was introduced.
pantsbuild/pants#20598

Due to this change, pants always passes both --lock and --only-binary flags, causing pantsbuild/pants#21077

@sjincho
Copy link
Author

sjincho commented Jun 21, 2024

Similar issue: #2389

@jsirois
Copy link
Member

jsirois commented Jun 21, 2024

Thanks for the report and repro. I will note, like #2389 this is a definitely bug, but also a weird use of a lock file. Since a lock is locked already, passing something like --only-binary ansicolors when using the lock doesn't make much sense. It would make a bit more sense if Pants didn't pass all these extra args when using a lock (as opposed to creating or updating one).

jsirois added a commit to jsirois/pex that referenced this issue Jun 21, 2024
Since pex-tool#2346 which was released in Pex 2.1.161, using `--only-binary X`
with a `--lock` would fail fast even if the lock itself was created with
`--only-binary X`, which should be compatible.

Fixes pex-tool#2432
jsirois added a commit that referenced this issue Jun 22, 2024
Since #2346, which was released in Pex 2.1.161, using `--only-binary X`
with a `--lock` would fail fast even if the lock itself was created with
`--only-binary X`, which should be compatible.

Fixes #2432
@jsirois
Copy link
Member

jsirois commented Jun 22, 2024

The fix for this is now released in Pex 2.4.1: https://github.com/pex-tool/pex/releases/tag/v2.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants