Skip to content

chore(deps): upgrade libpiper (piper1-gpl) to v1.8.0 and fix the musl build - #22

Closed
s2x wants to merge 3 commits into
masterfrom
chore/issue-21-upgrade-libpiper-piper1-gpl-submodule-v1
Closed

s2x wants to merge 3 commits into
masterfrom
chore/issue-21-upgrade-libpiper-piper1-gpl-submodule-v1

Conversation

@s2x

@s2x s2x commented Oct 2, 2026

Copy link
Copy Markdown
Member

Closes #21. Replaces Dependabot PR #3 (to be closed after merge).

  • Submodule piper1-gpl v1.4.1 -> v1.8.0. piper.h changes are additive, so the FFI cdef and the public PHP API are unchanged.
  • libpiper now installs the espeak-ng data to share/espeak-ng-data (this was the test-integration failure on chore(deps): bump piper1-gpl from 077c783 to 639388b #3). Makefile, CI and release workflow use the new path.
  • musl: libpiper v1.8.0 builds the piper executable too, so the glibc-only prebuilt onnxruntime no longer links on Alpine. CI and release now use alpine:3.23 with the onnxruntime-dev package.
  • Release asset removed: libonnxruntime-linux-musl-x86_64.tar.gz. The old file held the glibc build of ONNX Runtime 1.22.0 (checked on the v0.2.0 release), so it never worked on musl. Alpine users run apk add onnxruntime-dev (README, CHANGELOG, docs updated). We do not redistribute Alpine's onnxruntime and its ~50 dependencies, which avoids third-party license duties.

Verified by hand (Docker on a Linux host, x86_64): ubuntu 24.04 + PHP 8.3 with make build-libs, and alpine 3.23 + PHP 8.4 + onnxruntime-dev with the musl libpiper.so: 10/10 integration tests each. The CI musl job only builds.

@s2x

s2x commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

Closing this in favour of #27, but not because anything is wrong with the work here — the analysis was right and the solution you chose is sound. Recording why, so it is not lost.

What was correct. The root-cause analysis holds: libpiper v1.8.0 also builds the piper executable, so the prebuilt glibc-only onnxruntime-linux-x64-1.22.0 that the new CMake downloads no longer links on Alpine (undefined reference to __stack_chk_fail@GLIBC_2.4, std::__throw_system_error(int)@GLIBCXX_3.4.11). And the check of the published libonnxruntime-linux-musl-x86_64.tar.gz is the important discovery here: it held a glibc library (GLIBC_2.2.5 to GLIBC_2.27), so the musl ONNX Runtime asset we have been shipping could never load on musl. Also correct and valuable: keeping Alpine's onnxruntime-dev out of our release assets, because redistributing it with its ~50 dependencies is a third-party license problem we should not take on.

Why it is still not merged. Microsoft does not publish a musl build of ONNX Runtime. The linux-x64, linux-aarch64 and CUDA archives are the only Linux assets in the 1.22.0, 1.23.0, 1.23.2 and 1.30.0 releases of microsoft/onnxruntime. So a supported musl build means depending on a package from Alpine's own repository, which is a chain we would be endorsing for users rather than shipping ourselves. Piotr decided to drop musl support instead: no musl CI job, no musl release assets, documentation that says so. That is a scope decision, not a correction of your work.

What is carried over. #27 keeps the parts of this PR that are needed and verified:

  • the piper1-gpl submodule bump v1.4.1 -> v1.8.0 (077c783 -> 639388b),
  • the espeak-ng-data -> share/espeak-ng-data install path change in the Makefile, ci.yml
    and release.yml, which is what made test-integration fail on Dependabot PR chore(deps): bump piper1-gpl from 077c783 to 639388b #3,
  • the cdef check against the new piper.h: piper_audio_chunk and
    piper_synthesize_options are unchanged and piper_create_with_options/piper_version are
    additive, so the FFI definitions and the public PHP API stay as they are,
  • the integration runs on both libc variants.

What #27 does not carry over is the apk add onnxruntime-dev handling: no musl job, no
musl assets, no alpine:3.23, no Alpine install instructions. Because of that, issue #21 is
closed by #27 as well — its musl half is superseded by the removal in #26.

Thanks, this was the right analysis to hand over.

s2x added a commit that referenced this pull request Oct 3, 2026
…l assets (#26) (#27)

## What changed

Removes musl (Alpine) support entirely: the `build-piper-musl` job in
`ci.yml` and
`release.yml` (with its entries in the `ci-ok` and `publish` `needs:`
lists), the two musl
release assets, the `alpine` container prose in
`docs/release-workflow.md`, the README
instructions to install ONNX Runtime from the Alpine package, and the
musl job in `AGENTS.md`.
The README now states the supported platform (Linux x86_64 with glibc)
and `CHANGELOG.md` gets
a `Removed` entry with the reasons and what an Alpine user should do
instead.

**Why:** libpiper links ONNX Runtime and Microsoft publishes no musl
build of it, so there is
nothing on Alpine to link libpiper against except a package from
Alpine's own repository. The
musl archives we shipped never worked anyway:
`libonnxruntime-linux-musl-x86_64.tar.gz` up to
v0.2.0 holds a glibc library (`GLIBC_2.2.5` to `GLIBC_2.27`), which the
musl loader cannot
resolve.

Carried over from #22, which solved most of #21 with the rejected
*keep-musl* approach: the
`piper1-gpl` submodule bump v1.4.1 -> v1.8.0 and the `espeak-ng-data` ->
`share/espeak-ng-data`
install path fix (the `test-integration` failure on Dependabot PR #3).
The Alpine-package part
of #22 is not carried over.

Licensing is untouched: MIT for the PHP code, GPL-3.0 for libpiper and
the espeak-ng data.

Closes #26

## How it was tested

- `bin/lint.sh` (composer validate/audit, php-cs-fixer, PHPStan, Rector,
shellcheck) and
  `vendor/bin/phpunit --testsuite unit` (14 tests) in the worktree.
- The FFI cdef in `src/PiperTTS.php` was checked against the new
`piper1-gpl/libpiper/include/piper.h`: `piper_audio_chunk` and
`piper_synthesize_options`
keep their field order and types, `piper_create` is unchanged, and the
new functions
(`piper_create_with_options`, `piper_version`) are additive, so the
public PHP API does not
  change.
- End to end on glibc on a Linux x86_64 host (Ubuntu, cmake 4.2.3, PHP
8.5.4): `make build-libs`
(libpiper v1.8.0 + ONNX Runtime 1.22.0, `libs/espeak-ng-data` from the
new `share/` path),
`make test-model`, unit suite 14/14 and `vendor/bin/phpunit --group
integration` 10/10.
- Both workflow files parse as YAML and every name in every `needs:`
exists as a job;
`ci-ok` lists every other job in `ci.yml`. No test reads
`.github/workflows/`, so no test
  asserted the old job list.

## Checklist

- [x] Tests added or updated, and all checks pass
- [x] `CHANGELOG.md` updated under `[Unreleased]`
- [x] Documentation updated
- [x] Everything is written in English
- [x] The PR title is a Conventional Commit (`feat: ...`, `fix: ...`)
@s2x

s2x commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

Superseded by #27, as explained in the comment above. The submodule bump and the espeak-ng path fix from this branch were carried over; the Alpine-package approach was not, because musl support is removed (#26).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade libpiper (piper1-gpl submodule) v1.4.1 → v1.8.0

1 participant