Skip to content

Commit 2f31557

Browse files
committed
Clean up dependency graph and imports
Motivation: AWSLambdaRuntimeCore and MockServer both have dependencies on the NIO module, but they don't express this in their Package.swift: they implicitly rely on these dependencies being met by the NIOHTTP1 import. This was always brittle: it could lead to timing issues in the build that could lead to it failing. Modifications: - Correctly express the dependency on NIO in Package.swift - Correctly import _NIOConcurrency in files where it's used Result: Better and more accurate builds.
1 parent 774bbf1 commit 2f31557

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Package.swift

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ let package = Package(
2929
.product(name: "Logging", package: "swift-log"),
3030
.product(name: "Backtrace", package: "swift-backtrace"),
3131
.product(name: "NIOHTTP1", package: "swift-nio"),
32+
.product(name: "NIO", package: "swift-nio"),
3233
.product(name: "_NIOConcurrency", package: "swift-nio"),
3334
]),
3435
.testTarget(name: "AWSLambdaRuntimeCoreTests", dependencies: [
@@ -51,6 +52,7 @@ let package = Package(
5152
// for perf testing
5253
.target(name: "MockServer", dependencies: [
5354
.product(name: "NIOHTTP1", package: "swift-nio"),
55+
.product(name: "NIO", package: "swift-nio"),
5456
]),
5557
.target(name: "StringSample", dependencies: ["AWSLambdaRuntime"]),
5658
.target(name: "CodableSample", dependencies: ["AWSLambdaRuntime"]),

Sources/AWSLambdaRuntimeCore/LambdaHandler.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import Dispatch
1616
import NIO
17+
import _NIOConcurrency
1718

1819
// MARK: - LambdaHandler
1920

0 commit comments

Comments
 (0)