From 4a7d8fba17c56fc8710ec9b3efcf68b7382629fd Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Tue, 1 Apr 2025 09:12:57 -0400 Subject: [PATCH 1/5] Update dependencies Update swift toolchain version Update package dependencies Update libarchive --- .swift-version | 2 +- Package.resolved | 57 +++++++++++-------- .../BuildSwiftlyRelease.swift | 4 +- scripts/install-libarchive.sh | 2 +- 4 files changed, 37 insertions(+), 28 deletions(-) diff --git a/.swift-version b/.swift-version index 39c5d6a6..358e78e6 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -6.0.3 \ No newline at end of file +6.1.0 \ No newline at end of file diff --git a/Package.resolved b/Package.resolved index 60497c3d..7318a395 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/swift-server/async-http-client", "state" : { - "revision" : "2119f0d9cc1b334e25447fe43d3693c0e60e6234", - "version" : "1.24.0" + "revision" : "333f51104b75d1a5b94cb3b99e4c58a3b442c9f7", + "version" : "1.25.2" } }, { @@ -15,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mattpolzin/OpenAPIKit", "state" : { - "revision" : "749ceba9a6e91d40081f27996fd91fd3de9a8dfe", - "version" : "3.4.0" + "revision" : "fd27b297993923c9a1725dc62553d06579c7a33e", + "version" : "3.4.2" } }, { @@ -24,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-algorithms", "state" : { - "revision" : "f6919dfc309e7f1b56224378b11e28bab5bccc42", - "version" : "1.2.0" + "revision" : "87e50f483c54e6efd60e885f7f5aa946cee68023", + "version" : "1.2.1" } }, { @@ -73,6 +73,15 @@ "version" : "1.0.0" } }, + { + "identity" : "swift-http-structured-headers", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-structured-headers.git", + "state" : { + "revision" : "8e769facea6b7d46ea60e5e93635a384fd573480", + "version" : "1.2.1" + } + }, { "identity" : "swift-http-types", "kind" : "remoteSourceControl", @@ -87,8 +96,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log.git", "state" : { - "revision" : "96a2f8a0fa41e9e09af4585e2724c4e825410b91", - "version" : "1.6.2" + "revision" : "3d8596ed08bd13520157f0355e35caed215ffbfa", + "version" : "1.6.3" } }, { @@ -105,8 +114,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-extras.git", "state" : { - "revision" : "2e9746cfc57554f70b650b021b6ae4738abef3e6", - "version" : "1.24.1" + "revision" : "00f3f72d2f9942d0e2dc96057ab50a37ced150d4", + "version" : "1.25.0" } }, { @@ -123,8 +132,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-ssl.git", "state" : { - "revision" : "c7e95421334b1068490b5d41314a50e70bab23d1", - "version" : "2.29.0" + "revision" : "0cc3528ff48129d64ab9cab0b1cd621634edfc6b", + "version" : "2.29.3" } }, { @@ -132,8 +141,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-transport-services.git", "state" : { - "revision" : "bbd5e63cf949b7db0c9edaf7a21e141c52afe214", - "version" : "1.23.0" + "revision" : "3c394067c08d1225ba8442e9cffb520ded417b64", + "version" : "1.23.1" } }, { @@ -141,8 +150,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-numerics.git", "state" : { - "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", - "version" : "1.0.2" + "revision" : "e0ec0f5f3af6f3e4d5e7a19d2af26b481acb6ba8", + "version" : "1.0.3" } }, { @@ -159,8 +168,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-openapi-generator", "state" : { - "revision" : "84b693f9d0559dc488e691edb4837bafbce2aaea", - "version" : "1.7.0" + "revision" : "755c0ec69bd667aa4e8ba50c8b710585d302879e", + "version" : "1.7.1" } }, { @@ -168,8 +177,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-openapi-runtime", "state" : { - "revision" : "23146bc8710ac5e57abb693113f02dc274cf39b6", - "version" : "1.8.0" + "revision" : "81c309c7b43cd56b2d2b90ca0170f17ff3d0c433", + "version" : "1.8.1" } }, { @@ -177,8 +186,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "c8a44d836fe7913603e246acab7c528c2e780168", - "version" : "1.4.0" + "revision" : "a34201439c74b53f0fd71ef11741af7e7caf01e1", + "version" : "1.4.2" } }, { @@ -204,8 +213,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/jpsim/Yams", "state" : { - "revision" : "3036ba9d69cf1fd04d433527bc339dc0dc75433d", - "version" : "5.1.3" + "revision" : "b4b8042411dc7bbb696300a34a4bf3ba1b7ad19b", + "version" : "5.3.1" } } ], diff --git a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift index 5e415d59..fbafb670 100644 --- a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift +++ b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift @@ -276,8 +276,8 @@ struct BuildSwiftlyRelease: AsyncParsableCommand { try runProgram(swift, "package", "reset") // Build a specific version of libarchive with a check on the tarball's SHA256 - let libArchiveVersion = "3.7.4" - let libArchiveTarSha = "7875d49596286055b52439ed42f044bd8ad426aa4cc5aabd96bfe7abb971d5e8" + let libArchiveVersion = "3.7.9" + let libArchiveTarSha = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" let buildCheckoutsDir = FileManager.default.currentDirectoryPath + "/.build/checkouts" let libArchivePath = buildCheckoutsDir + "/libarchive-\(libArchiveVersion)" diff --git a/scripts/install-libarchive.sh b/scripts/install-libarchive.sh index 728f59ef..15af9905 100755 --- a/scripts/install-libarchive.sh +++ b/scripts/install-libarchive.sh @@ -3,7 +3,7 @@ set -o errexit # TODO detect platform -LIBARCHIVE_VERSION=3.7.4 +LIBARCHIVE_VERSION=3.7.9 mkdir /tmp/archive-build pushd /tmp/archive-build From a28577096187e6b9ae02024e31656525b80eef9b Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Tue, 1 Apr 2025 09:35:46 -0400 Subject: [PATCH 2/5] Fix the libarchive sha256sum --- Tools/build-swiftly-release/BuildSwiftlyRelease.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift index fbafb670..11267618 100644 --- a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift +++ b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift @@ -277,7 +277,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand { // Build a specific version of libarchive with a check on the tarball's SHA256 let libArchiveVersion = "3.7.9" - let libArchiveTarSha = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + let libArchiveTarSha = "aa90732c5a6bdda52fda2ad468ac98d75be981c15dde263d7b5cf6af66fd009f" let buildCheckoutsDir = FileManager.default.currentDirectoryPath + "/.build/checkouts" let libArchivePath = buildCheckoutsDir + "/libarchive-\(libArchiveVersion)" From 5688b8f824cf10e122d9666692da86a6dece762a Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Tue, 1 Apr 2025 09:39:42 -0400 Subject: [PATCH 3/5] Add -L to curl command for redirects --- Tools/build-swiftly-release/BuildSwiftlyRelease.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift index 11267618..f6dc62c9 100644 --- a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift +++ b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift @@ -287,7 +287,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand { try? FileManager.default.createDirectory(atPath: pkgConfigPath, withIntermediateDirectories: true) try? FileManager.default.removeItem(atPath: libArchivePath) - 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") + 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") let libArchiveTarShaActual = try await runProgramOutput(sha256sum, "\(buildCheckoutsDir)/libarchive-\(libArchiveVersion).tar.gz") guard let libArchiveTarShaActual, libArchiveTarShaActual.starts(with: libArchiveTarSha) else { let shaActual = libArchiveTarShaActual ?? "none" From a5cd838099403bf8f45c50f214710f2c782fc111 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Tue, 1 Apr 2025 10:54:08 -0400 Subject: [PATCH 4/5] Get more information about the version problem --- Tools/build-swiftly-release/BuildSwiftlyRelease.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift index f6dc62c9..289468fc 100644 --- a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift +++ b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift @@ -299,6 +299,10 @@ struct BuildSwiftlyRelease: AsyncParsableCommand { FileManager.default.changeCurrentDirectoryPath(libArchivePath) let swiftVerRegex: Regex<(Substring, Substring)> = try! Regex("Swift version (\\d+\\.\\d+\\.\\d+) ") + + // FIXME remove this once the problem is determined + try runProgram(swift, "--version") + let swiftVerOutput = (try await runProgramOutput(swift, "--version")) ?? "" guard let swiftVerMatch = try swiftVerRegex.firstMatch(in: swiftVerOutput) else { throw Error(message: "Unable to detect swift version") From c1ee4ce2a260cab7d5e35599dce56a000b8e9b9b Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Tue, 1 Apr 2025 12:42:41 -0400 Subject: [PATCH 5/5] Adjust swift version checks for two digit versions --- Tools/build-swiftly-release/BuildSwiftlyRelease.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift index 289468fc..70da86a7 100644 --- a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift +++ b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift @@ -220,10 +220,14 @@ struct BuildSwiftlyRelease: AsyncParsableCommand { return try await self.assertTool("swift", message: "Please install swift and make sure that it is added to your path.") } - guard let requiredSwiftVersion = try? self.findSwiftVersion() else { + guard var requiredSwiftVersion = try? self.findSwiftVersion() else { throw Error(message: "Unable to determine the required swift version for this version of swiftly. Please make sure that you `cd ` and there is a .swift-version file there.") } + if requiredSwiftVersion.hasSuffix(".0") { + requiredSwiftVersion = String(requiredSwiftVersion.dropLast(2)) + } + let swift = try await self.assertTool("swift", message: "Please install swift \(requiredSwiftVersion) and make sure that it is added to your path.") // We also need a swift toolchain with the correct version @@ -298,10 +302,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand { let cwd = FileManager.default.currentDirectoryPath FileManager.default.changeCurrentDirectoryPath(libArchivePath) - let swiftVerRegex: Regex<(Substring, Substring)> = try! Regex("Swift version (\\d+\\.\\d+\\.\\d+) ") - - // FIXME remove this once the problem is determined - try runProgram(swift, "--version") + let swiftVerRegex: Regex<(Substring, Substring)> = try! Regex("Swift version (\\d+\\.\\d+\\.?\\d*) ") let swiftVerOutput = (try await runProgramOutput(swift, "--version")) ?? "" guard let swiftVerMatch = try swiftVerRegex.firstMatch(in: swiftVerOutput) else {