Skip to content

ci: build and publish musllinux wheels - #528

Open
philomath213 wants to merge 5 commits into
mainfrom
ci/musllinux-wheels
Open

ci: build and publish musllinux wheels#528
philomath213 wants to merge 5 commits into
mainfrom
ci/musllinux-wheels

Conversation

@philomath213

@philomath213 philomath213 commented Aug 22, 2026

Copy link
Copy Markdown
Member

Depends on #524 (docs only). That pull request adds the platform table this change extends.

Issue #526 shows the problem. We publish glibc wheels only. On musl-based distributions, pip install tenseal finds no wheel and builds from source instead.

1. Publish musllinux wheels. Add musllinux_x86_64 to the matrix in tests.yml and publish_wheels.yml, and pin CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2. The image has the same toolchain as manylinux, so the build needs no other change.

2. Link SEAL one time in the C++ test binary. cmake/tests.cmake linked the static seal library into tenseal_tests. It also linked libtenseal.so, which contains the same static SEAL. The test binary then held two copies of SEAL's global memory pool. Both copies are destroyed at exit, and the second destruction reads freed memory:

#0  std::shared_ptr<seal::util::MemoryPool>::~shared_ptr()
#1  __funcs_on_exit () at src/exit/atexit.c:34

glibc hides this, because the executable's symbols have priority over the shared library's symbols. musl keeps both copies. The bug is old. This pull request is the first change that runs the C++ tests on musl.

3. Bound make parallelism. The fix above removed a build-graph edge, so make -j started 44 compilers instead of 31. The largest translation unit needs more than 1 GB, and the burst killed the runner. Both the Linux and the macOS commands now use make -j4.

All 17 jobs pass. The musl cp314 cell changed from a segfault to a pass. macOS returned to 22 minutes from 39 minutes.

Cost: each matrix increases from 12 to 16 cells.

Follow-up, not in this pull request: ${SOURCES} is compiled three times. An OBJECT library shared by the three targets would remove about a third of the compile work.

@philomath213
philomath213 requested a review from youben11 August 22, 2026 08:40
@philomath213 philomath213 changed the title Build and publish musllinux wheels feat: build and publish musllinux wheels Aug 22, 2026
@philomath213 philomath213 changed the title feat: build and publish musllinux wheels ci: build and publish musllinux wheels Aug 22, 2026
@philomath213 philomath213 added the Build Related to the build of the package label Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Related to the build of the package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant