Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugin] resources are not included in the zip file on Ubuntu #505

Closed
sebsto opened this issue Mar 13, 2025 · 5 comments
Closed

[plugin] resources are not included in the zip file on Ubuntu #505

sebsto opened this issue Mar 13, 2025 · 5 comments
Assignees
Labels
kind/bug Feature doesn't work as expected. platform/linux Linux platform specific issues. 🔨 semver/patch No public API change.
Milestone

Comments

@sebsto
Copy link
Contributor

sebsto commented Mar 13, 2025

When packaging an archive with resources on Ubuntu, the resources are not included in the zip file.

Steps to reproduce

Swift 6.0.3
Ubuntu 24.04

git clone https://github.com/swift-server/swift-aws-lambda-runtime.git
cd Examples/ResourcesPackaging
swift package archive --allow-network-connections docker

... redacted for brevity....

-------------------------------------------------------------------------
building "resourcespackaging" in docker
-------------------------------------------------------------------------
updating "swift:amazonlinux2" docker image
  amazonlinux2: Pulling from library/swift
  Digest: sha256:c677d67834013285ce51b1ef85e51333c621a28b77234abec33c95f8a47fe51e
Status: Image is up to date for swift:amazonlinux2
  docker.io/library/swift:amazonlinux2
building "MyLambda"
  [0/1] Planning build
  Building for production...
  [0/2] Write swift-version-24593BA9C3E375BF.txt
  Build of product 'MyLambda' complete! (3.59s)
-------------------------------------------------------------------------
archiving "MyLambda"
-------------------------------------------------------------------------
1 archive created
  * MyLambda at /home/ubuntu/swift-aws-lambda-runtime/Examples/ResourcesPackaging/.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/MyLambda/MyLambda.zip

$ unzip -l .build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/MyLambda/MyLambda.zip 
Archive:  .build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/MyLambda/MyLambda.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
 86548520  2025-03-13 19:20   bootstrap
---------                     -------
 86548520                     1 file

The zip file must contain hello.txt

@sebsto sebsto self-assigned this Mar 13, 2025
@sebsto sebsto added kind/bug Feature doesn't work as expected. 🔨 semver/patch No public API change. platform/linux Linux platform specific issues. labels Mar 13, 2025
@sebsto sebsto added this to the 2.0 milestone Mar 13, 2025
@sebsto
Copy link
Contributor Author

sebsto commented Mar 13, 2025

Initially reported by @johnmorrel
#501

@sebsto
Copy link
Contributor Author

sebsto commented Mar 13, 2025

There is an integration test that runs to test resources packaging on linux

See

if [ "$EXAMPLE" == "ResourcesPackaging" ]; then

This test succeeds
https://github.com/swift-server/swift-aws-lambda-runtime/actions/runs/13838294514/job/38718906569

The test is running on GtHub's ubuntu-latest

@sebsto
Copy link
Contributor Author

sebsto commented Mar 13, 2025

This PR will fix the CI test
#506

@sebsto
Copy link
Contributor Author

sebsto commented Mar 13, 2025

Looks like the integration test script is not detecting the error.

EXAMPLE=ResourcesPackaging .github/workflows/scripts/check-archive-plugin.sh
... redacted for brevity ...

✅ The archive plugin is OK with example ResourcesPackaging

$ unzip -l Examples/ResourcesPackaging/.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/MyLambda/MyLambda.zip

Archive:  Examples/ResourcesPackaging/.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/MyLambda/MyLambda.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
 86567320  2025-03-13 19:37   bootstrap
---------                     -------
 86567320                     1 file

@sebsto
Copy link
Contributor Author

sebsto commented Mar 13, 2025

This PR fixes the plugin and the CI script
#506

@sebsto sebsto closed this as completed in 7322a36 Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Feature doesn't work as expected. platform/linux Linux platform specific issues. 🔨 semver/patch No public API change.
Projects
None yet
Development

No branches or pull requests

1 participant