Skip to content

Fix Alpine/master regression tests for ARM64 builds#446

Open
jensenbox wants to merge 1 commit intopostgis:masterfrom
closient:upstream-arm64-minimal
Open

Fix Alpine/master regression tests for ARM64 builds#446
jensenbox wants to merge 1 commit intopostgis:masterfrom
closient:upstream-arm64-minimal

Conversation

@jensenbox
Copy link
Copy Markdown

@jensenbox jensenbox commented Mar 16, 2026

This fixes the Alpine and master Dockerfile regression test failures on ARM64 that @ImreSamu identified in #393.

The problem

PostgreSQL's JIT compilation causes "stuck spinlock" crashes when the regression tests run under QEMU emulation for ARM64. The CI matrix already builds on native ubuntu-24.04-arm runners, but the Alpine and master variants fail during the regression test phase.

The fix

Disable JIT during the regression test database startup by passing --jit=off to pg_ctl:

-    && su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start '
+    && su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start '

This only affects the build-time regression tests — JIT remains enabled in the final running image.

Applied to both templates and all generated Dockerfiles (11 files, same single-line change).

Testing

  • All stable builds pass on both amd64 and arm64 runners (26/26)
  • PostGIS spatial queries verified on native Apple Silicon Mac

Fixes #393
Refs #216, #387

@jensenbox jensenbox force-pushed the upstream-arm64-minimal branch from c0cdad5 to 78b87c6 Compare March 16, 2026 21:27
Copy link
Copy Markdown

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

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: c0cdad5da4

ℹ️ 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 thread .github/workflows/main.yml Outdated
ver=$(dirname "$dir")
echo "==> Creating manifest for ${REPO}:${ver}"
docker manifest create "${REPO}:${ver}" \
"${REPO}:${ver}-amd64" "${REPO}:${ver}-arm64" || true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fail CI when multi-arch manifest creation fails

This || true masks registry and tagging errors, so the release workflow can report success even when a manifest was not actually created or updated; for example, the loop iterates every */Dockerfile version but not every one of those tags is guaranteed to have both -amd64 and -arm64 images available, which means users can keep pulling stale/single-arch tags without any signal in CI.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good callout. The || true is intentional here because master builds use continue-on-error: true — they build from git HEAD and can fail on one or both architectures. Without || true, a single master build failure would stop the loop and prevent manifests from being created for all the stable versions that did build successfully.

That said, I could tighten this up by failing on stable versions and only tolerating errors on master. Something like:

for dir in */Dockerfile; do
  ver=$(dirname "$dir")
  # master builds are best-effort (continue-on-error in build job)
  fail_ok=false
  [[ "$ver" == *-master ]] && fail_ok=true

  docker manifest create ... || $fail_ok
  docker manifest push ... || $fail_ok
done

Would that be preferred, or is the current approach acceptable given that manifest creation only fails when the arch-tagged images don't exist (which means the build already failed)?

Disable PostgreSQL JIT compilation during the PostGIS regression test
phase in Alpine and master Dockerfiles. JIT causes "stuck spinlock"
crashes when building under QEMU emulation for ARM64.

The CI matrix already builds and tests on native ARM64 runners
(ubuntu-24.04-arm), and this fix allows those builds to pass
consistently.

Fixes postgis#393
Refs postgis#216
@jensenbox jensenbox force-pushed the upstream-arm64-minimal branch from 78b87c6 to a3a70ae Compare March 16, 2026 21:37
@jensenbox jensenbox changed the title Add multi-architecture support (amd64 + arm64) Fix Alpine/master regression tests for ARM64 builds Mar 16, 2026
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.

17-3.5/alpine/Dockerfile cannot build with arm64 ( QEMU/BUILDX )

1 participant