Skip to content

Commit fd4563d

Browse files
mayeuthenryiii
andauthored
fix(wheels): link libstdc++ statically on manylinux1 (#159)
* fix(wheels): link libstdc++ statically on manylinux1 For some reason, the ninja binary built on manylinux1 is segfaulting on ubuntu20.04+ & RHEL 8+. Statically linking libstdc++ fixes the issue. * ci: add a test on the host for linux Signed-off-by: Henry Schreiner <[email protected]> Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: Henry Schreiner <[email protected]>
1 parent 704bf10 commit fd4563d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ jobs:
6565
with:
6666
path: ./wheelhouse/*.whl
6767

68+
- name: Test wheel on host Linux
69+
if: runner.os == 'Linux' && matrix.arch == 'x86_64'
70+
run: |
71+
pip install wheelhouse/*manylinux*x86_64*.whl
72+
ninja --version
73+
python -m ninja --version
74+
6875
build_sdist:
6976
name: Build source distribution
7077
needs: [lint]

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ repair-wheel-command = "python scripts/repair_wheel.py -w {dest_dir} {wheel}"
1717
test-extras = "test"
1818
test-command = "pytest {project}/tests"
1919

20-
[tool.cibuildwheel.linux]
20+
[[tool.cibuildwheel.overrides]]
21+
select = "*-manylinux_{x86_64,i686}"
2122
manylinux-x86_64-image = "manylinux1"
2223
manylinux-i686-image = "manylinux1"
24+
environment = { LDFLAGS = "-static-libstdc++" }
2325

2426
[tool.cibuildwheel.macos.environment]
2527
MACOSX_DEPLOYMENT_TARGET = "10.9"

0 commit comments

Comments
 (0)