auditwheel
==========
.. image:: https://travis-ci.org/pypa/auditwheel.svg?branch=main
:target: https://travis-ci.org/pypa/auditwheel
.. image:: https://badge.fury.io/py/auditwheel.svg
:target: https://pypi.org/project/auditwheel
.. image:: https://pepy.tech/badge/auditwheel/month
:target: https://pepy.tech/project/auditwheel/month
Auditing and relabeling of `PEP 600 manylinux_x_y
<https://www.python.org/dev/peps/pep-0600/>`_, `PEP 513 manylinux1
<https://www.python.org/dev/peps/pep-0513/>`_, `PEP 571 manylinux2010
<https://www.python.org/dev/peps/pep-0571/>`_ and `PEP 599 manylinux2014
<https://www.python.org/dev/peps/pep-0599/>`_ Linux wheels.
Overview
--------
``auditwheel`` is a command line tool to facilitate the creation of Python
`wheel packages <http://pythonwheels.com/>`_ for Linux (containing pre-compiled
binary extensions) that are compatible with a wide variety of Linux distributions,
consistent with the `PEP 600 manylinux_x_y
<https://www.python.org/dev/peps/pep-0600/>`_, `PEP 513 manylinux1
<https://www.python.org/dev/peps/pep-0513/>`_, `PEP 571 manylinux2010
<https://www.python.org/dev/peps/pep-0571/>`_ and `PEP 599 manylinux2014
<https://www.python.org/dev/peps/pep-0599/>`_ platform tags.
``auditwheel show``: shows external shared libraries that the wheel depends on
(beyond the libraries included in the ``manylinux`` policies), and
checks the extension modules for the use of versioned symbols that exceed
the ``manylinux`` ABI.
``auditwheel repair``: copies these external shared libraries into the wheel itself,
and automatically modifies the appropriate ``RPATH`` entries such that these libraries
will be picked up at runtime. This accomplishes a similar result as if the libraries had
been statically linked without requiring changes to the build system. Packagers are
advised that bundling, like static linking, may implicate copyright concerns.
Requirements
------------
- OS: Linux
- Python: 3.7+
- `patchelf <https://github.com/NixOS/patchelf>`_: 0.14+
Only systems that use `ELF
<https://en.wikipedia.org/wiki/Executable_and_Linkable_Format>`_-based linkage
are supported (this should be essentially every Linux).
In general, building ``manylinux1`` wheels requires running on a CentOS5
machine, building ``manylinux2010`` wheels requires running on a CentOS6
machine, and building ``manylinux2014`` wheels requires running on a CentOS7
machine, so we recommend using the pre-built manylinux `Docker images
<https://quay.io/repository/pypa/manylinux1_x86_64>`_, e.g. ::
$ docker run -i -t -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /bin/bash
Installation
------------
``auditwheel`` can be installed using pip:
.. code:: bash
$ pip3 install auditwheel
Examples
--------
Inspecting a wheel: ::
$ auditwheel show cffi-1.5.0-cp35-cp35m-linux_x86_64.whl
cffi-1.5.0-cp35-cp35m-linux_x86_64.whl is consistent with the
following platform tag: "linux_x86_64".
The wheel references the following external versioned symbols in
system-provided shared libraries: GLIBC_2.3.
The following external shared libraries are required by the wheel:
{
"libc.so.6": "/lib64/libc-2.5.so",
"libffi.so.5": "/usr/lib64/libffi.so.5.0.6",
"libpthread.so.0": "/lib64/libpthread-2.5.so"
}
In order to achieve the tag platform tag "manylinux1_x86_64" the
following shared library dependencies will need to be eliminated:
libffi.so.5
Repairing a wheel. ::
$ auditwheel repair cffi-1.5.2-cp35-cp35m-linux_x86_64.whl
Repairing cffi-1.5.2-cp35-cp35m-linux_x86_64.whl
Grafting: /usr/lib64/libffi.so.5.0.6
Setting RPATH: _cffi_backend.cpython-35m-x86_64-linux-gnu.so to "$ORIGIN/.libs_cffi_backend"
Previous filename tags: linux_x86_64
New filename tags: manylinux1_x86_64
Previous WHEEL info tags: cp35-cp35m-linux_x86_64
New WHEEL info tags: cp35-cp35m-manylinux1_x86_64
Fixed-up wheel written to /wheelhouse/cffi-1.5.2-cp35-cp35m-manylinux1_x86_64.whl
Limitations
-----------
1. ``auditwheel`` uses the `DT_NEEDED <https://en.wikipedia.org/wiki/Direct_binding>`_
information (like ``ldd``) from the Python extension modules to determine
which system libraries they depend on. Code that dynamically
loads libraries at runtime using ``ctypes`` / ``cffi`` (from Python) or
``dlopen`` (from C/C++) doesn't contain this information in a way that can
be statically determined, so dependencies that are loaded via those
mechanisms will be missed.
2. There's nothing we can do about "fixing" binaries if they were compiled and
linked against a too-recent version of ``libc`` or ``libstdc++``. These
libraries (and some others) use symbol versioning for backward
compatibility. In general, this means that code that was compiled against an
old version of ``glibc`` will run fine on systems with a newer version of
``glibc``, but code what was compiled on a new system won't / might not run
on older system.
So, to compile widely-compatible binaries, you're best off doing the build
on an old Linux distribution, such as a manylinux Docker image.
Testing
-------
The tests can be run with ``nox``, which will automatically install
test dependencies.
Some of the integration tests also require a running and accessible Docker
daemon. These tests will pull a number of docker images if they are not already
available on your system, but it won't update existing images.
To update these images manually, run::
docker pull python:3.7-slim
docker pull quay.io/pypa/manylinux1_x86_64
docker pull quay.io/pypa/manylinux2010_x86_64
docker pull quay.io/pypa/manylinux2014_x86_64
docker pull quay.io/pypa/manylinux_2_28_x86_64
You may also remove these images using ``docker rmi``.
Code of Conduct
---------------
Everyone interacting in the ``auditwheel`` project's codebases, issue trackers,
chat rooms, and mailing lists is expected to follow the
`PSF Code of Conduct`_.
.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
Raw data
{
"_id": null,
"home_page": "https://github.com/DeGirum/dg-auditwheel",
"name": "dg-auditwheel",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Robert T. McGibbon",
"author_email": "rmcgibbo@gmail.com",
"download_url": "",
"platform": null,
"description": "auditwheel\n==========\n\n.. image:: https://travis-ci.org/pypa/auditwheel.svg?branch=main\n :target: https://travis-ci.org/pypa/auditwheel\n.. image:: https://badge.fury.io/py/auditwheel.svg\n :target: https://pypi.org/project/auditwheel\n.. image:: https://pepy.tech/badge/auditwheel/month\n :target: https://pepy.tech/project/auditwheel/month\n\nAuditing and relabeling of `PEP 600 manylinux_x_y\n<https://www.python.org/dev/peps/pep-0600/>`_, `PEP 513 manylinux1\n<https://www.python.org/dev/peps/pep-0513/>`_, `PEP 571 manylinux2010\n<https://www.python.org/dev/peps/pep-0571/>`_ and `PEP 599 manylinux2014\n<https://www.python.org/dev/peps/pep-0599/>`_ Linux wheels.\n\nOverview\n--------\n\n``auditwheel`` is a command line tool to facilitate the creation of Python\n`wheel packages <http://pythonwheels.com/>`_ for Linux (containing pre-compiled\nbinary extensions) that are compatible with a wide variety of Linux distributions,\nconsistent with the `PEP 600 manylinux_x_y\n<https://www.python.org/dev/peps/pep-0600/>`_, `PEP 513 manylinux1\n<https://www.python.org/dev/peps/pep-0513/>`_, `PEP 571 manylinux2010\n<https://www.python.org/dev/peps/pep-0571/>`_ and `PEP 599 manylinux2014\n<https://www.python.org/dev/peps/pep-0599/>`_ platform tags.\n\n``auditwheel show``: shows external shared libraries that the wheel depends on\n(beyond the libraries included in the ``manylinux`` policies), and\nchecks the extension modules for the use of versioned symbols that exceed\nthe ``manylinux`` ABI.\n\n``auditwheel repair``: copies these external shared libraries into the wheel itself,\nand automatically modifies the appropriate ``RPATH`` entries such that these libraries\nwill be picked up at runtime. This accomplishes a similar result as if the libraries had\nbeen statically linked without requiring changes to the build system. Packagers are\nadvised that bundling, like static linking, may implicate copyright concerns.\n\nRequirements\n------------\n- OS: Linux\n- Python: 3.7+\n- `patchelf <https://github.com/NixOS/patchelf>`_: 0.14+\n\nOnly systems that use `ELF\n<https://en.wikipedia.org/wiki/Executable_and_Linkable_Format>`_-based linkage\nare supported (this should be essentially every Linux).\n\nIn general, building ``manylinux1`` wheels requires running on a CentOS5\nmachine, building ``manylinux2010`` wheels requires running on a CentOS6\nmachine, and building ``manylinux2014`` wheels requires running on a CentOS7\nmachine, so we recommend using the pre-built manylinux `Docker images\n<https://quay.io/repository/pypa/manylinux1_x86_64>`_, e.g. ::\n\n $ docker run -i -t -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /bin/bash\n\nInstallation\n------------\n\n``auditwheel`` can be installed using pip:\n\n.. code:: bash\n\n $ pip3 install auditwheel\n\nExamples\n--------\n\nInspecting a wheel: ::\n\n $ auditwheel show cffi-1.5.0-cp35-cp35m-linux_x86_64.whl\n\n cffi-1.5.0-cp35-cp35m-linux_x86_64.whl is consistent with the\n following platform tag: \"linux_x86_64\".\n\n The wheel references the following external versioned symbols in\n system-provided shared libraries: GLIBC_2.3.\n\n The following external shared libraries are required by the wheel:\n {\n \"libc.so.6\": \"/lib64/libc-2.5.so\",\n \"libffi.so.5\": \"/usr/lib64/libffi.so.5.0.6\",\n \"libpthread.so.0\": \"/lib64/libpthread-2.5.so\"\n }\n\n In order to achieve the tag platform tag \"manylinux1_x86_64\" the\n following shared library dependencies will need to be eliminated:\n\n libffi.so.5\n\nRepairing a wheel. ::\n\n $ auditwheel repair cffi-1.5.2-cp35-cp35m-linux_x86_64.whl\n Repairing cffi-1.5.2-cp35-cp35m-linux_x86_64.whl\n Grafting: /usr/lib64/libffi.so.5.0.6\n Setting RPATH: _cffi_backend.cpython-35m-x86_64-linux-gnu.so to \"$ORIGIN/.libs_cffi_backend\"\n Previous filename tags: linux_x86_64\n New filename tags: manylinux1_x86_64\n Previous WHEEL info tags: cp35-cp35m-linux_x86_64\n New WHEEL info tags: cp35-cp35m-manylinux1_x86_64\n\n Fixed-up wheel written to /wheelhouse/cffi-1.5.2-cp35-cp35m-manylinux1_x86_64.whl\n\n\nLimitations\n-----------\n\n1. ``auditwheel`` uses the `DT_NEEDED <https://en.wikipedia.org/wiki/Direct_binding>`_\n information (like ``ldd``) from the Python extension modules to determine\n which system libraries they depend on. Code that dynamically\n loads libraries at runtime using ``ctypes`` / ``cffi`` (from Python) or\n ``dlopen`` (from C/C++) doesn't contain this information in a way that can\n be statically determined, so dependencies that are loaded via those\n mechanisms will be missed.\n2. There's nothing we can do about \"fixing\" binaries if they were compiled and\n linked against a too-recent version of ``libc`` or ``libstdc++``. These\n libraries (and some others) use symbol versioning for backward\n compatibility. In general, this means that code that was compiled against an\n old version of ``glibc`` will run fine on systems with a newer version of\n ``glibc``, but code what was compiled on a new system won't / might not run\n on older system.\n\n So, to compile widely-compatible binaries, you're best off doing the build\n on an old Linux distribution, such as a manylinux Docker image.\n\nTesting\n-------\n\nThe tests can be run with ``nox``, which will automatically install\ntest dependencies.\n\nSome of the integration tests also require a running and accessible Docker\ndaemon. These tests will pull a number of docker images if they are not already\navailable on your system, but it won't update existing images.\nTo update these images manually, run::\n\n docker pull python:3.7-slim\n docker pull quay.io/pypa/manylinux1_x86_64\n docker pull quay.io/pypa/manylinux2010_x86_64\n docker pull quay.io/pypa/manylinux2014_x86_64\n docker pull quay.io/pypa/manylinux_2_28_x86_64\n\nYou may also remove these images using ``docker rmi``.\n\nCode of Conduct\n---------------\n\nEveryone interacting in the ``auditwheel`` project's codebases, issue trackers,\nchat rooms, and mailing lists is expected to follow the\n`PSF Code of Conduct`_.\n\n.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Cross-distribution Linux wheels",
"version": "1.1.0",
"project_urls": {
"Homepage": "https://github.com/DeGirum/dg-auditwheel"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2929d89ab1fd15ac1da9794feaf094a5d822e698fdae175ea0a7c156155274bd",
"md5": "028de3ed2abfa3312da66fa511535fe2",
"sha256": "a32c104ca005ba9df023bc148e6abb257fa45818fca85042464dedf058bb3f07"
},
"downloads": -1,
"filename": "dg_auditwheel-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "028de3ed2abfa3312da66fa511535fe2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 54746,
"upload_time": "2023-06-22T19:25:45",
"upload_time_iso_8601": "2023-06-22T19:25:45.367944Z",
"url": "https://files.pythonhosted.org/packages/29/29/d89ab1fd15ac1da9794feaf094a5d822e698fdae175ea0a7c156155274bd/dg_auditwheel-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-22 19:25:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DeGirum",
"github_project": "dg-auditwheel",
"travis_ci": true,
"coveralls": true,
"github_actions": true,
"lcname": "dg-auditwheel"
}