Skip to content

fix(seed): fix WireMock on arm64 and restore docker compose in seed images - #18437

Merged
deep-gandhii merged 6 commits into
mainfrom
fix/seed-wiremock-platform
Oct 22, 2026
Merged

deep-gandhii merged 6 commits into
mainfrom
fix/seed-wiremock-platform

Conversation

@deep-gandhii

@deep-gandhii deep-gandhii commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Two problems in the seed images break go/php/python seed tests on arm64, and the go one blocks moving go-sdk off its old image. Neither shows up in Fern's CI today: it runs on x86, and go-sdk/go-model still pin the March fernapi/go-seed:2.0.0.

1. WireMock is always amd64. The seed images fetch WireMock with crane pull wiremock/wiremock:3.9.1 /wiremock.tar. crane pull defaults to linux/amd64, so the arm64 images bundle an amd64 WireMock, and wire tests fail when it starts:

wiremock The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
container wiremock-wiremock-1 exited (255)

2. The current go seed image has no docker compose. Dockerfile.go deleted all docker CLI plugins as unused, but the go-sdk seed test script starts WireMock with docker compose -p … -f wiremock/docker-compose.test.yml. On the current fernapi/go-seed image that fails with unknown shorthand flag: 'p' in -p. Dockerfile.php and Dockerfile.python already rebuild compose and keep it.

Changes Made

  • docker/seed/Dockerfile.{go,php,python}:
    • crane pull --platform "linux/${TARGETARCH}" (BuildKit's target arch; fails the build if unset). uname -m is only used for the crane download.
    • Fail the build if docker compose is missing (docker compose version after dropping buildx).
  • docker/seed/Dockerfile.go:
    • Rebuild docker-compose v5.1.4 from source the same way as Dockerfile.php, and only drop buildx. The /usr/local/bin/docker-compose symlink (to the plugin) now stays, like php/python.
    • Save compose's module list to /usr/share/doc/docker-compose/buildinfo.txt before stripping .go.buildinfo, so its dependency versions stay inspectable; the comment no longer claims those deps are all patched.
  • Updated README.md generator (if applicable)

The Go part is groundwork. go-sdk and go-model pin go-seed:2.0.0, which seed-dockers.yml never rebuilds, so the go changes only take effect once the pin moves. Follow-ups:

  1. fix(go): use reflect.Pointer instead of deprecated reflect.Ptr #18440 fixes the reflect.Ptr lint failures that the newer go image's golangci-lint reports in the Go generator's output.
  2. After this merges and seed-dockers.yml publishes the new image, a one-line PR moves go-sdk/go-model to the immutable fernapi/go-seed:<sha> tag (not latest), so seed runs stay reproducible.

Testing

  • Unit tests added/updated
  • Full image builds (docker buildx build --platform …) of all three Dockerfiles at this commit, then checked uname -m, docker compose version, and the architecture in /wiremock.tar's image config:
Image linux/amd64 (GitHub x86 runner) linux/arm64 (Apple Silicon, native)
go ✅ 537s · x86_64 · Compose v5.1.4 · WireMock amd64 ✅ 347s · aarch64 · Compose v5.1.4 · WireMock arm64
php ✅ 445s · x86_64 · Compose v5.1.4 · WireMock amd64 ✅ 23s* · aarch64 · Compose v5.1.4 · WireMock arm64
python ✅ 363s · x86_64 · Compose v5.1.4 · WireMock amd64 ✅ 21s* · aarch64 · Compose v5.1.4 · WireMock arm64

* reused layers from the go build. The go image's buildinfo.txt lists 124 compose deps. Before this PR, the arm64 images' /wiremock.tar was amd64 and fernapi/go-seed:latest had no compose (docker: unknown command: docker compose).

The rebuilt images only get published after merge (seed-dockers.yml runs on pushes to main that touch docker/seed/*).

Generated with Claude Code

`crane pull` defaults to linux/amd64, so the arm64 go/php/python seed
images bundle an amd64 WireMock in /wiremock.tar. On arm64 hosts the
wire-test WireMock container exits immediately ("requested image's
platform (linux/amd64) does not match the detected host platform").
Pass --platform for the architecture the stage is built for.

Co-Authored-By: Claude <noreply@anthropic.com>
@deep-gandhii deep-gandhii self-assigned this Oct 21, 2026

@nitpickybot nitpickybot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Review Summary

The change passes --platform linux/<arch> to crane pull so arm64 seed images bundle an arm64 WireMock. Logic is correct and identical across the three Dockerfiles; the only nit is that PLATFORM_ARCH duplicates the already-normalized ARCH.

  • 🔵 1 suggestion(s)

Review Scope

  • Mode: Full pull request
  • Range: Full pull request through 075c9e4073c452bd3f5d90e1286425bb9b073d16
  • Current range coverage: Complete
  • Cumulative pull request coverage: Complete

This review is complete for the current scope. Addressing all critical and warning findings above satisfies the review; suggestions are optional. Request another review only if subsequent changes introduce new behavior or materially expand the pull request's scope.

Comment thread docker/seed/Dockerfile.go Outdated

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

go-sdk and go-model pin fernapi/go-seed:2.0.0 (March), whose arm64 image
installs the linux-amd64 Go tarball, so build scripts fail on arm64 with
`exec format error`. Dockerfile.go has installed Go per architecture since,
but the pin never moved. Use fernapi/go-seed without a tag, like the other
seed images, so go-sdk also picks up the WireMock platform fix once
go-seed is republished. This moves Go 1.23.8 -> 1.26.4 and golangci-lint
v2.10.1 -> v2.12.2 for the go seed scripts.

Co-Authored-By: Claude <noreply@anthropic.com>
@deep-gandhii deep-gandhii changed the title fix(seed): pull WireMock for the target platform in seed images fix(seed): make go/php/python seed images work on arm64 Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against main baseline.

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
go-sdk square N/A N/A 150s N/A
php-sdk square N/A N/A 79s N/A
python-sdk square N/A N/A 150s N/A

main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via fern generate). main (E2E): full customer-observable time including build/test scripts (nightly baseline, informational). Delta is computed against generator-only baseline.
⚠️ = generation exited with a non-zero exit code (timing may not reflect a successful run).
Last updated: 2026-10-22 16:17 UTC

…del"

This reverts commit c79eeab. go-seed:latest's Go 1.26 / golangci-lint
v2.12 flag `reflect.Ptr` (govet inline) in the Go generator's as-is files,
failing every go-sdk fixture. Moving the image together with the generator
fix in a separate PR.

Co-Authored-By: Claude <noreply@anthropic.com>
@deep-gandhii deep-gandhii changed the title fix(seed): make go/php/python seed images work on arm64 fix(seed): pull WireMock for the target platform in seed images Oct 21, 2026
Dockerfile.go deletes all docker CLI plugins as unused, but the go-sdk
seed test script starts WireMock with `docker compose -p ...`. With the
current go-seed image that fails ("unknown shorthand flag: 'p' in -p"),
which went unnoticed because go-sdk still pins go-seed:2.0.0. Rebuild
docker-compose from source and keep it, the same way Dockerfile.php and
Dockerfile.python do, and only drop buildx.

Co-Authored-By: Claude <noreply@anthropic.com>
deep-gandhii added a commit that referenced this pull request Oct 21, 2026
The current fernapi/go-seed image has no docker compose plugin, so go-sdk
wire-test scripts fail on it. #18437 restores compose (and
fixes WireMock on arm64); move the pin after that image is published.
This PR keeps just the reflect.Pointer fix, which also passes on 2.0.0.

Co-Authored-By: Claude <noreply@anthropic.com>
@deep-gandhii deep-gandhii changed the title fix(seed): pull WireMock for the target platform in seed images fix(seed): fix WireMock on arm64 and restore docker compose in seed images Oct 21, 2026
Comment thread docker/seed/Dockerfile.go
Comment thread docker/seed/Dockerfile.go
Comment thread docker/seed/Dockerfile.go Outdated
Comment thread docker/seed/Dockerfile.go Outdated
- Use BuildKit's TARGETARCH for `crane pull --platform` instead of mapping
  `uname -m` (fails the build if unset, rather than silently picking amd64).
- Fail the build if `docker compose` is missing, in all three images.
- Go image: keep the /usr/local/bin/docker-compose symlink like php/python.
- Go image: save compose's module list to
  /usr/share/doc/docker-compose/buildinfo.txt before stripping
  .go.buildinfo, and stop claiming its deps are all patched.
- Note that go-sdk/go-model still pin go-seed:2.0.0.

Co-Authored-By: Claude <noreply@anthropic.com>
@deep-gandhii
deep-gandhii merged commit fdc792d into main Oct 22, 2026
105 checks passed
@deep-gandhii
deep-gandhii deleted the fix/seed-wiremock-platform branch October 22, 2026 16:26
deep-gandhii added a commit that referenced this pull request Oct 22, 2026
* fix(go): use reflect.Pointer instead of deprecated reflect.Ptr

Go 1.26's govet `inline` analyzer (golangci-lint v2.12) flags the
deprecated `reflect.Ptr` alias in the Go generator's as-is files
("Constant reflect.Ptr should be inlined"), so every go-sdk fixture fails
its lint script on the current fernapi/go-seed image. Rename it to
`reflect.Pointer` (Go 1.18+, which generated SDKs already require) in the
v1 embedded files and v2 as-is templates, and update the generator
testdata and seed snapshots to match.

With that, move go-sdk and go-model off the March fernapi/go-seed:2.0.0
pin, whose arm64 image installs the linux-amd64 Go tarball, to the current
fernapi/go-seed image like the other seed generators.

Co-Authored-By: Claude <noreply@anthropic.com>

* chore(seed): keep go-seed:2.0.0 until the go seed image is republished

The current fernapi/go-seed image has no docker compose plugin, so go-sdk
wire-test scripts fail on it. #18437 restores compose (and
fixes WireMock on arm64); move the pin after that image is published.
This PR keeps just the reflect.Pointer fix, which also passes on 2.0.0.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
deep-gandhii added a commit that referenced this pull request Oct 22, 2026
Move off fernapi/go-seed:2.0.0 (March), whose arm64 image installs the
linux-amd64 Go tarball, to fernapi/go-seed:fdc792df0, built from #18437
(arm64 WireMock, docker compose kept). #18440 already fixed the reflect.Ptr
lint findings the newer golangci-lint reports. Uses the immutable build tag
rather than `latest` so seed runs stay reproducible.

Co-authored-by: Claude <noreply@anthropic.com>
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.

3 participants