Skip to content

Commit ffdda2c

Browse files
authored
Update dependencies (#293)
* Update dependencies Update swift toolchain version Update package dependencies Update libarchive * Fix the libarchive sha256sum * Add -L to curl command for redirects * Get more information about the version problem * Adjust swift version checks for two digit versions
1 parent 5861e2b commit ffdda2c

File tree

4 files changed

+45
-31
lines changed

4 files changed

+45
-31
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.0.3
1+
6.1.0

Package.resolved

Lines changed: 33 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/build-swiftly-release/BuildSwiftlyRelease.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,14 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
220220
return try await self.assertTool("swift", message: "Please install swift and make sure that it is added to your path.")
221221
}
222222

223-
guard let requiredSwiftVersion = try? self.findSwiftVersion() else {
223+
guard var requiredSwiftVersion = try? self.findSwiftVersion() else {
224224
throw Error(message: "Unable to determine the required swift version for this version of swiftly. Please make sure that you `cd <swiftly_git_dir>` and there is a .swift-version file there.")
225225
}
226226

227+
if requiredSwiftVersion.hasSuffix(".0") {
228+
requiredSwiftVersion = String(requiredSwiftVersion.dropLast(2))
229+
}
230+
227231
let swift = try await self.assertTool("swift", message: "Please install swift \(requiredSwiftVersion) and make sure that it is added to your path.")
228232

229233
// We also need a swift toolchain with the correct version
@@ -276,8 +280,8 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
276280
try runProgram(swift, "package", "reset")
277281

278282
// Build a specific version of libarchive with a check on the tarball's SHA256
279-
let libArchiveVersion = "3.7.4"
280-
let libArchiveTarSha = "7875d49596286055b52439ed42f044bd8ad426aa4cc5aabd96bfe7abb971d5e8"
283+
let libArchiveVersion = "3.7.9"
284+
let libArchiveTarSha = "aa90732c5a6bdda52fda2ad468ac98d75be981c15dde263d7b5cf6af66fd009f"
281285

282286
let buildCheckoutsDir = FileManager.default.currentDirectoryPath + "/.build/checkouts"
283287
let libArchivePath = buildCheckoutsDir + "/libarchive-\(libArchiveVersion)"
@@ -287,7 +291,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
287291
try? FileManager.default.createDirectory(atPath: pkgConfigPath, withIntermediateDirectories: true)
288292

289293
try? FileManager.default.removeItem(atPath: libArchivePath)
290-
try runProgram(curl, "-o", "\(buildCheckoutsDir + "/libarchive-\(libArchiveVersion).tar.gz")", "--remote-name", "--location", "https://github.com/libarchive/libarchive/releases/download/v\(libArchiveVersion)/libarchive-\(libArchiveVersion).tar.gz")
294+
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")
291295
let libArchiveTarShaActual = try await runProgramOutput(sha256sum, "\(buildCheckoutsDir)/libarchive-\(libArchiveVersion).tar.gz")
292296
guard let libArchiveTarShaActual, libArchiveTarShaActual.starts(with: libArchiveTarSha) else {
293297
let shaActual = libArchiveTarShaActual ?? "none"
@@ -298,7 +302,8 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
298302
let cwd = FileManager.default.currentDirectoryPath
299303
FileManager.default.changeCurrentDirectoryPath(libArchivePath)
300304

301-
let swiftVerRegex: Regex<(Substring, Substring)> = try! Regex("Swift version (\\d+\\.\\d+\\.\\d+) ")
305+
let swiftVerRegex: Regex<(Substring, Substring)> = try! Regex("Swift version (\\d+\\.\\d+\\.?\\d*) ")
306+
302307
let swiftVerOutput = (try await runProgramOutput(swift, "--version")) ?? ""
303308
guard let swiftVerMatch = try swiftVerRegex.firstMatch(in: swiftVerOutput) else {
304309
throw Error(message: "Unable to detect swift version")

scripts/install-libarchive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -o errexit
44

55
# TODO detect platform
6-
LIBARCHIVE_VERSION=3.7.4
6+
LIBARCHIVE_VERSION=3.7.9
77

88
mkdir /tmp/archive-build
99
pushd /tmp/archive-build

0 commit comments

Comments
 (0)