fix: produce correct python wheel metadata - #8632
Conversation
all published deltachat-rpc-server wheels so far fail "wheel tags" and probably other tools.
| ) | ||
| wheel.writestr( | ||
| f"deltachat_rpc_server-{version}.dist-info/WHEEL", | ||
| "Wheel-Version: 1.0\nRoot-Is-Purelib: false\nTag: {tag}", |
There was a problem hiding this comment.
the lost "f" string means that "{tag}" is in all so far published python wheels. Usually pip derives things from filenames but some tooling actually reads the wheel metadata (repackers or so, can't remember).
| run: | | ||
| mkdir tagcheck | ||
| cp dist/*.whl tagcheck/ | ||
| nix run --inputs-from . nixpkgs#python3Packages.wheel -- tags tagcheck/*.whl |
There was a problem hiding this comment.
Does this test work for you?
I tried with and without the fix, and get the same result:
$ nix build .#deltachat-rpc-server-aarch64-linux-wheel
...
$ ls result
deltachat_rpc_server-2.60.0-dev-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
$ sha256sum result/deltachat_rpc_server-2.60.0-dev-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
578cc4ec9907c2870b92ef811e911042fb8fd085868042891f2fef838a02ae58 result/deltachat_rpc_server-2.60.0-dev-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
$ nix run --inputs-from . nixpkgs#python3Packages.wheel -- tags result/*.whl
No hash found for file 'deltachat_rpc_server-2.60.0.dist-info/WHEEL'
With the fix on this branch:
$ nix build .#deltachat-rpc-server-aarch64-linux-wheel
...
$ sha256sum result/deltachat_rpc_server-2.60.0-dev-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
abcb060bc4f47d5ce743dd648836ef80823448064ecfb5855782f6e382b3ca38 result/deltachat_rpc_server-2.60.0-dev-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
$ nix run --inputs-from . nixpkgs#python3Packages.wheel -- tags result/*.whl
No hash found for file 'deltachat_rpc_server-2.60.0.dist-info/WHEEL'
There was a problem hiding this comment.
I downloaded https://github.com/chatmail/core/releases/download/v2.59.0/deltachat_rpc_server-2.59.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl and can reproduce this:
$ wheel tags deltachat_rpc_server-2.59.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Traceback (most recent call last):
File "/usr/bin/wheel", line 8, in <module>
sys.exit(main())
~~~~^^
File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 167, in main
args.func(args)
~~~~~~~~~^^^^^^
File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 48, in tags_f
for name in names:
^^^^^
File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 37, in <genexpr>
tags(
~~~~^
wheel,
^^^^^^
...<4 lines>...
args.remove,
^^^^^^^^^^^^
)
^
File "/usr/lib/python3.14/site-packages/wheel/_commands/tags.py", line 89, in tags
abivers = {tag.split("-")[1] for tag in tags}
~~~~~~~~~~~~~~^^^
IndexError: list index out of range
wheel package version is 0.48.0
There was a problem hiding this comment.
On v2.59.0 tag:
$ nix build .#deltachat-rpc-server-aarch64-linux-wheel
...
$ sha256sum result/deltachat_rpc_server-2.59.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
13cd6a7a1af3a49e67d8911ce0a139dcaa286e36f9ac5b6c6408ea4ae93e5cba result/deltachat_rpc_server-2.59.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
$ wheel tags result/deltachat_rpc_server-2.59.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Traceback (most recent call last):
File "/usr/bin/wheel", line 8, in <module>
sys.exit(main())
~~~~^^
File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 167, in main
args.func(args)
~~~~~~~~~^^^^^^
File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 48, in tags_f
for name in names:
^^^^^
File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 37, in <genexpr>
tags(
~~~~^
wheel,
^^^^^^
...<4 lines>...
args.remove,
^^^^^^^^^^^^
)
^
File "/usr/lib/python3.14/site-packages/wheel/_commands/tags.py", line 89, in tags
abivers = {tag.split("-")[1] for tag in tags}
~~~~~~~~~~~~~~^^^
IndexError: list index out of range
There was a problem hiding this comment.
Maybe the problem is -dev in the name, with -dev versions it fails differently (like in the first message).
ZIP archive contents looks like this:
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
1980-01-01 00:00:00 ..... 16914 5388 deltachat_rpc_server/LICENSE
1980-01-01 00:00:00 ..... 1272 618 deltachat_rpc_server/README.md
1980-01-01 00:00:00 ..... 147 119 deltachat_rpc_server/__init__.py
1980-01-01 00:00:00 ..... 21285824 11340026 deltachat_rpc_server/deltachat-rpc-server
1980-01-01 00:00:00 ..... 1419 685 deltachat_rpc_server-2.60.0-dev.dist-info/METADATA
1980-01-01 00:00:00 ..... 52 54 deltachat_rpc_server-2.60.0-dev.dist-info/WHEEL
1980-01-01 00:00:00 ..... 66 55 deltachat_rpc_server-2.60.0-dev.dist-info/entry_points.txt
1980-01-01 00:00:00 ..... 732 427 deltachat_rpc_server-2.60.0.dist-info/RECORD
------------------- ----- ------------ ------------ ------------------------
|
This works in the end like this: But only if i remove "-dev" from Cargo.toml from where the version is fetched. With "-dev" it produces broken wheel that fails with |
all published deltachat-rpc-server wheels so far fail "wheel tags"