Skip to content

Commit 80bf108

Browse files
Merge branch 'main' into katei/fix-exe-prod-plugin-static
2 parents 4eab768 + b86d22e commit 80bf108

File tree

127 files changed

+4257
-1946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+4257
-1946
lines changed

CONTRIBUTORS.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ needs to be listed here.
291291
- Quinn McHenry <[email protected]>
292292
- Rahul Malik <[email protected]>
293293
- Randy Becker <[email protected]>
294-
- Rauhul Varma <rauhul@users.noreply.github.com>
294+
- Rauhul Varma <rauhul@apple.com>
295295
- Renzo Crisóstomo <[email protected]>
296296
- Rich Ellis <[email protected]>
297297
- Rick Ballard <[email protected]>

Package.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ let package = Package(
177177
"SPMBuildCore",
178178
],
179179
exclude: ["CMakeLists.txt"],
180-
swiftSettings: [.enableExperimentalFeature("AccessLevelOnImport")]
180+
swiftSettings: [
181+
.enableExperimentalFeature("AccessLevelOnImport"),
182+
]
181183
),
182184

183185
// MARK: SwiftPM specific support libraries
@@ -196,6 +198,7 @@ let package = Package(
196198
exclude: ["CMakeLists.txt", "Vendor/README.md"],
197199
swiftSettings: [
198200
.enableExperimentalFeature("StrictConcurrency"),
201+
.enableExperimentalFeature("AccessLevelOnImport"),
199202
]
200203
),
201204

Sources/Basics/Archiver/TarArchiver.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import class Dispatch.DispatchQueue
1414
import struct Dispatch.DispatchTime
1515
import struct TSCBasic.FileSystemError
16-
import class TSCBasic.Process
1716

1817
/// An `Archiver` that handles Tar archives using the command-line `tar` tool.
1918
public struct TarArchiver: Archiver {
@@ -58,7 +57,7 @@ public struct TarArchiver: Archiver {
5857
throw FileSystemError(.notDirectory, destinationPath.underlying)
5958
}
6059

61-
let process = TSCBasic.Process(
60+
let process = AsyncProcess(
6261
arguments: [self.tarCommand, "zxf", archivePath.pathString, "-C", destinationPath.pathString]
6362
)
6463

@@ -91,9 +90,10 @@ public struct TarArchiver: Archiver {
9190
throw FileSystemError(.notDirectory, directory.underlying)
9291
}
9392

94-
let process = TSCBasic.Process(
93+
let process = AsyncProcess(
9594
arguments: [self.tarCommand, "acf", destinationPath.pathString, directory.basename],
96-
workingDirectory: directory.parentDirectory.underlying
95+
environment: .current,
96+
workingDirectory: directory.parentDirectory
9797
)
9898

9999
guard let registrationKey = self.cancellator.register(process) else {
@@ -121,7 +121,7 @@ public struct TarArchiver: Archiver {
121121
throw FileSystemError(.noEntry, path.underlying)
122122
}
123123

124-
let process = TSCBasic.Process(arguments: [self.tarCommand, "tf", path.pathString])
124+
let process = AsyncProcess(arguments: [self.tarCommand, "tf", path.pathString])
125125
guard let registrationKey = self.cancellator.register(process) else {
126126
throw CancellationError.failedToRegisterProcess(process)
127127
}

Sources/Basics/Archiver/ZipArchiver.swift

+7-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import Dispatch
1414
import struct TSCBasic.FileSystemError
15-
import class TSCBasic.Process
1615

1716
/// An `Archiver` that handles ZIP archives using the command-line `zip` and `unzip` tools.
1817
public struct ZipArchiver: Archiver, Cancellable {
@@ -49,11 +48,9 @@ public struct ZipArchiver: Archiver, Cancellable {
4948
}
5049

5150
#if os(Windows)
52-
let process = TSCBasic
53-
.Process(arguments: ["tar.exe", "xf", archivePath.pathString, "-C", destinationPath.pathString])
51+
let process = AsyncProcess(arguments: ["tar.exe", "xf", archivePath.pathString, "-C", destinationPath.pathString])
5452
#else
55-
let process = TSCBasic
56-
.Process(arguments: ["unzip", archivePath.pathString, "-d", destinationPath.pathString])
53+
let process = AsyncProcess(arguments: ["unzip", archivePath.pathString, "-d", destinationPath.pathString])
5754
#endif
5855
guard let registrationKey = self.cancellator.register(process) else {
5956
throw CancellationError.failedToRegisterProcess(process)
@@ -85,10 +82,10 @@ public struct ZipArchiver: Archiver, Cancellable {
8582
}
8683

8784
#if os(Windows)
88-
let process = TSCBasic.Process(
85+
let process = AsyncProcess(
8986
// FIXME: are these the right arguments?
9087
arguments: ["tar.exe", "-a", "-c", "-f", destinationPath.pathString, directory.basename],
91-
workingDirectory: directory.parentDirectory.underlying
88+
workingDirectory: directory.parentDirectory
9289
)
9390
#else
9491
// This is to work around `swift package-registry publish` tool failing on
@@ -97,7 +94,7 @@ public struct ZipArchiver: Archiver, Cancellable {
9794
// Instead of passing `workingDirectory` param to TSC.Process, which will trigger
9895
// SPM_posix_spawn_file_actions_addchdir_np_supported check, we shell out and
9996
// do `cd` explicitly before `zip`.
100-
let process = TSCBasic.Process(
97+
let process = AsyncProcess(
10198
arguments: [
10299
"/bin/sh",
103100
"-c",
@@ -132,9 +129,9 @@ public struct ZipArchiver: Archiver, Cancellable {
132129
}
133130

134131
#if os(Windows)
135-
let process = TSCBasic.Process(arguments: ["tar.exe", "tf", path.pathString])
132+
let process = AsyncProcess(arguments: ["tar.exe", "tf", path.pathString])
136133
#else
137-
let process = TSCBasic.Process(arguments: ["unzip", "-t", path.pathString])
134+
let process = AsyncProcess(arguments: ["unzip", "-t", path.pathString])
138135
#endif
139136
guard let registrationKey = self.cancellator.register(process) else {
140137
throw CancellationError.failedToRegisterProcess(process)

0 commit comments

Comments
 (0)