Skip to content

maturin wheels don't contain any license files #2689

@threexc

Description

@threexc

Bug Description

As part of the RISE Project, we're building riscv64 versions of several binary Python modules at wheel_builder as a stopgap measure until manylinux + cibuildwheel support the architecture fully (and thus we can start the process of adding upstream support).

One of the packages we provide is maturin. We'd like to build the wheels with at least one license file included (preferably two; not just the specifier in maturin-1.9.1.dist-info/METADATA and so on. Since Cargo doesn't support multiple licenses easily yet, I'm wondering if it makes sense to always ship one of the two license-mit and license-apache files in the interim? For example, adding license-file = "license-mit" to Cargo.toml and running the standard build command results in a wheel structure like:

tgamblin@megalith ~/workspace/baylibre/rise/maturin ((HEAD detached at v1.9.1))$ unzip -l dist/maturin-1.9.1-py3-none-manylinux_2_39_x86_64.whl
Archive:  dist/maturin-1.9.1-py3-none-manylinux_2_39_x86_64.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
    16578  07-22-2025 19:50   maturin-1.9.1.dist-info/METADATA
      105  07-22-2025 19:50   maturin-1.9.1.dist-info/WHEEL
     1051  07-22-2025 19:50   maturin-1.9.1.dist-info/licenses/license-mit
     1145  07-22-2025 19:50   maturin/__main__.py
     8096  07-22-2025 19:50   maturin/__init__.py
     1172  07-22-2025 19:50   maturin/bootstrap.py
 24930440  07-22-2025 19:50   maturin-1.9.1.data/scripts/maturin
    86953  07-22-2025 19:50   maturin.libs/libbz2-e29e26c2.so.1
  5123641  07-22-2025 19:50   maturin.libs/libcrypto-ffb9879f.so.3
   225841  07-22-2025 19:50   maturin.libs/liblzma-bf2e23f0.so.5
   953953  07-22-2025 19:50   maturin.libs/libssl-31b798de.so.3
     1005  07-22-2025 19:50   maturin-1.9.1.dist-info/RECORD
---------                     -------
 31349980                     12 files

Your maturin version (maturin --version)

1.9.1

Your Python version (python -V)

3.13

Your pip version (pip -V)

pip 25.1.1

What bindings you're using

None

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. Build wheel with cargo run -- build --release -b bin -o dist --no-default-features --features full,native-tls
  2. Check contents with unzip -l /path/to/maturin/wheel, note no license files
  3. Add license-file = "license-mit" to Cargo.toml and re-run build step
  4. Confirm unzip -l /path/to/maturin/wheel shows maturin-1.9.1.dist-info/licenses/license-mit

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions