Skip to content

Commit 872183b

Browse files
authored
allow compilation with the static linux sdk (musl) (#331)
1 parent 0d4716d commit 872183b

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

Diff for: Package.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ let package = Package(
2121
.library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]),
2222
],
2323
dependencies: [
24-
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.43.1")),
25-
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.2")),
24+
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.67.0")),
25+
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.5.4")),
2626
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
2727
],
2828
targets: [

Diff for: Plugins/AWSLambdaPackager/Plugin.swift

+9-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,16 @@ import Dispatch
1616
import Foundation
1717
import PackagePlugin
1818

19-
#if canImport(Glibc)
19+
#if os(macOS)
20+
import Darwin
21+
#elseif canImport(Glibc)
2022
import Glibc
23+
#elseif canImport(Musl)
24+
import Musl
25+
#elseif os(Windows)
26+
import ucrt
27+
#else
28+
#error("Unsupported platform")
2129
#endif
2230

2331
@main

Diff for: Sources/AWSLambdaRuntimeCore/Lambda.swift

+8-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if os(Linux)
15+
#if os(macOS)
16+
import Darwin.C
17+
#elseif canImport(Glibc)
1618
import Glibc
19+
#elseif canImport(Musl)
20+
import Musl
21+
#elseif os(Windows)
22+
import ucrt
1723
#else
18-
import Darwin.C
24+
#error("Unsupported platform")
1925
#endif
2026

2127
#if swift(<5.9)

0 commit comments

Comments
 (0)