Skip to content

Commit

Permalink
Clean up dependency graph and imports
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Lukasa committed Aug 13, 2021
1 parent 774bbf1 commit 2f31557
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ let package = Package(
.product(name: "Logging", package: "swift-log"),
.product(name: "Backtrace", package: "swift-backtrace"),
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "NIO", package: "swift-nio"),
.product(name: "_NIOConcurrency", package: "swift-nio"),
]),
.testTarget(name: "AWSLambdaRuntimeCoreTests", dependencies: [
Expand All @@ -51,6 +52,7 @@ let package = Package(
// for perf testing
.target(name: "MockServer", dependencies: [
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "NIO", package: "swift-nio"),
]),
.target(name: "StringSample", dependencies: ["AWSLambdaRuntime"]),
.target(name: "CodableSample", dependencies: ["AWSLambdaRuntime"]),
Expand Down
1 change: 1 addition & 0 deletions Sources/AWSLambdaRuntimeCore/LambdaHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import Dispatch
import NIO
import _NIOConcurrency

// MARK: - LambdaHandler

Expand Down

0 comments on commit 2f31557

Please sign in to comment.