Skip to content

License file has absolute path in generated wheel file #2666

@NMertsch

Description

@NMertsch

Bug Description

The generated .whl files cannot be installed. Pip complains The wheel '[...].whl' has a file '/builds/.../LICENSE' trying to install outside the target directory.

With unzip -l I can see that all other files inside the whl file have relative paths, but LICENSE has an absolute path.

Example file (produced in CI): https://gitlab.com/NMertsch/fastq-stats/-/jobs/10479634587/artifacts/file/rust/target/wheels/fastq_stats-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

$ unzip -l fastq_stats-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 
Archive:  fastq_stats-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
      279  2025-06-26 15:10   fastq_stats-0.5.0.dist-info/METADATA
      127  2025-06-26 15:10   fastq_stats-0.5.0.dist-info/WHEEL
     1071  2025-06-26 15:10   /builds/NMertsch/fastq-stats/rust/../LICENSE
     1071  2025-06-26 15:10   fastq_stats-0.5.0.dist-info/licenses/LICENSE
      276  2025-06-26 15:10   fastq_stats/__init__.py
      999  2025-06-26 15:10   fastq_stats/_fastq_stats.pyi
        0  2025-06-26 15:10   fastq_stats/py.typed
   918896  2025-06-26 15:10   fastq_stats/_fastq_stats.abi3.so
      748  2025-06-26 15:10   fastq_stats-0.5.0.dist-info/RECORD
---------                     -------
   923467                     9 files

Your maturin version (maturin --version)

ghcr.io/pyo3/maturin:latest with digest ghcr.io/pyo3/maturin@sha256:f567e101f0bcb488809df5e46cabe57798d87618204451020dbb741b0242e393

Your Python version (python -V)

Python 3.9, Python 3.12

Your pip version (pip -V)

uv 0.7.3, pip 24.0

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. Run maturin build --release --sdist --auditwheel check
  2. Try to install the generated .whl file

CI example:

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