From d72d47803ac60d7e33f233a8b15ca1b259862891 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 21 Oct 2024 14:32:20 +0100 Subject: [PATCH 1/2] Make `MMIO` buildable for WASI (exclude `ShellCommand.swift`) Neither `Dispatch` nor `Process` are available for WASI. To make this module buildable, code in `ShellCommand.swift` needs to be excluded. --- Sources/MMIOUtilities/ShellCommand.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/MMIOUtilities/ShellCommand.swift b/Sources/MMIOUtilities/ShellCommand.swift index 5739d1f0..dba7d82e 100644 --- a/Sources/MMIOUtilities/ShellCommand.swift +++ b/Sources/MMIOUtilities/ShellCommand.swift @@ -9,6 +9,8 @@ // //===----------------------------------------------------------------------===// +#if !os(WASI) + import Dispatch import Foundation @@ -104,3 +106,5 @@ public func sh( return outputData.withLock { $0 }.asUTF8String() } + +#endif // !os(WASI) From 9ddc9b28901b1f6eb902529aaacaedd96fd711ed Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 21 Oct 2024 14:48:28 +0100 Subject: [PATCH 2/2] Fix linter warning --- Sources/MMIOUtilities/ShellCommand.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MMIOUtilities/ShellCommand.swift b/Sources/MMIOUtilities/ShellCommand.swift index dba7d82e..bd5b3018 100644 --- a/Sources/MMIOUtilities/ShellCommand.swift +++ b/Sources/MMIOUtilities/ShellCommand.swift @@ -107,4 +107,4 @@ public func sh( return outputData.withLock { $0 }.asUTF8String() } -#endif // !os(WASI) +#endif