Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Musl #616

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Sources/SotoCore/Credential/ConfigFileLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ import INIParser
import Logging
import NIOCore
import NIOPosix
#if os(Linux)
import Glibc
#else
import Foundation.NSString
#endif

/// Load settings from AWS credentials and profile configuration files
/// https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
Expand Down
12 changes: 8 additions & 4 deletions Sources/SotoCore/Doc/Environment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@
//
//===----------------------------------------------------------------------===//

#if os(Linux)
#if canImport(Glibc)
import Glibc
#else
#elseif canImport(Musl)
import Musl
#elseif canImport(Darwin)
import Darwin.C
#else
#error("Unsupported platform")
#endif

internal enum Environment {
internal static subscript(_ name: String) -> String? {
enum Environment {
static subscript(_ name: String) -> String? {
guard let value = getenv(name) else {
return nil
}
Expand Down
8 changes: 6 additions & 2 deletions Sources/SotoTestUtils/Environment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
//
//===----------------------------------------------------------------------===//

#if os(Linux)
#if canImport(Glibc)
import Glibc
#else
#elseif canImport(Musl)
import Musl
#elseif canImport(Darwin)
import Darwin.C
#else
#error("Unsupported platform")
#endif

internal enum Environment {
Expand Down
8 changes: 6 additions & 2 deletions Sources/SotoXML/Expat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@
// Licensed under Apache License v2.0 http://www.apache.org/licenses/LICENSE-2.0.html
//

#if os(Linux)
#if canImport(Glibc)
import Glibc
#else
#elseif canImport(Musl)
import Musl
#elseif canImport(Darwin)
import Darwin.C
#else
#error("Unsupported platform")
#endif

@_implementationOnly import CSotoExpat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
//===----------------------------------------------------------------------===//

import XCTest
#if os(Linux)
#if canImport(Glibc)
import Glibc
#elseif canImport(Musl)
import Musl
#elseif canImport(Darwin)
import Darwin.C
#else
import Darwin
#error("Unsupported platform")
#endif
@testable import SotoCore

Expand Down
Loading