auditwheel icon indicating copy to clipboard operation
auditwheel copied to clipboard

mechanism for "auditwheel repair" to add a local version identifier?

Open sbidoul opened this issue 7 years ago • 9 comments

Hi,

Running auditwheel repair may generate subtly different versions of the wheel, depending on the exact version of so libraries being included.

When looking at the wheel or otherwise running pip freeze there is no externally visible difference though.

I was wondering if it would make sense to have auditwheel repair accept a new optional "local version identifier" [1] argument that would be appended to the repaired wheel version.

This would enable user to encode some information about the embedded dependencies in the repaired version.

[1] https://www.python.org/dev/peps/pep-0440/#local-version-identifiers

sbidoul avatar Oct 25 '16 07:10 sbidoul

Note that local versions aren't allowed on PyPI -- it doesn't rule this out, but does mean that it'd only be useful in somewhat limited circumstances for local/private builds.

Another thing to consider looking at is the rarely-used "build tag" that wheel files support: https://www.python.org/dev/peps/pep-0427/#file-name-convention

What's your use case? Do you have multiple wheels that vendor different library versions that you need to keep track of? There are lots of ways that two versions of "the same wheel" can differ, well before auditwheel arrives on the scene -- using different compiler versions, different compiler options (optimized vs. debug), stripped binaries or not, different build-time configuration...

njsmith avatar Oct 25 '16 08:10 njsmith

My use case is indeed local/private builds. For instance I'm looking for a mechanism to express that my private build of some wheel contains a specific version of libssl.so to know when I need to upgrade my frozen requirements.txt.

sbidoul avatar Oct 25 '16 08:10 sbidoul

I've had a look at build tags. AFAIU it will not work for my use case because they are lost after install and do not come out in a pip freeze.

sbidoul avatar Oct 25 '16 13:10 sbidoul

I am fine with adding an option to append a local version identifier. @sbidoul do you want to submit a PR?

ogrisel avatar Jan 03 '17 12:01 ogrisel

@ogrisel I can give it a try.

I was wondering if there is are documented APIs to manipulate the version (I could not find it so far), or if the metadata files have to be manipulated "by hand".

sbidoul avatar Jan 03 '17 16:01 sbidoul

None of auditwheels APIs are documented :-). And I doubt there are any internal APIs for specifically this, because it isn't something that auditwheel needed before. But you could make one and then use it.

On Jan 3, 2017 8:43 AM, "Stéphane Bidoul (ACSONE)" [email protected] wrote:

@ogrisel https://github.com/ogrisel I can give it a try.

I was wondering if there is are documented APIs to manipulate the version (I could not find it so far), or if the metadata files have to be manipulated "by hand".

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pypa/auditwheel/issues/53#issuecomment-270159607, or mute the thread https://github.com/notifications/unsubscribe-auth/AAlOaPslJzOU6fIFP9tzF-2YN0-qm5u2ks5rOnqagaJpZM4KfqPW .

njsmith avatar Jan 03 '17 21:01 njsmith

FWIW if auditwheel was updated to support the most recent version of wheel (but see #102), this would not need to be implemented on auditwheel's side, but would just be a matter of wheel unpack && wheel pack ... --build-number=....

anntzer avatar Jun 13 '19 07:06 anntzer

@anntzer Support for build number in wheel pack is interesting. Yet I think this build number is not what I want. See my comment above.

sbidoul avatar Jun 14 '19 17:06 sbidoul

It would be nice if auditwheel could do this, but given that adding/changing local version identifiers needs to be done "manually" in a bunch of metadata files, we either need a tool or library we can use for this, or recommend an external tool for this. I'm not aware of any such tool, but opened https://github.com/pypa/wheel/issues/570 in wheel as a feature request.

lkollar avatar Sep 18 '23 21:09 lkollar