Skip to content

ci: add CGO-disabled portable SDK cross-build gate - #35

Merged
AlexStocks merged 4 commits into
mainfrom
codex/issue-33-portable-sdk
Aug 29, 2026
Merged

ci: add CGO-disabled portable SDK cross-build gate#35
AlexStocks merged 4 commits into
mainfrom
codex/issue-33-portable-sdk

Conversation

@AlexStocks

@AlexStocks AlexStocks commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add a CGO-disabled portable SDK cross-build gate for the deliberate public packages:

  • make check-portable cross-builds ./api/... ./artifact/... ./client/... ./inference/... ./openapi/... ./source/... ./trigger/... with CGO_ENABLED=0 for the exact four-platform matrix CI already uses (linux/amd64, linux/arm64, darwin/amd64, darwin/arm64)
  • a stable portable-sdk job in migration-gates.yml runs the target on every PR
  • .github/workflows/README.md documents the new gate
  • tools/release/makefile_test.go executes the real Make target through a controlled Go boundary, proving the complete matrix and that a non-final build failure stops the gate
  • AGENTS.md records the reusable failure-path verification rule for CI matrix loops

Closes #33 (extracted from #3 WP0-C: "CGO-disabled cross-builds for portable public Client, domain, and generated API packages").

Relationship to #34

#34 implements the same WP0-C item in parallel. Its current Head has evolved since this PR was opened and now also uses explicit per-iteration failure propagation, the same four-platform matrix, public-package wildcards, and ./openapi/...; those are no longer differentiators.

The remaining structural differences are:

  1. This PR is self-contained on current main and adds the job to the existing reusable migration-gates.yml; ci: verify portable public SDK builds #34 is stacked on codex/wp0-make-contract and adds a separate job directly to master.yml.
  2. This PR adds behavior-level regression tests that run the real Make target, compare the required target and package sets without order sensitivity, verify CGO_ENABLED=0, and inject a failure on the second iteration. ci: verify portable public SDK builds #34's current test checks the Makefile contract text.

Only one implementation should be retained to avoid duplicate portable SDK gates.

Behavior, API, and compatibility

  • no public API, protocol, dependency, runtime, or generated-contract changes
  • compile-only verification; does not claim Windows binary support and does not touch the CGO-required Server or persistence layer
  • all existing gates from current main remain unchanged

Validation

Current Head 2e47a463446cf044584059dad1c198c03e56d8d3:

  • make check-portable with Go 1.27 — linux/amd64, linux/arm64, darwin/amd64, and darwin/arm64 all report OK
  • Linux-amd64 tools/release test binary under WSL — portable matrix, fail-fast, Go compatibility, coverage workflow, immutable-action, and shared-Go-setup contracts pass
  • fail-fast mutation proof — removing || exit 1 makes TestCheckPortableStopsAfterTheFirstFailedBuild fail; restoring it makes the test pass
  • go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 — no findings
  • git diff --check — clean
  • exact-Head GitHub checks — 27/27 successful, including portable-sdk, tests, lint, coverage, CodeQL, race/fuzz/module integrity, SQLite/OceanBase acceptance, and four-platform Standard/Full jobs

Native Windows go test ./tools/release has three platform-specific failures that reproduce identically on origin/main (POSIX executable mode and LF-only workflow matching); they are not introduced by this PR. The exact-Head Linux/macOS CI matrix is green.

Add a make check-portable target that cross-builds the deliberate public
packages (api, artifact, client, inference, openapi, source, trigger)
with CGO_ENABLED=0 for the four-platform matrix CI already uses
(linux/amd64, linux/arm64, darwin/amd64, darwin/arm64).

Surface it as a stable portable-sdk job in migration-gates.yml so every
PR proves the public SDK surface stays CGO-free and cross-compilable.
A public package that gains a CGO dependency or platform-specific code
now fails CI instead of silently breaking pure-Go consumers.

Closes #33
AlexStocks and others added 3 commits August 29, 2026 11:33
The merge retains the published PR history while combining the Issue #33 portable SDK assurance with the lint, readonly-build, coverage, CodeQL, and documentation contracts already merged to main.

Constraint: Preserve both current main behavior and the existing check-portable workflow contract.

Rejected: Rebase or force-push | Rewriting the published PR branch is unnecessary for conflict resolution.

Confidence: high

Scope-risk: narrow

Tested: make check-portable; targeted tools/release workflow contract tests; actionlint v1.7.12; git diff --check.

Not-tested: The full tools/release package is not green on native Windows because three tests fail identically on origin/main due to POSIX executable mode and LF-only workflow matching.

Co-authored-by: OmX <omx@oh-my-codex.dev>
The release contract tests now execute the real check-portable Make target through a controlled Go boundary. They verify all four public SDK targets run without CGO and that a failure before the final target makes the gate stop with a nonzero result.

Constraint: Keep the production target and package surface unchanged while adding only discriminative regression coverage and its reusable engineering rule.

Rejected: Static Makefile string assertions | They would not prove the loop exit status or stop behavior.

Confidence: high

Scope-risk: narrow

Tested: Windows Go compile and skip path; Linux-amd64 test binary under WSL; fail-fast mutation red then restored green; make check-portable; actionlint v1.7.12; git diff --cached --check.

Not-tested: The full tools/release package is not green in the native Windows checkout because three tests fail identically on origin/main due to POSIX executable mode and LF-only workflow matching.

Co-authored-by: OmX <omx@oh-my-codex.dev>
The success-path assertion now compares target and package sets without treating their order as behavior. The failure-path probe fails on the second invocation, so it remains a non-final failure regardless of how the matrix is reordered.

Constraint: Preserve the same four targets, public package coverage, CGO assertion, and fail-fast production behavior.

Rejected: Fixed target and package ordering | Harmless reordering would create false failures and could move the injected failure to the final iteration.

Confidence: high

Scope-risk: narrow

Tested: Windows Go compile and skip path; Linux-amd64 WSL behavior tests; order-independent fail-fast mutation red then restored green; git diff --cached --check.

Not-tested: Full native Windows tools/release remains subject to the same three origin/main platform-baseline failures already documented on the PR.

Co-authored-by: OmX <omx@oh-my-codex.dev>
@AlexStocks
AlexStocks merged commit 40b20ef into main Aug 29, 2026
27 checks passed
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.

WP0-C: add CGO-disabled portable SDK cross-build gate

1 participant