Build Linux MCP executable with static musl#859
Draft
st0012 wants to merge 1 commit into
Draft
Conversation
6575940 to
cd7db94
Compare
cd7db94 to
31931ef
Compare
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
This prototypes building the packaged
rubydex_mcpexecutable as a fully static musl binary for Linux precompiled gem builds.The Ruby native extension keeps using the normal platform-specific build path. Only the standalone MCP executable is cross-built to musl during
RELEASE=trueLinux packaging, then verified before it is copied into the gem.Why
A standalone Linux executable can fail to start on environments that do not provide the dynamic loader path baked into the binary. For the MCP server, we can avoid that class of startup failure by packaging a fully static executable with no ELF interpreter segment.
This is intentionally narrower than full musl support for the Ruby native extension. The extension is loaded by a running Ruby process and has different platform constraints.
What changed
musl-toolsand the matching Rust musl target in Linux cibuildgem compile jobs.Rubydex::MCPExecutableBuildto choose the MCP executable target and build command.PT_INTERPentry before packaging it.Testing
shadowenv exec -- ruby -Itest -Ilib test/mcp_executable_build_test.rbshadowenv exec -- bundle exec rubocop ext/rubydex/extconf.rb lib/rubydex/mcp_executable_build.rb test/mcp_executable_build_test.rbgit diff --check -- .github/workflows/cibuildgem.yaml ext/rubydex/extconf.rb lib/rubydex/mcp_executable_build.rb test/mcp_executable_build_test.rbNotes
This is a draft PR to let CI prove whether the Linux packaging job can produce the fully static MCP artifact. If CI passes, the next useful check is to test the CI-built gem or executable artifact in a target environment without publishing a release.