Skip to content

[plugin] LocalDebugging example - archive fails because of Shared code #276

Closed
@sebsto

Description

@sebsto

Expected behavior

I expect the archive plugin to package the MyLambda function part of the Examples/Localdebugging
The archive command fails because part of the MyLambda function relies on Shared code which is not under MyLambda directory.

Actual behavior

The archive fails because the Lambda function relies on shared code outside of the MyLambda directory structure.

 swift package --disable-sandbox archive --verbose 1 --output-path dist                    
-------------------------------------------------------------------------
configuration
-------------------------------------------------------------------------
{
  outputDirectory: dist
  products: ["MyLambda"]
  buildConfiguration: release
  baseDockerImage: swift:amazonlinux2
}
-------------------------------------------------------------------------
building "mylambda" in docker
-------------------------------------------------------------------------
updating "swift:amazonlinux2" docker image
  amazonlinux2: Pulling from library/swift
  Digest: sha256:0b645a7589aa5f1759f976c42a9ffba48fd930b27b3481b0ab32e271e701d444
  Status: Image is up to date for swift:amazonlinux2
  docker.io/library/swift:amazonlinux2
/usr/local/bin/docker run --rm -v /Users/stormacq/Documents/amazon/code/lambda/swift/swift-aws-lambda-runtime/Examples/LocalDebugging/MyLambda:/workspace -w /workspace swift:amazonlinux2 bash -cl swift build -c release --show-bin-path
  /workspace/.build/aarch64-unknown-linux-gnu/release
building "MyLambda"
/usr/local/bin/docker run --rm -v /Users/stormacq/Documents/amazon/code/lambda/swift/swift-aws-lambda-runtime/Examples/LocalDebugging/MyLambda:/workspace -w /workspace swift:amazonlinux2 bash -cl swift build -c release --product MyLambda --static-swift-stdlib
  error: the package at '/Shared' cannot be accessed (Error Domain=NSCocoaErrorDomain Code=260 "The file doesn’t exist.")
error: /usr/local/bin/docker run --rm -v /Users/stormacq/Documents/amazon/code/lambda/swift/swift-aws-lambda-runtime/Examples/LocalDebugging/MyLambda:/workspace -w /workspace swift:amazonlinux2 bash -cl swift build -c release --product MyLambda --static-swift-stdlib failed with code 1

Steps to reproduce

git clone https://github.com/swift-server/swift-aws-lambda-runtime.git
cd swift-aws-lambda-runtime/Examples/LocalDebugging
swift package --disable-sandbox archive --verbose 1

If possible, minimal yet complete reproducer code (or URL to code)

see main branch of repository

SwiftAWSLambdaRuntime version/commit hash

https://github.com/swift-server/swift-aws-lambda-runtime/tree/dc64ce195b1c51356f6655935c3509e296c35696

Swift & OS version (output of swift --version && uname -a)

✗ swift --version && uname -a
swift-driver version: 1.62.15 Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51)
Target: arm64-apple-macosx13.0
Darwin bcd07458a91c 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000 arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions