Skip to content

Commit 2bcd5dd

Browse files
authored
Revert "Integration of Swift 3 Foundation changes"
1 parent 9582675 commit 2bcd5dd

File tree

7 files changed

+27
-1
lines changed

7 files changed

+27
-1
lines changed

Sources/Basic/Condition.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
import Foundation
1212

13+
// FIXME: Temporary compatibility shims.
14+
#if !os(macOS)
15+
private typealias NSCondition = Foundation.Condition
16+
#endif
17+
1318
/// A simple condition wrapper.
1419
public struct Condition {
1520
private let _condition = NSCondition()

Sources/Basic/Lock.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
import Foundation
1212

13+
// FIXME: Temporary compatibility shims.
14+
#if !os(macOS)
15+
private typealias NSLock = Foundation.Lock
16+
#endif
17+
1318
/// A simple lock wrapper.
1419
public struct Lock {
1520
private var _lock = NSLock()

Sources/Basic/Thread.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ final public class Thread {
4747
}
4848
}
4949

50-
self.thread = ThreadImpl(block: theTask)
50+
self.thread = ThreadImpl(theTask)
5151
}
5252

5353
/// Starts the thread execution.

Sources/Commands/SwiftTestTool.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,11 @@ public struct SwiftTestTool: SwiftTool {
291291

292292
// Execute the XCTest with inherited environment as it is convenient to pass senstive
293293
// information like username, password etc to test cases via enviornment variables.
294+
#if os(Linux)
295+
let result: Void? = try? system(args, environment: ProcessInfo.processInfo().environment)
296+
#else
294297
let result: Void? = try? system(args, environment: ProcessInfo.processInfo.environment)
298+
#endif
295299
return result != nil
296300
}
297301

Sources/Get/Git.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ extension Git {
2525
}
2626

2727
do {
28+
#if os(Linux)
29+
let env = ProcessInfo.processInfo().environment
30+
#else
2831
let env = ProcessInfo.processInfo.environment
32+
#endif
2933
try system(Git.tool, "clone",
3034
"--recursive", // get submodules too so that developers can use these if they so choose
3135
"--depth", "10",

Sources/SourceControl/GitRepository.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ public class GitRepositoryProvider: RepositoryProvider {
4747
do {
4848
// FIXME: We need infrastructure in this subsystem for reporting
4949
// status information.
50+
#if os(Linux)
51+
let env = ProcessInfo.processInfo().environment
52+
#else
5053
let env = ProcessInfo.processInfo.environment
54+
#endif
5155
try system(
5256
Git.tool, "clone", "--bare", repository.url, path.asString,
5357
environment: env, message: "Cloning \(repository.url)")

Sources/Utility/Git.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ public class Git {
121121
}
122122

123123
public func fetch() throws {
124+
#if os(Linux)
125+
try system(Git.tool, "-C", path.asString, "fetch", "--tags", "origin", environment: ProcessInfo.processInfo().environment, message: nil)
126+
#else
124127
try system(Git.tool, "-C", path.asString, "fetch", "--tags", "origin", environment: ProcessInfo.processInfo.environment, message: nil)
128+
#endif
125129
}
126130
}
127131

0 commit comments

Comments
 (0)