Skip to content

[plugin] Enforce build/deploy architecture consistency (#683)#688

Merged
sebsto merged 2 commits into
mainfrom
fix/plugin-architecture-consistency-683
Jul 1, 2026
Merged

[plugin] Enforce build/deploy architecture consistency (#683)#688
sebsto merged 2 commits into
mainfrom
fix/plugin-architecture-consistency-683

Conversation

@sebsto

@sebsto sebsto commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Fixes #683

Description of changes

lambda-build and lambda-deploy could independently choose the target architecture, so a user could build an arm64 binary and deploy a function declaring x64 (or the reverse). The deploy "succeeded" but the function was broken at invoke time, with no error at build or deploy.

The OCI PR (#687) introduced the build-manifest.json hand-off but only wired the architecture into the image deploy path. This PR closes the underlying latent bug for the ZIP path and makes a mismatch impossible to deploy silently.

lambda-build

  • Adds --architecture <x64|arm64> (default: host).
  • The flag actually drives the build: the container is run/pulled/built for that platform (docker --platform linux/<arch>, Apple container --arch <arch>), so the produced binary matches what the manifest records. The CLI-specific spelling lives in each ContainerCLI implementation.
  • Both ZIP and OCI backends record the real architecture in build-manifest.json (ZIP previously hardcoded .host).
  • A native (Amazon Linux host) build rejects an explicit cross-architecture request, since it can only target the host and would otherwise record a mismatched architecture.

lambda-deploy

  • When --architecture is omitted, deploy adopts the architecture recorded in the manifest instead of independently re-defaulting to the host.
  • When --architecture is passed and disagrees with the built artifact, deploy fails fast with a descriptive error rather than creating a broken function.
  • No manifest (legacy archive output, or --input-directory) falls back to the previous behavior; --architecture remains the way to declare the arch there.

Docs & tests

  • Documents the flag and the build→deploy hand-off in the DocC articles.
  • Adds unit tests for arg parsing, backend threading, the updated CLI argv, and the deploy-side reconciliation (match / mismatch / omitted / no-manifest).

New/existing dependencies impact assessment, if applicable

No new dependencies.

Conventional Commits

fix: enforce architecture consistency between lambda-build and lambda-deploy

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sebsto sebsto added the 🔨 semver/patch No public API change. label Jul 1, 2026
@sebsto sebsto self-assigned this Jul 1, 2026
@sebsto sebsto force-pushed the fix/plugin-architecture-consistency-683 branch from edc647c to d52a3db Compare July 1, 2026 05:08
@sebsto sebsto merged commit 831fa0e into main Jul 1, 2026
103 of 104 checks passed
@sebsto sebsto deleted the fix/plugin-architecture-consistency-683 branch July 1, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plugin] lambda-build and lambda-deploy can disagree on target architecture (latent broken-function bug)

1 participant