Skip to content

Commit

Permalink
Merge pull request #1347 from hauntsaninja/abi3audit
Browse files Browse the repository at this point in the history
Suggest running abi3audit in docs
  • Loading branch information
joerick committed Dec 11, 2022
2 parents ff8e121 + 41daa4b commit c8a2671
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/faq.md
Expand Up @@ -118,6 +118,8 @@ The CPython Limited API is a subset of the Python C Extension API that's declare

To create a package that builds ABI3 wheels, you'll need to configure your build backend to compile libraries correctly create wheels with the right tags. [Check this repo](https://github.com/joerick/python-abi3-package-sample) for an example of how to do this with setuptools.

You could also consider running [abi3audit](https://github.com/trailofbits/abi3audit) against the produced wheels in order to check for abi3 violations or inconsistencies. You can run it alongside the default in your [CIBW_REPAIR_WHEEL_COMMAND](options.md#repair-wheel-command).

### Packages with optional C extensions {: #optional-extensions}

`cibuildwheel` defines the environment variable `CIBUILDWHEEL` to the value `1` allowing projects for which the C extension is optional to make it mandatory when building wheels.
Expand Down
28 changes: 28 additions & 0 deletions docs/options.md
Expand Up @@ -898,6 +898,18 @@ Platform-specific environment variables are also available:<br/>
python scripts/check_repaired_wheel.py -w {dest_dir} {wheel}
```

```yaml
# Use abi3audit to catch issues with Limited API wheels
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
auditwheel repair -w {dest_dir} {wheel} &&
pipx run abi3audit --strict --report {wheel}
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} &&
pipx run abi3audit --strict --report {wheel}
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
pipx run abi3audit --strict --report {wheel}
```

!!! tab examples "pyproject.toml"

```toml
Expand All @@ -922,6 +934,22 @@ Platform-specific environment variables are also available:<br/>
]
```

```toml
# Use abi3audit to catch issues with Limited API wheels
[tool.cibuildwheel.linux]
repair-wheel-command = [
"auditwheel repair -w {dest_dir} {wheel}",
"pipx run abi3audit --strict --report {wheel}",
]
[tool.cibuildwheel.macos]
repair-wheel-command = [
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}",
"pipx run abi3audit --strict --report {wheel}",
]
[tool.cibuildwheel.windows]
repair-wheel-command = "pipx run abi3audit --strict --report {wheel}"
```

In configuration mode, you can use an inline array, and the items will be joined with `&&`.


Expand Down

0 comments on commit c8a2671

Please sign in to comment.