@@ -213,7 +213,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
213213 return nil
214214 }
215215
216- func checkGitRepoStatus( _ : String ) async throws {
216+ func checkGitRepoStatus( ) async throws {
217217 guard !self . skip else {
218218 return
219219 }
@@ -241,12 +241,8 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
241241 func buildLinuxRelease( ) async throws {
242242 // TODO: turn these into checks that the system meets the criteria for being capable of using the toolchain + checking for packages, not tools
243243 let curl = try await self . assertTool ( " curl " , message: " Please install curl with `yum install curl` " )
244- let make = try await self . assertTool ( " make " , message: " Please install make with `yum install make` " )
245- let git = try await self . assertTool ( " git " , message: " Please install git with `yum install git` " )
246- let strip = try await self . assertTool ( " strip " , message: " Please install strip with `yum install binutils` " )
247- let sha256sum = try await self . assertTool ( " sha256sum " , message: " Please install sha256sum with `yum install coreutils` " )
248244
249- try await self . checkGitRepoStatus ( git )
245+ try await self . checkGitRepoStatus ( )
250246
251247 // Start with a fresh SwiftPM package
252248 try await sys. swift ( ) . package ( ) . reset ( ) . run ( currentPlatform)
@@ -264,7 +260,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
264260
265261 try ? FileManager . default. removeItem ( atPath: libArchivePath)
266262 try runProgram ( curl, " -L " , " -o " , " \( buildCheckoutsDir + " /libarchive- \( libArchiveVersion) .tar.gz " ) " , " --remote-name " , " --location " , " https://github.com/libarchive/libarchive/releases/download/v \( libArchiveVersion) /libarchive- \( libArchiveVersion) .tar.gz " )
267- let libArchiveTarShaActual = try await runProgramOutput ( sha256sum, " \( buildCheckoutsDir) /libarchive- \( libArchiveVersion) .tar.gz " )
263+ let libArchiveTarShaActual = try await sys . sha256sum ( files : FilePath ( " \( buildCheckoutsDir) /libarchive- \( libArchiveVersion) .tar.gz " ) ) . output ( currentPlatform )
268264 guard let libArchiveTarShaActual, libArchiveTarShaActual. starts ( with: libArchiveTarSha) else {
269265 let shaActual = libArchiveTarShaActual ?? " none "
270266 throw Error ( message: " The libarchive tar.gz file sha256sum is \( shaActual) , but expected \( libArchiveTarSha) " )
@@ -330,9 +326,9 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
330326 env: customEnv
331327 )
332328
333- try runProgramEnv ( make, env: customEnv)
329+ try await sys . make ( ) . run ( currentPlatform , env: customEnv)
334330
335- try runProgram ( make , " install " )
331+ try await sys . make ( ) . install ( ) . run ( currentPlatform )
336332
337333 FileManager . default. changeCurrentDirectoryPath ( cwd)
338334
@@ -341,7 +337,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
341337 let releaseDir = cwd + " /.build/release "
342338
343339 // Strip the symbols from the binary to decrease its size
344- try runProgram ( strip, releaseDir + " / swiftly" )
340+ try await sys . strip ( names : FilePath ( releaseDir) / " swiftly " ) . run ( currentPlatform )
345341
346342 try await self . collectLicenses ( releaseDir)
347343
@@ -374,18 +370,13 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
374370 }
375371
376372 func buildMacOSRelease( cert: String ? , identifier: String ) async throws {
377- // Check system requirements
378- let git = try await self . assertTool ( " git " , message: " Please install git with either `xcode-select --install` or `brew install git` " )
379-
380- try await self . checkGitRepoStatus ( git)
381-
382- let strip = try await self . assertTool ( " strip " , message: " In order to strip binaries there needs to be the `strip` tool that is installed on macOS. " )
373+ try await self . checkGitRepoStatus ( )
383374
384375 try await sys. swift ( ) . package ( ) . clean ( ) . run ( currentPlatform)
385376
386377 for arch in [ " x86_64 " , " arm64 " ] {
387378 try await sys. swift ( ) . build ( . product( " swiftly " ) , . configuration( " release " ) , . arch( " \( arch) " ) ) . run ( currentPlatform)
388- try runProgram ( strip, " .build/ \( arch) -apple-macosx/release/swiftly " )
379+ try await sys . strip ( names : FilePath ( " .build " ) / " \( arch) -apple-macosx/release/swiftly " ) . run ( currentPlatform )
389380 }
390381
391382 let swiftlyBinDir = fs. cwd / " .build/release/.swiftly/bin "
@@ -450,7 +441,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
450441 if self . test {
451442 for arch in [ " x86_64 " , " arm64 " ] {
452443 try await sys. swift ( ) . build ( . product( " test-swiftly " ) , . configuration( " debug " ) , . arch( " \( arch) " ) ) . run ( currentPlatform)
453- try runProgram ( strip, " .build/ \( arch) -apple-macosx/release/swiftly " )
444+ try await sys . strip ( names : FilePath ( " .build " ) / " \( arch) -apple-macosx/release/swiftly " ) . run ( currentPlatform )
454445 }
455446
456447 let testArchive = releaseDir. appendingPathComponent ( " test-swiftly-macos.tar.gz " )
0 commit comments