Skip to content

Commit

Permalink
docs: add FAQ entry on repairing wheels (#731)
Browse files Browse the repository at this point in the history
Follow up to #698.
The statement about producing `linux` wheels in build.md has been there
since well before this bug was fixed. :) Hopefully this will make it a
bit more discoverable.

Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Apr 29, 2024
1 parent 8634397 commit 93cf6ee
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
16 changes: 13 additions & 3 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ The three new items here (compared to SDists) are the [compatibility tags][]:
- `platform tag`: This is the platform the wheel is valid on, such as `any`,
`linux_x86_64`, or `manylinux_2_17_x86_64`.

(repairing-wheels)=

## Repairing

The wheels produced by default are not designed to be redistributable. Making
them redistributable depends on platform:

Expand All @@ -122,16 +126,21 @@ them redistributable depends on platform:
tag, and can be uploaded to PyPI.
- macOS: The wheels should be build with the official CPython releases, and
target a reasonable `MACOSX_DEPLOYMENT_TARGET` value (10.9 or newer). You
should run the wheels through `develwheel` to bundle external dependencies.
You'll also want to (carefully) cross compile for Apple Silicon.
should run the wheels through `develocate` to bundle external dependencies.
You'll also want to (carefully) cross compile for Apple Silicon or build on
Apple Silicon runners (`macos-14`+ on GHA).
- Windows: this is the easiest, usually, as the wheels don't have special rules
on what Python or OS is being used. However, if you want to bundle
dependencies, you'll need `delvewheel`, which is a bit younger than the other
two packages, and has to do a few more intrusive workarounds, but otherwise
works like those packages.

The easiest way to handle all the above for all Python versions, OSs,
architectures, including testing, is to use [cibuildwheel][].
architectures, including testing, is to use [cibuildwheel][]. There's also a
fairly new tool, [repairwheel][], that combines all these tools. Tools usually
allow extra flags that can be used for trickier repairs, like ignoring CUDA
libraries when bundling (which technically is not a true manylinux wheel, but is
the current workaround).

<!-- prettier-ignore-start -->

Expand All @@ -143,6 +152,7 @@ architectures, including testing, is to use [cibuildwheel][].
`setup.py bdist_wheel`! You can avoid this whole mess with
scikit-build-core.

[repairwheel]: https://github.com/jvolkman/repairwheel
[cibuildwheel]: https://cibuildwheel.readthedocs.io
[compatibility tags]: https://packaging.python.org/en/latest/specifications/binary-distribution-format

Expand Down
17 changes: 17 additions & 0 deletions docs/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ printout of the current settings using:
python -m scikit_build_core.builder
```

## Repairing wheels

Like most other backends[^1], scikit-build-core produced `linux` wheels, which
are not redistrubutable cannot be uploaded to PyPI[^2]. You have to run your
wheels through `auditwheel` to make `manylinux` wheels. `cibuildwheel`
automatically does this for you. See [repairing](#repairing-wheels).

[^1]:
Due to a [bug in packaging](https://github.com/pypa/packaging/issues/160),
some backends may mistakenly produce the wrong tags (including
scikit-build-core < 0.9), but the wheels are not actually
manylinux/musllinux, just mistagged.

[^2]:
Platforms like ARMv6 that do not have a manylinux spec are exempt from this
rule.

<!-- prettier-ignore-start -->

[scientific python cookie]: https://github.com/scientific-python/cookie
Expand Down

0 comments on commit 93cf6ee

Please sign in to comment.