Adding manylinux2010 github action
- Validates that the manylinux2010 environment can build pycapnp - Handle lib and lib64 cases - Has patch for aligned_alloc symbol (not available prior to glibc 2.16) https://github.com/capnproto/capnproto/issues/743 - Fixes #197 - Should be ready to prepare a v1.0.0b1 release
This commit is contained in:
26
.github/workflows/manylinux2010.yml
vendored
Normal file
26
.github/workflows/manylinux2010.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: manylinux2010
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
manylinux2010:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: ${{ matrix.container-image }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ['cp37-cp37m', 'cp38-cp38']
|
||||||
|
container-image: ['quay.io/pypa/manylinux2010_x86_64', 'quay.io/pypa/manylinux2010_i686']
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
# capnproto build requires cmake 3+, CentOS 6 (manylinux2010) defaults to cmake 2.8
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
yum install -y cmake3 ninja-build
|
||||||
|
ln -sf /usr/bin/cmake3 /usr/local/bin/cmake
|
||||||
|
ln -s /usr/bin/ninja-build /usr/local/bin/ninja
|
||||||
|
/opt/python/${{ matrix.python-version }}/bin/python -m pip install -r requirements.txt
|
||||||
|
- name: Build pycapnp and install
|
||||||
|
run: |
|
||||||
|
/opt/python/${{ matrix.python-version }}/bin/python setup.py build
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
# for original project.
|
# for original project.
|
||||||
|
|
||||||
|
|
||||||
|
import fileinput
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import tarfile
|
import tarfile
|
||||||
@@ -91,3 +92,14 @@ def fetch_libcapnp(savedir, url=None):
|
|||||||
else:
|
else:
|
||||||
cpp_dir = os.path.join(with_version, 'c++')
|
cpp_dir = os.path.join(with_version, 'c++')
|
||||||
shutil.move(cpp_dir, dest)
|
shutil.move(cpp_dir, dest)
|
||||||
|
|
||||||
|
# XXX (HaaTa): There's a bug in capnproto-0.7.0 on CentOS 6 (or any glibc older than 2.16)
|
||||||
|
# This patches the issue
|
||||||
|
with fileinput.FileInput(os.path.join(dest, 'src', 'kj', 'table.c++'), inplace=True, backup='.bak') as f:
|
||||||
|
for line in f:
|
||||||
|
print(
|
||||||
|
line.replace(
|
||||||
|
'__APPLE__ || __BIONIC__', '__APPLE__ || __BIONIC__ || (defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 16))'
|
||||||
|
),
|
||||||
|
end=''
|
||||||
|
)
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -119,6 +119,7 @@ class build_libcapnp_ext(build_ext_c):
|
|||||||
capnp_executable = find_executable("capnp")
|
capnp_executable = find_executable("capnp")
|
||||||
if capnp_executable:
|
if capnp_executable:
|
||||||
self.include_dirs += [os.path.join(os.path.dirname(capnp_executable), '..', 'include')]
|
self.include_dirs += [os.path.join(os.path.dirname(capnp_executable), '..', 'include')]
|
||||||
|
self.library_dirs += [os.path.join(os.path.dirname(capnp_executable), '..', 'lib{}'.format(8 * struct.calcsize("P")))]
|
||||||
self.library_dirs += [os.path.join(os.path.dirname(capnp_executable), '..', 'lib')]
|
self.library_dirs += [os.path.join(os.path.dirname(capnp_executable), '..', 'lib')]
|
||||||
|
|
||||||
# Try to autodetect presence of library. Requires compile/run
|
# Try to autodetect presence of library. Requires compile/run
|
||||||
@@ -156,6 +157,7 @@ class build_libcapnp_ext(build_ext_c):
|
|||||||
info("capnproto already built at {}".format(build_dir))
|
info("capnproto already built at {}".format(build_dir))
|
||||||
|
|
||||||
self.include_dirs += [os.path.join(build_dir, 'include')]
|
self.include_dirs += [os.path.join(build_dir, 'include')]
|
||||||
|
self.library_dirs += [os.path.join(build_dir, 'lib{}'.format(8 * struct.calcsize("P")))]
|
||||||
self.library_dirs += [os.path.join(build_dir, 'lib')]
|
self.library_dirs += [os.path.join(build_dir, 'lib')]
|
||||||
|
|
||||||
return build_ext_c.run(self)
|
return build_ext_c.run(self)
|
||||||
|
|||||||
Reference in New Issue
Block a user