Skip to content

Package *.bundle resource bundles produced by Swift 6.4 - #703

Merged
sebsto merged 3 commits into
mainfrom
fix/resources-bundle-swift-6.4
Oct 30, 2026
Merged

sebsto merged 3 commits into
mainfrom
fix/resources-bundle-swift-6.4

Conversation

@sebsto

@sebsto sebsto commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Fixes #702

lambda-build left resource bundles out of the ZIP and OCI image when building with Swift 6.4, which swift:amazonlinux2023 now ships. Swift 6.4 builds with Swift Build by default, and Swift Build names the bundle <Package>_<Target>.bundle on Linux instead of .resources. Both archive backends only copied .resources, so functions using Bundle.module crashed at runtime. CI caught it on the ResourcesPackaging example.

Changes

  • ZipArchiveBackend and OCIArchiveBackend now copy both *.resources and *.bundle directories found next to the built executable.

Testing

  • Ran lambda-build --cross-compile container --base-docker-image swift:amazonlinux2023 (Swift 6.4.1) on Examples/ResourcesPackaging against the local checkout. The ZIP now contains ResourcesPackaging_MyLambda.bundle/hello.txt.
  • swift test --filter ArchiveBackend passes.

🤖 Generated with Claude Code

Swift 6.4 builds with Swift Build by default, which names resource
bundles `<Package>_<Target>.bundle` instead of `.resources` on Linux.
The ZIP and OCI archive backends only copied `.resources` directories,
so functions using `Bundle.module` crashed at runtime.

Fixes #702

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sebsto sebsto added the 🔨 semver/patch No public API change. label Oct 30, 2026
@sebsto sebsto self-assigned this Oct 30, 2026
sebsto and others added 2 commits October 30, 2026 11:07
Lays out a fake build directory with a resource bundle and a decoy build
artifact, and checks both the ZIP and OCI backends copy the bundle (for
the native `.resources` and Swift Build `.bundle` names) but not the decoy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sebsto
sebsto merged commit 57ccd69 into main Oct 30, 2026
53 checks passed
@sebsto
sebsto deleted the fix/resources-bundle-swift-6.4 branch October 30, 2026 10:37
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.

lambda-build drops resource bundles when building with Swift 6.4

1 participant