Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Linux "extra dependencies" console blocks into doctests #74

Closed
dhermes opened this issue Oct 24, 2017 · 1 comment
Closed

Make Linux "extra dependencies" console blocks into doctests #74

dhermes opened this issue Oct 24, 2017 · 1 comment

Comments

@dhermes
Copy link
Owner

dhermes commented Oct 24, 2017

(From #179): Convert readelf -d and related blocks in docs/python/binary-extension.rst to invoke_shell()

Also: Use invoke_shell() or similar for listing the C headers (in a built ${BEZIER_INSTALL_PREFIX}/include)


OLDER CONTENT:

This is for the ls .../bezier/.lib and readelf boxes. The idea behind this is that we can avoid staleness in the documentation by using a doctest instead of a console block.

This mirrors similar work done for Mac OS X (85250fd) and Windows (0284717)

On a current Linux (Ubuntu 16.04), it's "impossible" to build a manylinux wheel:

$ virtualenv venv-auditwheel
$ venv-auditwheel/bin/pip install numpy
$ venv-auditwheel/bin/pip wheel . --wheel-dir UNEDITED/
$ venv-auditwheel/bin/pip install auditwheel
$ venv-auditwheel/bin/auditwheel repair UNEDITED/bezier*.whl -w EDITED/
Repairing bezier-0.5.1.dev1-cp36-cp36m-linux_x86_64.whl
usage: auditwheel [-h] [-V] [-v] command ...
auditwheel: error: cannot repair "UNEDITED/bezier-0.5.1.dev1-cp36-cp36m-linux_x86_64.whl" to "manylinux1_x86_64" ABI because of the presence of too-recent versioned symbols. You'll need to compile the wheel on an older toolchain.

However, it is possible to bypass the command line checks and just "repair" the wheel anyway:

from auditwheel.repair import repair_wheel

repair_wheel(
    '.../UNEDITED/bezier-0.5.1.dev1-cp36-cp36m-linux_x86_64.whl',
    abi='linux_x86_64',
    lib_sdir='.lib',
    out_dir='.../EDITED',
    update_tags=True,
)

However, this still won't help because the use of the newer toolchain results in different vendored in libraries:

# On Ubuntu 16.04
$ ls -1 .lib/
libgfortran-e2b67144.so.3.0.0
libquadmath-c77230e3.so.0.0.0

# vs.

# On CentOS Docker container
$ ls -1 .lib/
libgfortran-ed201abd.so.3.0.0*

and different compiled extension ELF content:

# On Ubuntu 16.04
$ readelf -d _curve_speedup.cpython-36m-x86_64-linux-gnu.so

Dynamic section at offset 0x15f1f8 contains 27 entries:
  Tag        Type                         Name/Value
 0x000000000000000f (RPATH)              Library rpath: [$ORIGIN/.lib]
 0x0000000000000001 (NEEDED)             Shared library: [libgfortran-e2b67144.so.3.0.0]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
...

# vs.

# On CentOS Docker container
$ readelf -d _curve_speedup.cpython-36m-x86_64-linux-gnu.so

Dynamic section at offset 0x10d000 contains 27 entries:
  Tag        Type                         Name/Value
 0x000000000000000f (RPATH)              Library rpath: [$ORIGIN/.libs]
 0x0000000000000001 (NEEDED)             Shared library: [libgfortran-ed201abd.so.3.0.0]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
...
@dhermes
Copy link
Owner Author

dhermes commented Oct 24, 2017

Also, I am dense, it's possible to use the CLI tool without failure (via the --plat flag):

$ venv-auditwheel/bin/auditwheel repair \
>   UNEDITED/bezier*.whl \
>   --wheel-dir EDITED/ \
>   --plat linux_x86_64
Repairing bezier-0.5.1.dev1-cp36-cp36m-linux_x86_64.whl
Grafting: /lib/x86_64-linux-gnu/libgcc_s.so.1 -> bezier/.libs/libgcc_s-c77f8044.so.1
Grafting: /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0 -> bezier/.libs/libgfortran-e2b67144.so.3.0.0
Grafting: /lib/x86_64-linux-gnu/libc-2.23.so -> bezier/.libs/libc-2-4cd1a422.23.so
warning: working around a Linux kernel bug by creating a hole of 2101248 bytes in ‘bezier/.libs/libc-2-4cd1a422.23.so’
Grafting: /lib/x86_64-linux-gnu/libm-2.23.so -> bezier/.libs/libm-2-6ea08983.23.so
Grafting: /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0 -> bezier/.libs/libquadmath-c77230e3.so.0.0.0
Grafting: /lib/x86_64-linux-gnu/libpthread-2.23.so -> bezier/.libs/libpthread-2-4b6c9076.23.so
warning: working around a Linux kernel bug by creating a hole of 2076672 bytes in ‘bezier/.libs/libpthread-2-4b6c9076.23.so’
Setting RPATH: bezier/_curve_intersection_speedup.cpython-36m-x86_64-linux-gnu.so to "$ORIGIN/.libs"
Setting RPATH: bezier/_curve_speedup.cpython-36m-x86_64-linux-gnu.so to "$ORIGIN/.libs"
Setting RPATH: bezier/_helpers_speedup.cpython-36m-x86_64-linux-gnu.so to "$ORIGIN/.libs"
Setting RPATH: bezier/_surface_speedup.cpython-36m-x86_64-linux-gnu.so to "$ORIGIN/.libs"
Previous filename tags: linux_x86_64
No filename tags change needed.
Previous WHEEL info tags: cp36-cp36m-linux_x86_64
No WHEEL info change needed.

Fixed-up wheel written to .../EDITED/bezier-0.5.1.dev1-cp36-cp36m-linux_x86_64.whl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant