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

Add a machine specific wheel tag as highest precedence wheel tag #6523

Closed
pradyunsg opened this issue May 23, 2019 · 17 comments
Closed

Add a machine specific wheel tag as highest precedence wheel tag #6523

pradyunsg opened this issue May 23, 2019 · 17 comments
Labels
PEP implementation Involves some PEP state: needs discussion This needs some more discussion type: enhancement Improvements to functionality

Comments

@pradyunsg
Copy link
Member

pradyunsg commented May 23, 2019

What's the problem this feature will solve?
A machine-specific tag lets you compile a wheel on your local machine, for your local machine, and have it get picked above the manylinux1 wheel from pypi without disabling manylinux1 completely.

Additional context
#3921 has all the past conversation related to this. #2875 is sorta related.

@pradyunsg pradyunsg added C: wheel The wheel format and 'pip wheel' command state: awaiting PR Feature discussed, PR is needed type: feature request Request for a new feature labels May 23, 2019
@dholth
Copy link
Member

dholth commented May 23, 2019

I designed the PEP 425 tag system so that linux_x86_64 is the machine specific tag, and as long as you limit the distribution of those wheels this works.

Please do fix this somehow. We need to be able to override specific broken manylinux wheels by placing higher precedence wheels in the search path.

@uranusjr
Copy link
Member

Is this specific to Linux, or should other systems also get similar tags? I know Linux is the place where this is needed, but it seems somewhat overly specific if linux_x86_64 is used for the abstract idea of machine-specific, or inconsistent if only Linux can have machine-specific wheels.

@dholth
Copy link
Member

dholth commented May 24, 2019 via email

@dholth
Copy link
Member

dholth commented May 29, 2019

It's right there in PEP 425 "Tools should use the most-preferred architecture dependent tag e.g. cp33-cp33m-win32 or the most-preferred pure python tag e.g. py33-none-any by default.", but tags[0] is the manylinux tag. Currently a wheel building tool must skip all those tags to find the correct tag for a new C extension wheel.

Maybe we could get around this problem by replacing the manylinux config file with a Python script that generates or filters the entire list of tags and/or have everyone import packaging.tags. Then BSD users who have also said we generate the wrong tags for them, or cluster users who have a lot of copies of the same environment, could get whatever behavior they need.

@dholth
Copy link
Member

dholth commented May 30, 2019

If you don't mind this issue should be closed. I'm frustrated that I haven't been allowed to be the authority on my own non-intuitive invention. The proposed solution of a random tag per machine would be less convenient than the status quo.

@dholth dholth closed this as completed May 30, 2019
@cjerdonek
Copy link
Member

cjerdonek commented May 30, 2019

FWIW, I'm happy to defer to @dholth on this.

Maybe we could get around this problem by replacing the manylinux config file with a Python script that generates or filters the entire list of tags and/or have everyone import packaging.tags.

Can you elaborate on this, by the way? What is the manylinux config file you're referring to? (pardon my ignorance on this)

@dstufft
Copy link
Member

dstufft commented May 31, 2019

It doesn't make sense that linux_x86_64 is the more specific tag, given it will match on literally any Linux machine. It is not more specific, it is broadly more generic, the only thing more generic is any.

@dholth
Copy link
Member

dholth commented May 31, 2019 via email

@dholth
Copy link
Member

dholth commented May 31, 2019 via email

@pradyunsg
Copy link
Member Author

pradyunsg commented May 31, 2019

@dholth @dstufft I'm okay either way (since this doesn't affect me directly) and I'm happy to defer to you both (in case there's more discussion to be had here) or maintain status quo.

@dholth if you think a "localhost" tag is good enough here, please do reopen this issue since that's what I view the proposed tag as being.

FWIW, I like that name too. :)

@xavfernandez
Copy link
Member

👍 for the idea of a localhost (or some other name) tag that would take precedence over all the other machine tags.

@dholth
Copy link
Member

dholth commented Jun 2, 2019

If that makes sense to you then it will solve my problem.

Suppose pypi has a broken manylinux wheel for a database driver.

You can compile a wheel for that driver.

driver-1.0-cp27-cp27mu-local.whl

Now place that in ~/var/wheels which happens to be on $PIP_FIND_LINKS and everything works again. If you know that you have many similar machines, you can copy it there without having to configure anything.

If you used a random number instead of a fixed tag, that wouldn't be smart enough to detect when you changed your machine to be incompatible with the shared library the wheel links to; maybe you uninstalled or upgraded the driver. We can't usefully encode the complete set of shared libraries and symbol versions on your system in a tag.

You might want to give your wheel both arch tags so it was easier to keep track of what was going on inside the wheel: driver-1.0-cp27-cp27mu-local.linux_x86_64.whl, but you would still have to make sure the $PIP_FIND_LINKS directory was never shared between dissimilar systems.

@dholth dholth reopened this Jun 2, 2019
@dholth
Copy link
Member

dholth commented Jun 4, 2019

’Tis but thy name that is my enemy;
Thou art thyself though, not a Montague.
What’s Montague? it is nor hand, nor foot,
Nor arm, nor face, nor any other part
Belonging to a man. O! be some other name:
What’s in a name? that which we call a rose
By any other name would smell as sweet;
So Romeo would, were he not Romeo call’d,
Retain that dear perfection which he owes
Without that title.

@dholth
Copy link
Member

dholth commented Jun 7, 2019

It's inconvenient that wheel tags are not more intuitive. The system was built only to help install the "right" version of a package when there can be multiple builds of a package under consideration, if it also expresses an abstract idea that might be a bonus. The trouble is that these are all separate things:

The one the user wants
The one that was built on a system most-similar-to the installation environment (the heuristic the PEP wants)
The wheel with the highest priority tag in the set of wheels under consideration (the heuristic the PEP uses)
The actual order of the tags
The tags ordered by how many or few systems will accept that particular tag
More?

@pradyunsg
Copy link
Member Author

Corresponding tracker issue for packaging.tags: pypa/packaging#239

@pradyunsg pradyunsg removed C: wheel The wheel format and 'pip wheel' command state: awaiting PR Feature discussed, PR is needed labels Nov 16, 2019
@pradyunsg pradyunsg added PEP implementation Involves some PEP state: needs discussion This needs some more discussion type: enhancement Improvements to functionality and removed type: feature request Request for a new feature labels Nov 16, 2019
@pradyunsg
Copy link
Member Author

Relabeled, since this can now be scoped as an enhancement to an existing PEP (PEP 425).

@pradyunsg
Copy link
Member Author

There's a draft PEP for augumenting the spec: https://discuss.python.org/t/draft-pep-the-local-wheel-tag/3145/.

Since we likely won't need to do anything until packaging.tags gets an update due to this PEP, I'm gonna close this out.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PEP implementation Involves some PEP state: needs discussion This needs some more discussion type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

6 participants