Skip to main content

Cross-distribution Linux wheels

Project description

https://travis-ci.org/manylinux/auditwheel.svg?branch=master

Auditing and relabeling cross-distribution Linux wheels.

Overview

auditwheel is a command line tool to facilitate the creation of Python wheel packages for Linux containing pre-compiled binary extensions that can be expected to be compatible with a wide variety of Linux distributions because they use only a small standard subset of the kernel+core userspace ABI.

auditwheel show: shows external shared libraries that the wheel depends on (beyond the libraries included in the manylinux_1 policy), and checks the extension modules for the use of versioned symbols that exceed the manylinux_1 ABI.

Installation

auditwheel can be installed using pip:

pip3 install auditwheel

It requires Python 3.3+, and runs on Linux. It requires that the shell command unzip be available in the PATH. Only systems that use ELF-based linkage are supported (this should be essentially every Linux).

Examples

Inspecting a wheel:

$ manylinux show numpy-1.10.4-cp35-cp35m-linux_x86_64.whl

numpy-1.10.4-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, GLIBC_2.2.5.

The following external shared libraries are required by the wheel:
{
    "libgfortran.so.1": "/usr/lib64/libgfortran.so.1.0.0",
    "libm.so.6": "/lib64/libm-2.5.so",
    "libc.so.6": "/lib64/libc-2.5.so",
    "libopenblas.so.0": "/usr/local/lib/libopenblas_nehalemp-r0.2.14.so",
    "libpthread.so.0": "/lib64/libpthread-2.5.so"
}

In order to achieve the tag platform tag "manylinux_1" the following
shared library dependencies would need to be eliminated:

libgfortran.so.1, libopenblas.so.0

Limitations

  1. auditwheel uses the DT_NEEDED information (like ldd) from the Python extension modules to determine which system system libraries they depend on. Code that that dynamically loads libraries at 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 ot 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. The manylinux_1 platform tag is consistent with symbol versions from CentOS 5. Fortunately with Docker, this is hard anymore.

Policies

The exact content of the policy is open for discussion. For example, here’s a first draft.

{"name": "manylinux_1",
 "symbol_versions": {
     "GLIBC": "2.5",
     "CXXABI": "3.4.8",
     "GLIBCXX": "3.4.9",
     "GCC": "4.2.0"},
 "lib_whitelist": [
     "libpanelw.so.5", "libncursesw.so.5",
     "libgcc_s.so.1",
     "libstdc++.so.6",
     "libm.so.6", "libdl.so.2", "librt.so.1", "libcrypt.so.1",
     "libc.so.6", "libnsl.so.1", "libutil.so.1", "libpthread.so.0",
     "libX11.so.6", "libXext.so.6", "libXrender.so.1", "libICE.so.6",
     "libSM.so.6", "libGL.so.1", "libgobject-2.0.so.0",
     "libgthread-2.0.so.0", "libglib-2.0.so.0"
 ]}

The tool is desined to support multiple policies with different whitelists, but currently there’s just one (well, two if you count the generic “linux” policy, which enforces zero constraints).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auditwheel-1.0.0.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auditwheel-1.0.0-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file auditwheel-1.0.0.tar.gz.

File metadata

  • Download URL: auditwheel-1.0.0.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for auditwheel-1.0.0.tar.gz
Algorithm Hash digest
SHA256 352c53c02a7778f354accd877384603dfb318421f7713a67d31b859ee7a395de
MD5 639b2e990d33db70791db3270d13f461
BLAKE2b-256 3df309f5ffefc483a989ce4f507103b3fa93d50d69118458d484602781369c9b

See more details on using hashes here.

File details

Details for the file auditwheel-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for auditwheel-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0fd05199108d2189cdb76edc4410c21f65bf5fa8845b514f2de722000c3b342f
MD5 255df2385faa2bb7766068d4df023c42
BLAKE2b-256 fd314c34f5f94b23ca93339042bfc67616ccb8e9ab198ecc11ccc4f2ca8b9032

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page