Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/deltachat-rpc-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,14 @@ jobs:
- name: List artifacts
run: ls -l dist/

- name: Check that the wheel metadata reads back
run: |
echo 'You can check a local `nix build` on non-Mac machines against the following checksums.'
sha256sum dist/*.whl
mkdir tagcheck
cp dist/*.whl tagcheck/
nix run --inputs-from . nixpkgs#python3Packages.wheel -- tags tagcheck/*.whl

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@link2xt link2xt Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
------------------- ----- ------------ ------------  ------------------------


- name: Upload binaries to the GitHub release
if: github.event_name == 'release'
env:
Expand Down
18 changes: 16 additions & 2 deletions scripts/wheel-rpc-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ def metadata_contents(version):
"""


def wheel_contents(tag):
"""Render the WHEEL metadata for a filename tag."""
interpreter, abi, platforms = tag.split("-")
lines = ["Wheel-Version: 1.0", "Root-Is-Purelib: false"]
lines += [
f"Tag: {interpreter}-{abi}-{platform}" for platform in platforms.split(".")
]
return "\n".join(lines) + "\n"


def build_wheel(version, binary, tag, windows=False):
filename = f"deltachat_rpc_server-{version}-{tag}.whl"

Expand Down Expand Up @@ -60,7 +70,7 @@ def main():
)
wheel.writestr(
f"deltachat_rpc_server-{version}.dist-info/WHEEL",
"Wheel-Version: 1.0\nRoot-Is-Purelib: false\nTag: {tag}",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

wheel_contents(tag),
)
wheel.writestr(
f"deltachat_rpc_server-{version}.dist-info/entry_points.txt",
Expand All @@ -87,7 +97,11 @@ def main():
def main():
with Path("Cargo.toml").open("rb") as fp:
cargo_manifest = tomllib.load(fp)
version = cargo_manifest["package"]["version"]

# Cargo's SEMVER "-dev" suffix is not a PEP 440 version,
# so translate to make wheel tooling and metadata writing happy.
version = cargo_manifest["package"]["version"].replace("-dev", ".dev0")

arch = sys.argv[1]
executable = sys.argv[2]
tags = arch2tags[arch]
Expand Down