From 8353aeda9c1972c67d40d80d90a21f2fe2b60a9e Mon Sep 17 00:00:00 2001 From: Valeriy Van Date: Sun, 12 May 2024 22:15:41 +0300 Subject: [PATCH 1/2] Fix availability message (#3191) --- Sources/Vapor/Application.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Vapor/Application.swift b/Sources/Vapor/Application.swift index 1303decf5c..36e51da519 100644 --- a/Sources/Vapor/Application.swift +++ b/Sources/Vapor/Application.swift @@ -114,7 +114,7 @@ public final class Application: Sendable { private let _lifecycle: NIOLockedValueBox private let _locks: NIOLockedValueBox - @available(*, noasync, message: "This initialiser cannot be used in async contexts, Application.makeApplication() instead") + @available(*, noasync, message: "This initialiser cannot be used in async contexts, use Application.make(_:_:) instead") public convenience init( _ environment: Environment = .development, _ eventLoopGroupProvider: EventLoopGroupProvider = .singleton From d9fa0d3f7831ae055077fbcc166eb8baa94a19d0 Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Sun, 12 May 2024 23:54:17 +0100 Subject: [PATCH 2/2] Support compiling against Musl (#3188) Vapor already makes some provision for compiling against Musl in the RFC1123 implementation, where `Glibc` is not assumed and is imported conditionally alongside a conditional import of `Musl`. However, there are a couple of other places where `Glibc` is still assumed when compiling for Linux. This patch replaces these imports with the same `#if canImport(...)` pattern. Co-authored-by: Tim Condon <0xTim@users.noreply.github.com> --- Sources/Vapor/Utilities/DirectoryConfiguration.swift | 4 +++- Sources/Vapor/Utilities/DotEnv.swift | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/Vapor/Utilities/DirectoryConfiguration.swift b/Sources/Vapor/Utilities/DirectoryConfiguration.swift index ce882f53f4..d40bdc6b7d 100644 --- a/Sources/Vapor/Utilities/DirectoryConfiguration.swift +++ b/Sources/Vapor/Utilities/DirectoryConfiguration.swift @@ -1,5 +1,7 @@ -#if os(Linux) +#if canImport(Glibc) import Glibc +#elseif canImport(Musl) +import Musl #else import Darwin.C #endif diff --git a/Sources/Vapor/Utilities/DotEnv.swift b/Sources/Vapor/Utilities/DotEnv.swift index a9ff47966d..e03774436c 100644 --- a/Sources/Vapor/Utilities/DotEnv.swift +++ b/Sources/Vapor/Utilities/DotEnv.swift @@ -1,5 +1,7 @@ -#if os(Linux) +#if canImport(Glibc) import Glibc +#elseif canImport(Musl) +import Musl #else import Darwin #endif