fix(b10154): compile server-mcp.cpp + guard subprocess addchdir_np on old glibc - #365
Merged
Merged
Conversation
… old glibc The b10154 upgrade (PR #364) broke the Publish pipeline on 6 native jobs. Two independent root causes, both from upstream's new MCP-server support: 1. Undefined server_mcp symbols (macOS + all Windows jobs; latent on Linux). b10154 added tools/server/server-mcp.cpp, and server.cpp (llama_server's mcp_mgr lifecycle) + server-tools.cpp (tools.setup(..., mcp_mgr) / server_mcp::call_tool) — both already compiled into jllama — now reference server_mcp. server-mcp.cpp was missing from the CMake target_sources, so the link failed with undefined server_mcp::{start,shutdown,call_tool,list_tools, ~server_mcp}. A Linux .so tolerates undefined symbols (why the local build and Linux CI 'passed'); macOS/ld64 and Windows/MSVC hard-error. Add server-mcp.cpp to the non-Android jllama block (shares the subprocess.h posix_spawn Android guard). Not added to jllama_test (links neither server.cpp nor server-tools.cpp). Verified: nm now shows server_mcp::* as defined (T), and jllama links. 2. posix_spawn_file_actions_addchdir_np undeclared on manylinux2014 (glibc 2.17). b10154's vendored subprocess.h calls addchdir_np (glibc >= 2.29 / bionic API >= 34 / macOS >= 10.15) but guards it only for macOS. Add patch 0009 with a SUBPROCESS_HAVE_ADDCHDIR_NP probe (__GLIBC_PREREQ, nested under defined(__GLIBC__)) that falls back to ENOSYS on old glibc — this build never spawns with a cwd. Android already compiles it (weak-symbol macro). Also: /utf-8 for MSVC (C4566). server-tools.cpp embeds a U+2192 arrow in a narrow literal; MSVC/clang-cl warn C4566 and mangle it under code page 1252. Scope /utf-8 to jllama (gated on MSVC) — the documented C4566 fix. Verified locally: all 9 patches apply clean against b10154; cmake configure (fail-loud patch applier + TTS generator) passes; full jllama build links. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MeheJtyQwUzJGLcYpyWURD
bernardladenthin
had a problem deploying
to
maven-central
July 27, 2026 20:22 — with
GitHub Actions
Failure
bernardladenthin
had a problem deploying
to
maven-central
July 27, 2026 20:22 — with
GitHub Actions
Failure
bernardladenthin
had a problem deploying
to
startgate
July 27, 2026 20:22 — with
GitHub Actions
Error
|
5 tasks
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
The b10154 upgrade (#364) broke the Publish pipeline on 6 native jobs. All 6 trace to two independent root causes from upstream's new MCP-server support, plus one non-fatal warning:
server_mcpsymbols (macOS 15 arm64 + all 4 Windows jobs; latent on Linux). b10154 addedtools/server/server-mcp.cpp, andserver.cpp(llama_server'smcp_mgrlifecycle) +server-tools.cpp(tools.setup(..., mcp_mgr)/server_mcp::call_tool) — both already compiled intojllama— now referenceserver_mcp, but the file was missing from the CMaketarget_sources. A Linux.sotolerates undefined symbols (why the local build and Linux CI "passed"); macOS/ld64 and Windows/MSVC hard-error. Fix: addserver-mcp.cppto the non-Androidjllamablock (it shares thesubprocess.h/posix_spawn_*Android guard). Not added tojllama_test(which links neitherserver.cppnorserver-tools.cpp).posix_spawn_file_actions_addchdir_npundeclared on manylinux2014 (glibc 2.17). b10154's vendoredsubprocess.hcalls it (glibc ≥ 2.29 / bionic API ≥ 34 / macOS ≥ 10.15) but guards it only for macOS. Fix: patch0009adds aSUBPROCESS_HAVE_ADDCHDIR_NPprobe (__GLIBC_PREREQ, nested underdefined(__GLIBC__)) that falls back toENOSYSon old glibc — this build never spawns with a cwd. Android already compiles it (the__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__macro).server-tools.cppembeds a U+2192 (→) in a narrow literal; MSVC/clang-cl warn and mangle it under code page 1252. Fix:/utf-8scoped tojllama(gated onMSVC) — Microsoft's documented C4566 fix. No upstream source touched.Test plan
cmakeconfigure (fail-loud patch applier + OuteTTS generator) passesjllamabuild links;nmconfirmsserver_mcp::{start,shutdown,call_tool,list_tools}are now defined (T) (were undefined on macOS/Windows)server-mcp.cppand the latent-on-Linux / hard-error-on-mac-win link trap)Related issues / PRs
Follow-up to #364 (b10154 upgrade).
Checklist
Generated by Claude Code