Skip to content

manylinux tags should come after linux tags #160

Closed

Description

@dholth

I designed packaging tags to come in order of "most specific to this machine" to "least specific to this machine". Unfortunately pip has interpreted this as meaning "most specified", putting "manylinux1" before "linux_x86_64", even though any "linux_x86_64" wheels visible to pip should have been compiled on exactly the machine you're in.

When a particular manylinux wheel is broken, you should be able to compile a linux_x86_64 wheel, add it to pip's search path, and pip would prefer the wheel you compiled. With manylinux1 first the option of having a folder of known-good-and-preferred wheels is not available, instead you have to use no-binary or avoid specific packages.

It would also be helpful if a packaging tool could just pick the first tag from the list, instead of skipping all the manylinux tags, when choosing a tag for a new binary wheel.

Activity

  1. added a commit that references this issue on Oct 18, 2019
    6cd59ad
  2. brettcannon commented on Oct 21, 2019

    @brettcannon
    Member

    There's disagreement over whether this should occur in the pip issue tracker at pypa/pip#6523, so this is on hold until that's resolved.

  3. xavfernandez commented on Oct 21, 2019

    @xavfernandez
    Member

    I think an agreement was found to add a new local/localhost platform tag that would always be considered as the most specific platform.

    This would need an update on PEP-425 (or a new one) to make it official though.

    (cf pypa/pip#6565 (comment))

  4. brettcannon commented on Oct 21, 2019

    @brettcannon
    Member

    @xavfernandez I'm waiting for someone to state that without using the word "I think". 😉

  5. xavfernandez commented on Oct 21, 2019

    @xavfernandez
    Member

    Well, Daniel seemed to be in favor since he's the author of pypa/pip#6565.
    And nobody has objected yet.

    It might be interesting to have @dstufft opinion on the local platform tag since he was opposed to the first version.

  6. pradyunsg commented on Oct 22, 2019

    @pradyunsg
    Member

    IMO, localhost/local tag makes sense. If @dstufft isn't opposed, we should move ahead.

  7. dstufft commented on Nov 16, 2019

    @dstufft
    Member

    I don't have any problems with some sort of explicit "local" tag.

  8. pradyunsg commented on Nov 16, 2019

    @pradyunsg
    Member

    Closing in favor of #239 then. :)

  9. henryiii commented on Apr 29, 2024

    @henryiii
    Contributor

    Five years later and the 'local' tag hasn't gone anywhere. There's another impact of this that has hurt several backends: this is wrong if the linux tag isn't "higher" priority than the manylinux tags: next(packaging.tags.sys_tags(), which was used by (at least) scikit-build-core, hatchling, and probably others. Fixing this bug has caused people to complain because they "were producing manylinux" wheels already without auditwheel (in tag only). I would have expected linux tag to be above generalized redistributable tags, and I'd expect if someone built an sdist into a wheel, that would be preferred over a generalized "manylinux" wheel with bundled dependencies.

    The fix for backends is:

    best_tag = next(
                iter(
                    p
                    for p in packaging.tags.sys_tags()
                    if "manylinux" not in p.platform and "muslllinux" not in p.platform
                )
            )

    IMO, linux should come before many/musl even if #239 was added; the argument was that it supported macOS and Windows too, but on linux there's already a "native/redistributable" distinction due to many/musllinux while those don't have a "redistributiable/non-redistributable" distinction yet. "local" tags could still be first; I'd assume most/all build backends would still produce the linux tag first, and you'd have to opt into or retag for local.

  10. brettcannon commented on Jun 14, 2024

    @brettcannon
    Member

    I've reopened the issue.

  11. added a commit that references this issue on Jun 27, 2024
  12. 1 remaining item

  13. brettcannon commented on Jul 8, 2024

    @brettcannon
    Member

    After thinking about this a bit this weekend, I think I'm up for this change happening. I don't think the breakage would be large, and logically it makes sense.

  14. brettcannon commented on May 19, 2026

    @brettcannon
    Member

    Looks like we have a PR for this now. Do we want to go through with this breaking change?

  15. henryiii commented on May 27, 2026

    @henryiii
    Contributor

    I think it's a good idea, hopefully not too breaking?

  16. brettcannon commented on May 27, 2026

    @brettcannon
    Member

    I think it's a good idea, hopefully not too breaking?

    🤞

  17. sbidoul commented on May 28, 2026

    @sbidoul
    Member

    I used to have a deployment scenario where I collected wheels in linux CI with pip wheel, to be deployed on target linux machines which had a different linux flavor. In that scenario, I was happy to get the manylinux wheels and not the wheels specific to the CI platform.

    I suspect this scenario will now break.

    I don't know if that is a common practice and I'm certainly not mentioning it to prevent this change, but I wanted to report it just in case.

  18. added a commit that references this issue on Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions