ci(release): build Linux targets with cargo-zigbuild (glibc 2.28, real musl C++ runtime) - #276
Merged
Merged
Conversation
…nd a musl C++ runtime The gnu binaries were linked against the runner's glibc 2.39 and refused to start on Ubuntu 22.04 / Debian 12 / RHEL 9. The musl binary compiled the C++ tree-sitter-sql scanner with the host g++ against glibc libstdc++, which segfaulted on any repo containing a .sql file.
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two bugs in the v1.4.0 Linux release binaries (workflow-only change, no release is triggered by this PR):
vera-x86_64-unknown-linux-gnu/aarch64require GLIBC 2.39. They were linked natively on Ubuntu 24.04 runners, so they fail withGLIBC_2.39 not foundon Ubuntu 22.04, Debian 12, RHEL 9, etc.vera-x86_64-unknown-linux-muslsegfaults intree_sitter_sql_external_scanner_createon any repo containing a.sqlfile. The old step setCXX_x86_64_unknown_linux_musl=g++(host glibc g++), so the only C++ scanner was compiled against glibc libstdc++ and linked into a static musl binary.Both Linux gnu targets and the musl target now build with
cargo zigbuild(matrix.zig: true), which provides a self-contained C/C++ toolchain:ortisload-dynamic, so there is no link-time ONNX Runtime dependency to cross-link. Themusl-tools/g++symlink hack is removed; the sqlite-vecu_intN_tCFLAGS are kept. A newCheck Linux binary portabilitystep fails the build if the gnu binary's highestGLIBC_x.ysymbol exceeds the matrixglibcfloor, or if the musl binary is not static. macOS/Windows steps are unchanged (Build (native)now guarded by!matrix.zig).Verified locally with the exact workflow commands (cargo-zigbuild 0.23.4 / zig 0.16):
objdump -Tmax symbolGLIBC_2.28,--versionruns,setup --potion-code --index .on Flask exits 0.setup --potion-code --index .on Flask with a.sqlfile present exits 0 (previously segfaulted),searchexits 0.Only the workflow is changed; a v1.4.1 tag would be needed to ship fixed binaries.
Link to Devin session: https://app.devin.ai/sessions/0b10c0b095784568acf302cc024ef089
Open in Devin Desktop: https://app.devin.ai/desktop/session/0b10c0b095784568acf302cc024ef089?variant=devin
Requested by: @lemon07r
Summary by cubic
Fixes the v1.4.0 Linux release binaries: GNU builds now link against glibc 2.28 instead of the runner's 2.39, and the musl build gets a real musl C++ runtime so it no longer segfaults on repos with SQL files.
Changes
cargo-zigbuildvia the matrixzig: trueflag.musl-toolsandg++symlink hack; keeps the sqlite-vecu_intN_tCFLAGS.GLIBC_2.28, musl binary is static and handles.sqlfiles without crashing.Written for commit 86816ac. Summary will update on new commits.