Skip to content

Commit 6ed1760

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 6ed1760

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
@@ -12,6 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15+
import _NIOConcurrency
1516
import Dispatch
1617
import NIO
1718

0 commit comments

Comments
 (0)