Skip to content

feat(mcpx): ship static container build + tier-2 container legs (#1987) - #2705

Merged
dezren39 merged 3 commits into
mainfrom
queue/3283-1987-static-container
Oct 30, 2026
Merged

dezren39 merged 3 commits into
mainfrom
queue/3283-1987-static-container

Conversation

@dezren39

@dezren39 dezren39 commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Implements the #1987 follow-up packet (task 3283; triage 2892):

1. Containerfile ships/tests a static mcpx. ARG CGO_ENABLED default flips 1 → 0 (the build #182 measured end-to-end but left as "a goal, not a state"), and the build now fails if the binary doesn't record the CGO_ENABLED it was built with (go version -m assertion). --build-arg CGO_ENABLED=1 still gives the old glibc build.

2. Static-artifact policy recorded in docs/container.md §4: nix package and the container binary ship static; the image as a whole does not (bun is a dynamic distribution binary — the runtime stage is Debian for bun now, not for mcpx); the release tarball is #1881's call, with this policy as its input.

3. Tier-2 container legs wired as pkgs/mcpx/scripts/tier2-containers.sh + new workflow .github/workflows/mcpx-tier2-containers.yml (push-to-main on pkgs/mcpx/**, nightly, dispatch — tier 2 never gates PRs). Legs: alpine non-exec, alpine + bun-musl exec, FROM scratch non-exec, distroless-static non-exec, distroless/cc + deno exec. Non-exec legs assert mcpx's clean "no usable JavaScript runtime" refusal rather than skipping.

Verification (laptop, docker — PR-head CI no longer exists under the main-only model):

  • scripts/tier2-containers.sh all legs passed (binary: statically linked, CGO_ENABLED=0)
  • Shipped image builds; ldd /usr/local/bin/mcpx → "not a dynamic executable"; --version → mcpx 0.1.0

Deferred with reason (also recorded on #1987 and in docs §4): the alpine + nodejs exec leg — mcpx's node path dies with ERR_NO_TYPESCRIPT under Alpine's nodejs build. Filed as #2699 with repro and acceptance; the leg joins the matrix when that is fixed.

Refs #1987 (issue stays open for its tier-3 remainder: fedora/flatpak/silverblue/Windows are separate issues when wanted).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Containerfile now defaults CGO_ENABLED=0 (the static build #182 measured but left as a goal) and fails the build if the binary does not record the CGO_ENABLED it was built with. docs/container.md section 4 becomes the static-artifact policy record: nix package and container binary ship static, the image as a whole does not (bun is dynamic), release tarball left to #1881.

Tier-2 legs (scripts/tier2-containers.sh, run nightly + on main by the new mcpx-tier2-containers workflow): alpine non-exec, alpine + bun-musl exec, scratch non-exec, distroless-static non-exec, distroless/cc + deno exec. Non-exec legs assert mcpxs clean no-usable-runtime refusal. All five legs verified locally with docker, plus the shipped image (ldd: not a dynamic executable).

Deferred with reason: alpine + nodejs exec — mcpxs node path dies with ERR_NO_TYPESCRIPT under Alpines nodejs build; filed as #2699 and recorded in docs/container.md section 4.
@dezren39
dezren39 requested a review from a team as a code owner October 30, 2026 11:10
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ccfb46ce-cf95-450b-9a51-93a32963141e
Commits

Reviewing files that changed from the base of the PR and between d52fe3a and 8c77cf5.

Files selected for processing: 4
  • .github/workflows/mcpx-tier2-containers.yml
  • pkgs/mcpx/Containerfile
  • pkgs/mcpx/docs/container.md
  • pkgs/mcpx/scripts/tier2-containers.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T13:44:25.070735Z 8c77cf5 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ce1dd89ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +42 to +43
docker run --rm --entrypoint sh mcpx-tier2-image \
-c 'ldd /usr/local/bin/mcpx' | grep -q 'not a dynamic executable'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle ldd's expected failure when checking a static binary

For the intended static mcpx artifact, glibc's ldd writes not a dynamic executable to stderr and exits 1; its implementation explicitly redirects the diagnostic with >&2 and sets result=1, which I also reproduced locally with a static ELF binary. This pipeline only sends stdout to grep, so the shipped-image verification job fails even when the build is correct and never reaches --version. Capture stderr and handle the expected nonzero status before asserting the diagnostic; redirecting stderr alone would still fail under the workflow shell's pipefail behavior.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the follow-up commit just pushed. The shipped-image check no longer pipes ldd into grep: it captures the docker run output (with ldd stderr redirected inside the container and the expected exit 1 tolerated via || true) and asserts on the captured text, so pipefail cannot fail the step for the static success case. The --version run that follows is unchanged.

@dezren39
dezren39 merged commit 9ffa739 into main Oct 30, 2026
5 checks passed
@dezren39
dezren39 deleted the queue/3283-1987-static-container branch October 30, 2026 13:56
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.

1 participant