Skip to content

[examples] Unable to include 2.0.0 dependency with version number #568

@everyplace

Description

@everyplace

Expected behavior

In the examples, version 2.0.0 of the library is suggested to be included as a dependency, for example in the ApiGateway example. As of the date of this issue, this version does not yet exist, as the latest is currently 2.0.0-rc1. Using this non-semver identifier hasn't worked for me though, so I've had to use a revision to get the dependency to build correctly:

dependencies[
        // Use the hash that corresponds to 2.0.0-rc1
        .package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", revision: "a1ab8df"),
]

I'm sure this is just a bad timing issue on my part, as the release notes for rc1 suggest that it will be the one released, but thought I should at least post the workaround in case others run into this issue.

Actual behavior

dependencies[
        // Use the from parameter
        .package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
]

Steps to reproduce

  1. Include the library with `from: "2.0.0"
  2. Attempt to build the library

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

// swift-tools-version:6.2

// From https://github.com/swift-server/swift-aws-lambda-runtime/blob/main/Examples/APIGateway/Package.swift

import PackageDescription

// needed for CI to test the local version of the library
import struct Foundation.URL

let package = Package(
    name: "swift-aws-lambda-runtime-example",
    platforms: [.macOS(.v15)],
    products: [
        .executable(name: "APIGatewayLambda", targets: ["APIGatewayLambda"])
    ],
    dependencies: [
        // during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
        .package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
        .package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.0.0"),
    ],
    targets: [
        .executableTarget(
            name: "APIGatewayLambda",
            dependencies: [
                .product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
                .product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"),
            ],
            path: "Sources"
        )
    ]
)

What version of this project (swift-aws-lambda-runtime) are you using?

2.0.0-rc1

Swift version

swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1)
Target: arm64-apple-macosx26.0
Darwin studio-26.local 25.0.0 Darwin Kernel Version 25.0.0: Mon Aug 25 21:16:39 PDT 2025; root:xnu-12377.1.9~3/RELEASE_ARM64_T6031 arm64

Amazon Linux 2 docker image version

No response

Metadata

Metadata

Assignees

Labels

kind/bugFeature doesn't work as expected.

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions