public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Link Dupont <link@sub-pop.net>
To: git-commits@fedoraproject.org
Subject: [rpms/swift-lang] rawhide: Update to Swift 6.4.0 (RHBZ#2494781)
Date: Mon, 19 Oct 2026 10:27:09 GMT [thread overview]
Message-ID: <179240562900.1.13553395482196249594.rpms-swift-lang-e41d1bd68424@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/swift-lang
Branch : rawhide
Commit : e41d1bd68424212a4d612f2aee368cd83333c2fa
Author : Link Dupont <link@sub-pop.net>
Date : 2026-10-18T22:15:33-04:00
Stats : +987/-88 in 13 file(s)
URL : https://src.fedoraproject.org/rpms/swift-lang/c/e41d1bd68424212a4d612f2aee368cd83333c2fa?branch=rawhide
Log:
Update to Swift 6.4.0 (RHBZ#2494781)
---
diff --git a/.gitignore b/.gitignore
index 8485f26..2a0d72b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -199,3 +199,42 @@
/swift-xcode-playground-support-swift-6.3.2-RELEASE.tar.gz
/wasi-libc-wasi-sdk-27.tar.gz
/WasmKit-0.1.6.tar.gz
+/boringssl-817ab07ebb53da35afea409ab9328f578492832d.tar.gz
+/brotli-1.2.0.tar.gz
+/indexstore-db-swift-6.4.0-RELEASE.tar.gz
+/llvm-project-swift-6.4.0-RELEASE.tar.gz
+/sourcekit-lsp-swift-6.4.0-RELEASE.tar.gz
+/swift-build-swift-6.4.0-RELEASE.tar.gz
+/swift-cmark-swift-6.4.0-RELEASE.tar.gz
+/swift-corelibs-blocksruntime-swift-6.4.0-RELEASE.tar.gz
+/swift-corelibs-foundation-swift-6.4.0-RELEASE.tar.gz
+/swift-corelibs-libdispatch-swift-6.4.0-RELEASE.tar.gz
+/swift-corelibs-xctest-swift-6.4.0-RELEASE.tar.gz
+/swift-docc-render-artifact-swift-6.4.0-RELEASE.tar.gz
+/swift-docc-swift-6.4.0-RELEASE.tar.gz
+/swift-docc-symbolkit-swift-6.4.0-RELEASE.tar.gz
+/swift-driver-swift-6.4.0-RELEASE.tar.gz
+/swift-experimental-string-processing-swift-6.4.0-RELEASE.tar.gz
+/swift-format-swift-6.4.0-RELEASE.tar.gz
+/swift-foundation-icu-swift-6.4.0-RELEASE.tar.gz
+/swift-foundation-swift-6.4.0-RELEASE.tar.gz
+/swift-installer-scripts-swift-6.4.0-RELEASE.tar.gz
+/swift-integration-tests-swift-6.4.0-RELEASE.tar.gz
+/swift-llbuild-swift-6.4.0-RELEASE.tar.gz
+/swift-llvm-bindings-swift-6.4.0-RELEASE.tar.gz
+/swift-lmdb-swift-6.4.0-RELEASE.tar.gz
+/swift-markdown-swift-6.4.0-RELEASE.tar.gz
+/swift-nio-2.92.2.tar.gz
+/swift-package-manager-swift-6.4.0-RELEASE.tar.gz
+/swift-sdk-generator-swift-6.4.0-RELEASE.tar.gz
+/swift-stress-tester-swift-6.4.0-RELEASE.tar.gz
+/swift-subprocess-0.4.tar.gz
+/swift-swift-6.4.0-RELEASE.tar.gz
+/swift-syntax-swift-6.4.0-RELEASE.tar.gz
+/swift-testing-swift-6.4.0-RELEASE.tar.gz
+/swift-toolchain-sqlite-1.0.9.tar.gz
+/swift-tools-protocols-swift-6.4.0-RELEASE.tar.gz
+/swift-tools-support-core-swift-6.4.0-RELEASE.tar.gz
+/swift-xcode-playground-support-swift-6.4.0-RELEASE.tar.gz
+/wasi-libc-wasi-sdk-31.tar.gz
+/WasmKit-0.3.1.tar.gz
diff --git a/README.md b/README.md
index 2c9f094..104fd4c 100644
--- a/README.md
+++ b/README.md
@@ -42,3 +42,48 @@ The script is idempotent: running it multiple times on the same version produces
2. Update patches if needed for the new version
3. Run `spectool -g swift-lang.spec` to download new source tarballs
4. Run `fedpkg new-sources <tarballs>` to upload them to the lookaside cache
+
+## Bootstrapping
+
+By default, `swift-lang` builds using a previously installed Swift
+toolchain (pulled in via `BuildRequires: (swift-lang >= 6.3.2 with
+swift-lang <= %{version})`) as the host compiler for the compiler's own
+Swift-in-Swift sources. This is fast, but it depends on a compatible
+`swift-lang` build already being available.
+
+The spec also supports a `bootstrap` bcond (off by default) that performs
+the full four-stage, from-scratch C++ bootstrap instead:
+
+- **Stage 0**: builds a minimal Swift toolchain from C++ only (no
+ SwiftPM, no swift-driver, no prior Swift compiler required)
+- **Stage 1**: rebuilds Swift using Stage 0, adding macro support,
+ Foundation, and Dispatch
+- **Stage 2**: builds Swift using Stage 1, adding SwiftPM
+- **Stage 3**: builds the final production toolchain using Stage 2,
+ adding swift-driver, sourcekit-lsp, swift-format, etc.
+
+Use `--with bootstrap` when there is no compatible `swift-lang` build
+available to act as the host compiler, e.g. when bootstrapping a new
+architecture, or recovering after a broken build chain.
+
+### Building a stage0 bootstrap RPM locally
+
+To sanity-check the bootstrap path in a mock chroot before submitting
+anything to Koji:
+
+```bash
+fedpkg mockbuild --with bootstrap
+```
+
+### Submitting a stage0 bootstrap scratch build to Koji
+
+`fedpkg build`/`fedpkg scratch-build` don't expose `--with`/`--without`
+flags directly, since they just build whatever SRPM is generated from
+the current spec/sources. To build with a non-default bcond, build the
+SRPM yourself and hand it to `fedpkg scratch-build --srpm`:
+
+```bash
+fedpkg sources
+rpmbuild -bs --with bootstrap swift-lang.spec --define "_sourcedir $PWD"
+fedpkg scratch-build --srpm /path/to/swift-lang-<version>.src.rpm
+```
diff --git a/cmake.patch b/cmake.patch
deleted file mode 100644
index 1a767a1..0000000
--- a/cmake.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff --git cmake.orig/Utilities/cmcppdap/include/dap/network.h cmake/Utilities/cmcppdap/include/dap/network.h
-index 9d14f6b70f..491f023493 100644
---- cmake.orig/Utilities/cmcppdap/include/dap/network.h
-+++ cmake/Utilities/cmcppdap/include/dap/network.h
-@@ -15,6 +15,7 @@
- #ifndef dap_network_h
- #define dap_network_h
-
-+#include <cstdint>
- #include <functional>
- #include <memory>
-
-
---- cmake.orig/Source/cmake.cxx
-+++ cmake/Source/cmake.cxx
-@@ -131,7 +131,9 @@
- // NOTE: the __linux__ macro is predefined on Android host too, but
- // main CMakeLists.txt filters out this generator by host name.
- #if (defined(__linux__) && !defined(__ANDROID__)) || defined(_WIN32)
-+#if !defined(CMAKE_BOOTSTRAP)
- # include "cmGlobalGhsMultiGenerator.h"
-+#endif
- #endif
-
- #if defined(__APPLE__)
diff --git a/fedora-presets.ini b/fedora-presets.ini
index e936004..743e430 100644
--- a/fedora-presets.ini
+++ b/fedora-presets.ini
@@ -19,7 +19,6 @@ skip-test-playgroundsupport
skip-test-indexstore-db
skip-test-sourcekit-lsp
skip-test-swiftdocc
-skip-test-wasm-stdlib
skip-test-swiftformat
release
diff --git a/sources b/sources
index fd7c714..787f9d0 100644
--- a/sources
+++ b/sources
@@ -1,54 +1,53 @@
-SHA512 (brotli-1.1.0.tar.gz) = 6eb280d10d8e1b43d22d00fa535435923c22ce8448709419d676ff47d4a644102ea04f488fc65a179c6c09fee12380992e9335bad8dfebd5d1f20908d10849d9
-SHA512 (CMake-3.30.2.tar.gz) = bd71bbd62a024cc93e97421ea50900072e9ab79ccec3ad0e012b5a9286a3c46a15c1b86a0f8ef2dd8518a4e63d4644d34c80cba869c0e9f9eb419fcc439acfa5
+SHA512 (boringssl-817ab07ebb53da35afea409ab9328f578492832d.tar.gz) = 32a15d01a4d32cdeb7f67ddc37afa13ec6018d03e9e8071d999d097f37d4256158f1e9b3ed3efb3a31713d32b12d7a73cedce75982965f217fb7ade438fa71af
+SHA512 (brotli-1.2.0.tar.gz) = f94542afd2ecd96cc41fd21a805a3da314281ae558c10650f3e6d9ca732b8425bba8fde312823f0a564c7de3993bdaab5b43378edab65ebb798cefb6fd702256
SHA512 (curl-curl-8_9_1.tar.gz) = f5c425c3fbd7bfda13137e8e9bc969ed7dc94c5bfcf0681a2358ab7d3b5d10402781a93385255a80c402c9824aeb97d70213b412f2d208dee4abdba5bbed2ca4
-SHA512 (indexstore-db-swift-6.3.2-RELEASE.tar.gz) = d30b113cba6cd4ab95f2844ecfa38e3a734d2f3bb02b7437b5366b6d3251ca18e1c831ad1039c103db4e5e236fbf082c136f384878527948e2e3dbe5305a6db1
+SHA512 (indexstore-db-swift-6.4.0-RELEASE.tar.gz) = 68310086804afa0050c432743f1840787f3b72f09e20f0d370221c0e4c6decf74cd1a05269635d2ce19e84ddf7c75687f65391ab81edce21253ccab44306046d
SHA512 (libxml2-2.11.5.tar.gz) = 303528ead0f020c8e172beca54d00bb1281f4080885c9f44b979158516b585d71bbcb024999a5712a850e48647b19b1f634a1428ea29f39a48e8e6cbf7c71936
-SHA512 (llvm-project-swift-6.3.2-RELEASE.tar.gz) = 2c0326a0a263b3ec18bef882651963261c7030389c1e397abc3215f9b58bef2d81874fc5bc2345811cc393a8c72a608f23874a00af58a846278ef9c80792ec88
+SHA512 (llvm-project-swift-6.4.0-RELEASE.tar.gz) = f8bd71348bf4b20792e89b159567fc20c98efc1fb5b66e38533839ba71fd4311a2cf08fa24e0fef79faba0dc64e61034e4d2e288a8472ef1dcb56a9340d118b0
SHA512 (mimalloc-3.0.3.tar.gz) = fa47dd7ecfe8e8afb691490a3317ce89e92c4d322624d4373a113beb10d4aa44b43359fea84beb43ad9be5cddd4f262a5c933177c6096b70d2cee53cb6e9620b
-SHA512 (ninja-1.13.1.tar.gz) = ec94d42967b962d66ab0747fcb9d095510117159de0473ec08df47a657895aa2523f920798e4608d0c6cf0e2e382512c14aec8a54ea58b6cd4b01edd3a7c8e62
-SHA512 (sourcekit-lsp-swift-6.3.2-RELEASE.tar.gz) = e542a0f8e679ab87a36fd2f47deb73f95dbdaeaa62c863dbb7dfbd5e2641dec29a456997f57721baa2448971ee6687d3eaf9e8dce084f4ba78517376c29fd2d0
+SHA512 (sourcekit-lsp-swift-6.4.0-RELEASE.tar.gz) = 9a1522f894ea32c4d3e7dade476512aea04159382f60bf8cc423cefcde9958cc39f86e2ef01815fc8f3ecb7e1534267950499644b7cc9f8843596c745092ffed
SHA512 (swift-argument-parser-1.6.1.tar.gz) = 5ab50de193bdf85a5348fc0dd5502fa4ddf602199b8c5689d0abcde82cdb01737a9ec4e7bd2103265e418f8c6d598f77bc1b0c9fa04149f947c2da3e76309e97
SHA512 (swift-asn1-1.3.2.tar.gz) = a4b297bd0d3fde2148970055d2a2027b1ba2625991b895b5afa1755fbf24ae88165adfa697dab23d4fa0203f8640280b4a011e853e530566a34b1cbc4077d2d5
SHA512 (swift-async-algorithms-1.0.1.tar.gz) = a5687ddce9d051a671fc34d88cc77e2d30a60b99d7f4381956cee05d41d5afcc8fb34469155984f5b7dbedcc3f7f839a236fa528c3e0f660f4d6d409d39cf2f7
SHA512 (swift-atomics-1.2.0.tar.gz) = efd9a6e6b016fb0ad2de5d98fb219b893e271378a8c8d23d01215e855830fc6f1728eaec74ba33983ab9e8aece5ed65e310bbae84c289b43e458941080293351
-SHA512 (swift-build-swift-6.3.2-RELEASE.tar.gz) = f8050bd1b15a2e2911371e917908c0f8b183fd12ee31bacbb35a211a44cb73d66894eb2a619d51d92674a16c4b542521bc474e44e8e901300b933c97682ff12f
+SHA512 (swift-build-swift-6.4.0-RELEASE.tar.gz) = ab7d42328f4f48e17f33d2a3c7bcb6da03288b4d89ee2a4428fbde36659ab510c9d088bfb1b0be674176f9879efc35966754331721141f7af58e79cded67477f
SHA512 (swift-certificates-1.10.1.tar.gz) = 532590e06060afd798dd962e54e2dc46ddb253a95c5152144f43389c4e4900b4c8e0ecd7f1efa05cff7029520c60533481f75532a4a3f38076a97fb586d5b154
-SHA512 (swift-cmark-swift-6.3.2-RELEASE.tar.gz) = d688fa8763a75676a7d62133fa4e17734f0b5cf4e6a8c98d323e9bf9a65d83a34acd408a035363c2134027322c671042789abf9467adc7d438b8e9ab1f1d154c
+SHA512 (swift-cmark-swift-6.4.0-RELEASE.tar.gz) = 8af4c8584ed7156d6df5f63153e6af99beedca2f1f37d36005e2291614311f00fbc2a3d164719d3346fe6df8cdf2ae3951b95185ff8968d32c4a143773d73d5e
SHA512 (swift-collections-1.1.6.tar.gz) = 05451ebd99b394f8db0ddb4eacdb94dcac15f1af6eda4cf7145f627e02a87f1075724be72b6ea092e95530b7a9571d6e1cb5de789427c18c8dfd1141db75788d
-SHA512 (swift-corelibs-blocksruntime-swift-6.3.2-RELEASE.tar.gz) = c26e6d8d0093e31d4bec3e52c37ccd86990e04566852e4ad5b842dbd2f659ee8c0e0d8d01eb1953e1e003067eb7ac97f64c911b27c0e245daf32932c982b18af
-SHA512 (swift-corelibs-foundation-swift-6.3.2-RELEASE.tar.gz) = 44748f226cc77960396f958b34c0d6ea87fb8ac177b2c86efc4127fd1d88b6a15e834b64332cdf8cd6d4bd2c2d52bd9dda69679813945412df869406d939e025
-SHA512 (swift-corelibs-libdispatch-swift-6.3.2-RELEASE.tar.gz) = fba313c695027005d9948ff6c3bd1b244e94a142b2fe1f01d6553bf9884fa21c22f6f72e920d4af2ab291f805ee94c25e1685e4db4ed6881a650470c16145988
-SHA512 (swift-corelibs-xctest-swift-6.3.2-RELEASE.tar.gz) = b3c6d78fad513035db7984779df6b534bbbb6ad0609489405c36d0c2e92da998e320c819276f01b115258e41a1f39bb3781afd5e8337c00463e7e5d6b3c6d3f9
+SHA512 (swift-corelibs-blocksruntime-swift-6.4.0-RELEASE.tar.gz) = b2880f9a85e05f81d800510dd868929364ffec85265776aa78833ff9aca43afc1438c10d990df865aaf5053281daba72b6a89f0e3821aed1e3ba832b22b4c4c9
+SHA512 (swift-corelibs-foundation-swift-6.4.0-RELEASE.tar.gz) = c3fbe44a9d97290843b0e0601c5a4206b0aac5d70e3f0ef8a5f76af9269f9dda3b2032e6b9a42f810dfb00ed4d349ef8805abe5f112d6aa256ed6fe17f1e17b4
+SHA512 (swift-corelibs-libdispatch-swift-6.4.0-RELEASE.tar.gz) = 84db81ec3d353c07f51b9e4d95af5950e1512b5bb2f1574f5827da4e80e2d2a5da3a707c44c5b425549223741d4bdce20d59abc9274948740f2fdef68b28b3b8
+SHA512 (swift-corelibs-xctest-swift-6.4.0-RELEASE.tar.gz) = 1f3f71ce34547ce31fa6df36954e83d7f4fd60e838f44ad8d3d68022291a15d2db34ee69becad21c550e2e2c96bb1507cc0f879d2a31dac79400b8b9421bbddf
SHA512 (swift-crypto-3.12.5.tar.gz) = 413236a3e1a39348ee2d741fa48cbecdd70d6e25dea843c626d9e1de4135d6787c3660c462ae1b9c400d6160b7980cf5a6b02e539aa0588dffd18224cc1ee19c
-SHA512 (swift-docc-render-artifact-swift-6.3.2-RELEASE.tar.gz) = 0ca53ba14259c96158b23d8345f8b845e9720a27dc0076ae99118a6fc9792212a20f65feca745f452f22a1886ed66619b1dfe78f7b2ea8ebbf0a61798d5fc8f1
-SHA512 (swift-docc-swift-6.3.2-RELEASE.tar.gz) = b5fcd73da0d600befec9aa2c929d3aadb25c865e768319a038d804f3694c95659f2a662841ffe9754a2a5f2aad91624ca337a11e82db759990858d08795a574a
-SHA512 (swift-docc-symbolkit-swift-6.3.2-RELEASE.tar.gz) = 2d559f9aa9baaa6c80d4a27073a54316cca197afae48c7f2553395bf83edce765203d00c2a58bca79964d12c2814bbf900afc2e806d60d05bfe8f6754d3cd6cf
-SHA512 (swift-driver-swift-6.3.2-RELEASE.tar.gz) = 247b0cf9be9713bbd0ad2a40fa1853720223c7239b7013b99d4c0ca701e97144d1077b12da2205680900a8aef48df78675ed3437b56f57c90065236c65b5e22f
-SHA512 (swift-experimental-string-processing-swift-6.3.2-RELEASE.tar.gz) = 29b32dba3aaed7fbcf19e6ddd5ea1505bd9c9142940ebc5d97f191d09cd5d92c8bfda1c31d3b684cdabfd5cad72ec39c905e90d84f5661155cbe1b28688b90b7
-SHA512 (swift-format-swift-6.3.2-RELEASE.tar.gz) = 311a76c86e426e6ef8b9a93677b09df8974e34d37b8ca0cb5771e2398d58d43f1304a7ce1208157f3d787788050b58fdfd2e7344e77ab6e523591287e3d697c3
-SHA512 (swift-foundation-icu-swift-6.3.2-RELEASE.tar.gz) = d7e7caa491b1911368b43de059af704efe981964bb9a84d4fb2b7a10a9d5e77963e4cea687e9b2c8bb1138361e11e73f51cb9389a54efd1d1723254e187255a8
-SHA512 (swift-foundation-swift-6.3.2-RELEASE.tar.gz) = 22d8deb754cc5eb32c95f7a99cd1d2ab81ca06c9d57f197155defc9c7dac5573f7979bb5f9334774c143f2b8d9460561bb5cfd52804896013928f714b9fda3e0
-SHA512 (swift-installer-scripts-swift-6.3.2-RELEASE.tar.gz) = 19fe2f13fd30765d0a1cac966670cd4186b53f904af594229620afaa7246d9ec52fa1cb16e6cc97c43dc4aaccf0eed88ea4f4f69c53dedabd1f0f508d8ca97d8
-SHA512 (swift-integration-tests-swift-6.3.2-RELEASE.tar.gz) = f04eaf90e0d8647e6d8a45b563ddb8002e3c4d09b30c9302248fa3fce117d75bb927cc98d4863e3cd365d4b77934aa6e6510d444e5e80835305cba0aae9b3153
-SHA512 (swift-llbuild-swift-6.3.2-RELEASE.tar.gz) = e4842fb10fd1b9e6b9a9bc08706514829551e4ffb28eed17f653dd6acfbbbb13693eaeb485aafec949f9731b45d8e37f1d6f30e0ee2bb3cf671e3a5369bf7a84
-SHA512 (swift-llvm-bindings-swift-6.3.2-RELEASE.tar.gz) = acf7eccbfe0503d0b64aee54a94c5ecfca137d0e9608914ca99949acddde055daf827df1bce07b4e9db8a00ea0bd0530b3da7b6fbfc864520e40a66e97d258cc
-SHA512 (swift-lmdb-swift-6.3.2-RELEASE.tar.gz) = 96b9fdcc91a509cd8b095d0785236328fcd9ee28e0fd7a6ea66a4987057e016bec214a92bb1fb626876e6246e9a611c89c95e1307a008ff4175df9fede23eca4
+SHA512 (swift-docc-render-artifact-swift-6.4.0-RELEASE.tar.gz) = e414596627dbf7cb7da11ab34100707d179ebcd3745ae61a31ee1c3eab6c5bf06f770d6c86a62051a3da0cb3d117a2666113040c7921d5f59623d5739e262645
+SHA512 (swift-docc-swift-6.4.0-RELEASE.tar.gz) = 56df973fdd367b81131aae86fdb51cac736e0e932d9cc3cf81d7052b40b7e81a916ab18569f49cfba29b9a567960fc43cf1a4a580ab8aa0406e8ecca73d73371
+SHA512 (swift-docc-symbolkit-swift-6.4.0-RELEASE.tar.gz) = ae22fb57976af8a630dc9c5c24c89619135e7b818d8f2114b6a10aa2d39aa3899dcdd3d19039839c84ef391563fca7ae82b8f980b59abd64686f88b58d3ec162
+SHA512 (swift-driver-swift-6.4.0-RELEASE.tar.gz) = d446d1cd48d8e8dcce860e48735160a4f3deb44021e93fdcf9ec76110d5020aeb5345bbbfd4e409927bc46411d89d542cafa334136e1b3eb170e38d604db8910
+SHA512 (swift-experimental-string-processing-swift-6.4.0-RELEASE.tar.gz) = a76e97065cbf0d57f0338c45571758c254c5400e164bb3a3255f7aba242e7d2c0b8d97934477e07bc7fd0454677ae50bfd446407025168420d96541b8a093507
+SHA512 (swift-format-swift-6.4.0-RELEASE.tar.gz) = 203ba81447483aa59f98f94448f6b77118147676f777ae7f6ecd70990d5bf3abc7c472199c90b4dbd9431b58d08e938c175a59b8e5628cb5ab60ce88f58203ff
+SHA512 (swift-foundation-icu-swift-6.4.0-RELEASE.tar.gz) = 78858029c0ff328b669fb50a8798f2ac972d7792192335c533bd4c68447eff965edf6c2c84154ce965fd4e0184aabb939aefef28df5bf5ad1c27f9fe984fc6e0
+SHA512 (swift-foundation-swift-6.4.0-RELEASE.tar.gz) = 3a99b964fbce8507357a1aac940f1ed06aad8af6a24da319fc85a46d158d40a190f14ca57d68b7f451ad2e23aa98604d5b5c0b1151061145afecd21eda517ba0
+SHA512 (swift-installer-scripts-swift-6.4.0-RELEASE.tar.gz) = acf8b07827551ff8a2822cf33bf715523b82eeb87822fb62a3594722c15772e797166db5c4e212d77cf5e392f9a99059071f25e52ec68b10fb1323defec97896
+SHA512 (swift-integration-tests-swift-6.4.0-RELEASE.tar.gz) = fe5ba546230924ee691fdedcaeac4eebdabab0dbdd41f844eb880abfa507f81840a0317d9a543866d52f632cf443a3942167e1c196dacfa6df5efa43df534e32
+SHA512 (swift-llbuild-swift-6.4.0-RELEASE.tar.gz) = 5820ba7b10e69a225f639f422dbba89c7b71c5b2cabf7a46de82c4e6ffe1237e60b94bacb4c7890b8fc788d14f44ad2e3a5f2b6c4a2a310c561695a2d59866d1
+SHA512 (swift-llvm-bindings-swift-6.4.0-RELEASE.tar.gz) = fee3b01bf65ebe3570dd925cf77f98358e68ae20f60bdf34ce5a2f594e5d0543e24a8bf63e9c9afa5fdff3973acf0a32fb14857524cf6841ea50e052ce3ad663
+SHA512 (swift-lmdb-swift-6.4.0-RELEASE.tar.gz) = 4442eac9c664de291294ccaa4cf2cebce3316acce1b24b3e8b18af2975e2a8267be48fa7cb7d5b660b8a8fb3bc9cc6f3a1bbf94c672b05dda5af3cb91f5a18f0
SHA512 (swift-log-1.5.4.tar.gz) = c148f7a20072fba57226bfbc0d9e9f6bb9ebfc952e920d7f4b6a12028fa49a2f61f1f7f13e53c2421b562b83e8160e3d64da51437840b9312c77113b1484c39f
-SHA512 (swift-markdown-swift-6.3.2-RELEASE.tar.gz) = 85bf5ef49d79bd270280b36ed614328a64c5a202d4832a227f03a538219ad87fbe8b21036e03f6ab81270a1c660bd8af15e7094d5b0515257378f2a934fee8ec
-SHA512 (swift-nio-2.65.0.tar.gz) = 3eb24d634c8937270b88eda8c34b7b70290b28a601228e051cd2b414003902d18d066dc82f8682835b2c788d5d2b27ac0a1f1723e16f902b1d3d321ac7807f6d
+SHA512 (swift-markdown-swift-6.4.0-RELEASE.tar.gz) = 605c3d9eaf097d0f26bb57c4aac76dfca91bbad00ed8e741ac31e4891d0360628dfc87dccd67ef111ce6ff5ca3280ba4c1215e704db83ad0b1e825e0496d552a
+SHA512 (swift-nio-2.92.2.tar.gz) = 8ffd5d2f6b5de2fbc108cc549b571c01e692e99843d9b53fc558a811384dd996d0ad586d73ee15392a58ae71489f6e0672d330108d5c29c2acd97366b884d416
SHA512 (swift-numerics-1.0.2.tar.gz) = 2d6a2c6aa21a86ece26983cbcaa366bd726e4e0c4341e4801510a0227be8856280102fd04726a91b5b335aaf7eb609b04113d6af824e904ae4c768755dd6707a
-SHA512 (swift-package-manager-swift-6.3.2-RELEASE.tar.gz) = 00006dc3e91ed99c1027616d481ba52750fd82ffa11b17628bc4d19099469bceadf6ad145f934ae92a6b6885b162a65c3a1c1025193c88367f0e2e0e8d1de403
-SHA512 (swift-sdk-generator-swift-6.3.2-RELEASE.tar.gz) = 977aacf0a9fe816d529d8235ad020cd5a4b892ac9fcd2ed81f6f9f607ca8725a1c26d980a7e33310076cd058b679e1436ed76894efeebe5ee4e885db46b2c879
-SHA512 (swift-stress-tester-swift-6.3.2-RELEASE.tar.gz) = cdddf857b4f73430d4a92a75c522bf8144d14d0b1565a7ae9d92efff9a97362f2ec593532b488f4c3719360a1687c61389bbdbd1f1b4456359c97096abfa9669
-SHA512 (swift-subprocess-0.2.1.tar.gz) = ac086c8da5e0dad4d84b6f146ce6844babe521ba7d66c02bce2c0b81e17f54bc522f1277b93206f86f225505a69cb9e25348aee5998b68a985a154374e4ba0a2
-SHA512 (swift-swift-6.3.2-RELEASE.tar.gz) = 98ad80ba170fc9d920442f80938717f4e7d44b4c664cbf55072f285c0c0c39e1630902491be10785d83efaae1e29030ad438085b3e42f06efcc2fa412b4211f1
-SHA512 (swift-syntax-swift-6.3.2-RELEASE.tar.gz) = bcb3a41a55b1440a3a5a57cabfd0ece95ca8f12762402abfc1876b317494f0dc557828e221f72a95c40943b66bd528bd4600436ba301067ff1f3cb16cfc4b4a1
+SHA512 (swift-package-manager-swift-6.4.0-RELEASE.tar.gz) = 005f19a4dc7d4a322515f7a4fd58ebf683c1c1d7d3ba660dfd9626ca234f073120197cf60c09901cd26922c768b8aee601976f4a163e5d90025480df0b107912
+SHA512 (swift-sdk-generator-swift-6.4.0-RELEASE.tar.gz) = fb82c8614a81b0d6887d5184e732a35f8ef19e607aa330c90191dc554923cabe19b8f4097c08f4bc2e436179ae5c52bb9912ba2afc2a58ef7c71cc0f0eef97a2
+SHA512 (swift-stress-tester-swift-6.4.0-RELEASE.tar.gz) = df3063b3e58d92c741ac49d5243631ccd139d27b76b5767e5eb656d626bb91e552b9d7d8cfd5401d8ede66878fb2c5069182fb940e86448101fea56bb11d171b
+SHA512 (swift-subprocess-0.4.tar.gz) = fbbf5415609bfa79d6a03df96a18292b5f3926c5653c84485cf37dbbbf3facfcc7165d4830d2e0dcd18331259b0c31c1367878983c063ec667ab7650e8a92164
+SHA512 (swift-swift-6.4.0-RELEASE.tar.gz) = 0f62b8d1194550e24a696da074883b5a7b3651196477c14422342ce32b66a96c61aa9ca5c785052523369e73cc13fe38fea6c4a4f339c6517d2d6729993cf2f3
+SHA512 (swift-syntax-swift-6.4.0-RELEASE.tar.gz) = 999c7ada983e0677347b0f9707288a65c809237e1a785ea05ffde9388d87f1dd799333ef6eacb8ad4146e928b58e3f165d2d81b9f09577668fb33e40437b6a34
SHA512 (swift-system-1.5.0.tar.gz) = 003f6112e47c2f9c5abc79ea13bd2904cfba6b265c49028b006a8a60f754e86085a87c9ef9eeb79266511a1afcfcd95b471e8a780959b94baaf6fd18e87f25f6
-SHA512 (swift-testing-swift-6.3.2-RELEASE.tar.gz) = c4d857d0818ca6761b8cf9456ca766b97b7c0409b9eefea388299fd9a8b32b56d6ef820c2e197d921b04b933f42a243029a15f293556611b0a0d90b44a5b9eda
-SHA512 (swift-toolchain-sqlite-1.0.7.tar.gz) = 286c77daf11f95388c9cc31a4b416dac1a106d85b67ea942657821935557c8f8db9d96d90cf5c75b72ef4b8c8eba14eb8e9ce13f62cb10e71d22c3ac8fb505c1
-SHA512 (swift-tools-protocols-0.0.9.tar.gz) = cccca5abe4d16bd8300b9772801973b9cbb5669feeeff1f59cb38b6f6ebe708445722b39e1664101a80016f7572bd46449432d998d5323a2d05a35348bdf6d57
-SHA512 (swift-tools-support-core-swift-6.3.2-RELEASE.tar.gz) = a1559adc2e14b093ed7e3628be2735ff18a2f4c5413b97cddad417d61702985fa24d76dab38ebca182bb9492d027ec6501981d4356b24c2454a608978dbf9055
-SHA512 (swift-xcode-playground-support-swift-6.3.2-RELEASE.tar.gz) = 38857b44ae1631dfaee56a44733418b815156c30807efcc6e69c501241b61369eb6029344ab5ce6b11641a81f921c8583fb7532d204994d3954d746c54747d3c
-SHA512 (wasi-libc-wasi-sdk-27.tar.gz) = dfc2c36fabf32f465fc833ed0b10efffc9a35c68162ecc3e8d656d1d684d170b734d55e790614d12d925d17f49d60f0d2d01c46cecac941cf62d68eda84df13e
-SHA512 (WasmKit-0.1.6.tar.gz) = 2dda8f6366893dfef0209914b407b71574432e23d9631dc5ee8ceb294cbeec4412c80ec31ae7f37b1847f5ddeaf4c86ad5d03caa7a358a1d004f130afb59db8d
+SHA512 (swift-testing-swift-6.4.0-RELEASE.tar.gz) = 21b863d023d3a8bdb2cbc2e35b738508cfd715d2ae0c628ce0579a4205899253ced7219e2fef8de1c243d369e1eca7bef381112179cd6003deab1a4a0079528c
+SHA512 (swift-toolchain-sqlite-1.0.9.tar.gz) = 193d6af4e9f40ac212d9f4176a4766cdd334b86609fea28305eeabac95f94f5eb4ea29ec61f7edeae49724354f852cd9b990cd86fd77f0da3d43d13ee771d508
+SHA512 (swift-tools-protocols-swift-6.4.0-RELEASE.tar.gz) = 8b8fcf126d9b018ce360b79857662992d9b5932348b76d47fd9910f04893636db4d7b3e3dc0664fc28468284a60c6f41112ae0e667fc465ef9dbed123667a859
+SHA512 (swift-tools-support-core-swift-6.4.0-RELEASE.tar.gz) = c855cb8148aa05d543ee0281773a51e04225322421b29909c135a3a5b8b1b48def62936466c3f07c5d3d8435c56b3a5998ab6ca7f7dd6d48742a4e6140e58633
+SHA512 (swift-xcode-playground-support-swift-6.4.0-RELEASE.tar.gz) = 8dc461f76ab6b6dcf875677cf3c102852178ec0dfa7f2836c835348826ca348f4f5a369f39e88a5b3d3eaa7f257e6267380f3e15986319d472fcd888dd5aca91
+SHA512 (wasi-libc-wasi-sdk-31.tar.gz) = 4b7d02a7a33ab679db2f10f555730bb667c119feaf2d2fd0fff6576d5c38885c0d318d07a4adb61a14412110f5ec76f05acc499d125ed92e673cba6cbc715748
+SHA512 (WasmKit-0.3.1.tar.gz) = 09ee9d7764437a6cd195b91602259acda58daccf8f19e170f26d9fa87d58ca81624b1a1e8457b599aea0674f6deb41896134dd2ffaca38efa9a60930e0eacaa4
SHA512 (zlib-1.3.1.tar.gz) = 8c9642495bafd6fad4ab9fb67f09b268c69ff9af0f4f20cf15dfc18852ff1f312bd8ca41de761b3f8d8e90e77d79f2ccacd3d4c5b19e475ecf09d021fdfe9088
diff --git a/swift-build-ld-version-regex.patch b/swift-build-ld-version-regex.patch
new file mode 100644
index 0000000..3583c4d
--- /dev/null
+++ b/swift-build-ld-version-regex.patch
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Link Dupont <link@sub-pop.net>
+Date: Fri, 16 Oct 2026 00:00:00 +0000
+Subject: [PATCH] Accept bare GNU ld snapshot versions in linker detection
+
+Swift Build's GNU ld detection requires the version banner printed by
+`ld -version_details` to end in a dash-separated distro release suffix,
+e.g. "GNU ld version 2.41-28.fc43". Fedora Rawhide's binutils is
+currently a pre-release snapshot build and reports a bare dotted
+version with no such suffix, e.g. "GNU ld version 2.47.50.20260921".
+
+Neither existing regex matches that string, so linker discovery falls
+through to a JSON-parsing attempt that fails, raising a hard build
+error for every linker invocation and aborting the SwiftPM bootstrap
+build (RHBZ#2521988 follow-up).
+
+Make the trailing release suffix optional (using a non-capturing group
+so the regex's output type still unifies with its sibling in the same
+array) so both forms are accepted.
+---
+ Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift b/Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift
+index df54d54..76c93b0 100644
+--- a/Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift
++++ b/Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift
+@@ -1975,7 +1975,11 @@ public func discoveredLinkerToolsInfo(_ producer: any CommandProducer, _ delegat
+ let commandLine = [toolPath.str, "-version_details"]
+ return try await producer.discoveredCommandLineToolSpecInfo(delegate, nil, commandLine, { executionResult in
+ let gnuLD = [
+- #/GNU ld version (?<version>[\d.]+)-.*/#,
++ // Fedora/Rawhide pre-release snapshots of binutils report a bare dotted
++ // version with no "-release" suffix, e.g. "GNU ld version 2.47.50.20260921",
++ // so the trailing "-release" is optional here. Use a non-capturing group so
++ // the regex's output type still matches its sibling in this array.
++ #/GNU ld version (?<version>[\d.]+)(?:-.*)?/#,
+ #/GNU ld \(GNU Binutils.*\) (?<version>[\d.]+)/#,
+ ]
+ if let match = try gnuLD.compactMap({ try $0.firstMatch(in: String(decoding: executionResult.stdout, as: UTF8.self)) }).first {
+--
+2.56.0
diff --git a/swift-build-toolchain-layout.patch b/swift-build-toolchain-layout.patch
new file mode 100644
index 0000000..3a53167
--- /dev/null
+++ b/swift-build-toolchain-layout.patch
@@ -0,0 +1,208 @@
+From 955e4cbcef3825484af96dc1d1dcf0b54bed6402 Mon Sep 17 00:00:00 2001
+From: Robert Sturla <rsturla@redhat.com>
+Date: Sun, 20 Sep 2026 22:21:26 +0100
+Subject: [PATCH] Support flat Swift toolchain installation prefixes
+
+Swift Build assumes that a toolchain root contains usr/bin and usr/lib. This prevents SwiftPM from selecting a toolchain that uses a conventional flat prefix with bin and lib directories.
+
+Determine the installation prefix from the location of swiftc. Use that prefix for executable and library search paths, testing support, and compiler plug-ins. Preserve the existing /usr and /usr/local layouts and their search order.
+
+Accept the same flat prefix when the generic Unix platform discovers the Swift installation.
+---
+ Sources/SWBCore/Settings/Settings.swift | 6 +-
+ Sources/SWBCore/ToolchainRegistry.swift | 74 +++++++++++++++++----
+ Sources/SWBGenericUnixPlatform/Plugin.swift | 25 +++----
+ 3 files changed, 75 insertions(+), 30 deletions(-)
+
+diff --git a/Sources/SWBCore/Settings/Settings.swift b/Sources/SWBCore/Settings/Settings.swift
+index 5c531d0..8e51432 100644
+--- a/Sources/SWBCore/Settings/Settings.swift
++++ b/Sources/SWBCore/Settings/Settings.swift
+@@ -4739,12 +4739,12 @@ private class SettingsBuilder: ProjectMatchLookup {
+ }
+ }
+
+- let testingPluginsPath = "/usr/lib/swift/host/plugins/testing"
+ switch (ToolchainStyle(toolchain)) {
+ case let .xcode(isDefault):
+ // This target is using a built-in Xcode toolchain, and that should
+ // match the toolchain which was used to build the testing libraries
+ // this target is using, so it can use non-external plugin flags.
++ let testingPluginsPath = "/usr/lib/swift/host/plugins/testing"
+ let toolchainPathPrefix = isDefault ? "$(TOOLCHAIN_DIR)" : defaultToolchain.path.str
+ return ["-plugin-path", "\(toolchainPathPrefix)\(testingPluginsPath)"]
+ case .other:
+@@ -4752,7 +4752,9 @@ private class SettingsBuilder: ProjectMatchLookup {
+ // which were built using the XcodeDefault toolchain, but it's using
+ // a different toolchain itself. Use external plugin flags which
+ // reference plugins from the XcodeDefault toolchain.
+- return ["-external-plugin-path", "\(toolchain.path.str)\(testingPluginsPath)#\(toolchain.path.str)/usr/bin/swift-plugin-server"]
++ let testingPluginsPath = toolchain.installationPrefix.join("lib/swift/host/plugins/testing")
++ let pluginServerPath = toolchain.installationPrefix.join("bin/swift-plugin-server")
++ return ["-external-plugin-path", "\(testingPluginsPath.str)#\(pluginServerPath.str)"]
+ }
+ }
+
+diff --git a/Sources/SWBCore/ToolchainRegistry.swift b/Sources/SWBCore/ToolchainRegistry.swift
+index 2421228..b75d82b 100644
+--- a/Sources/SWBCore/ToolchainRegistry.swift
++++ b/Sources/SWBCore/ToolchainRegistry.swift
+@@ -47,6 +47,9 @@ public final class Toolchain: Hashable, Sendable {
+ /// The path of the toolchain.
+ public let path: Path
+
++ /// The installation prefix containing the toolchain's bin and lib directories.
++ let installationPrefix: Path
++
+ /// The display name of the toolchain.
+ public let displayName: String
+
+@@ -83,14 +86,19 @@ public final class Toolchain: Hashable, Sendable {
+ assert(!aliases.contains{ $0.lowercased() != $0 })
+ self.aliases = aliases
+
++ let installationPrefix = Self.findInstallationPrefix(toolchainPath: path, fs: fs)
+ self.path = path
++ self.installationPrefix = installationPrefix
+ self.displayName = displayName
+ self.defaultSettings = defaultSettings
+ self.overrideSettings = overrideSettings
+ self.defaultSettingsWhenPrimary = defaultSettingsWhenPrimary
+ self.executableSearchPaths = StackedSearchPath(paths: executableSearchPaths, fs: fs)
+ self.librarySearchPaths = StackedSearchPath(
+- paths: [path.join("usr/lib"), path.join("usr/local/lib")],
++ paths: Self.librarySearchPaths(
++ toolchainPath: path,
++ installationPrefix: installationPrefix
++ ),
+ fs: fs
+ )
+ let frameworkSearchPaths = frameworkPaths.map { path.join($0) }
+@@ -106,6 +114,47 @@ public final class Toolchain: Hashable, Sendable {
+ self.testingLibraryPlatformNames = testingLibraryPlatformNames
+ }
+
++ package static func findInstallationPrefix(toolchainPath: Path, fs: any FSProxy) -> Path {
++ let candidates = [
++ toolchainPath.join("usr"),
++ toolchainPath.join("usr/local"),
++ toolchainPath,
++ ]
++ return candidates.first { candidate in
++ fs.exists(candidate.join("bin/swiftc")) || fs.exists(candidate.join("bin/swiftc.exe"))
++ } ?? toolchainPath.join("usr")
++ }
++
++ package static func executableSearchPaths(
++ toolchainPath: Path,
++ installationPrefix: Path,
++ additionalPaths: [Path]
++ ) -> [Path] {
++ if installationPrefix == toolchainPath {
++ return [installationPrefix.join("bin")]
++ + additionalPaths
++ + [installationPrefix.join("libexec")]
++ }
++
++ return [toolchainPath.join("usr/bin")]
++ + additionalPaths
++ + [
++ toolchainPath.join("usr/local/bin"),
++ toolchainPath.join("usr/libexec"),
++ ]
++ }
++
++ package static func librarySearchPaths(toolchainPath: Path, installationPrefix: Path) -> [Path] {
++ if installationPrefix == toolchainPath {
++ return [installationPrefix.join("lib")]
++ }
++
++ return [
++ toolchainPath.join("usr/lib"),
++ toolchainPath.join("usr/local/lib"),
++ ]
++ }
++
+ convenience init(path: Path, operatingSystem: OperatingSystem, aliases additionalAliases: Set<String>, fs: any FSProxy, pluginManager: any PluginManager, platformRegistry: PlatformRegistry?, synthesizeMetadataIfNeeded: Bool) async throws {
+ let data: PropertyListItem
+
+@@ -289,21 +338,18 @@ public final class Toolchain: Hashable, Sendable {
+ defaultSettingsWhenPrimary["TOOLCHAIN_DIR"] = .plString(path.str)
+ defaultSettingsWhenPrimary["TOOLCHAIN_VERSION"] = .plString(version.description)
+
+- var executableSearchPaths = [
+- path.join("usr").join("bin"),
+- ]
+-
+- for platformExtension in pluginManager.extensions(of: PlatformInfoExtensionPoint.self) {
+- executableSearchPaths.append(contentsOf: platformExtension.additionalToolchainExecutableSearchPaths(toolchainIdentifier: identifier, toolchainPath: path))
++ let installationPrefix = Self.findInstallationPrefix(toolchainPath: path, fs: fs)
++ let additionalExecutableSearchPaths = pluginManager.extensions(of: PlatformInfoExtensionPoint.self).flatMap {
++ $0.additionalToolchainExecutableSearchPaths(toolchainIdentifier: identifier, toolchainPath: path)
+ }
+-
+- executableSearchPaths.append(contentsOf: [
+- path.join("usr").join("local").join("bin"),
+- path.join("usr").join("libexec")
+- ])
++ let executableSearchPaths = Self.executableSearchPaths(
++ toolchainPath: path,
++ installationPrefix: installationPrefix,
++ additionalPaths: additionalExecutableSearchPaths
++ )
+
+ // Testing library platform names
+- let testingLibrarySearchDir = path.join("usr").join("lib").join("swift")
++ let testingLibrarySearchDir = installationPrefix.join("lib").join("swift")
+ let testingLibraryPlatformNames: Set<String> = if let platformRegistry, fs.exists(testingLibrarySearchDir) {
+ Set(try fs.listdir(testingLibrarySearchDir).filter {
+ platformRegistry.lookup(name: $0) != nil && fs.exists(testingLibrarySearchDir.join($0).join("testing"))
+@@ -394,7 +440,7 @@ public final class Toolchain: Hashable, Sendable {
+
+ func testingLibrarySearchPath(forPlatformNamed platformName: String) -> Path? {
+ if testingLibraryPlatformNames.contains(platformName) {
+- path.join("usr").join("lib").join("swift").join(platformName).join("testing")
++ installationPrefix.join("lib").join("swift").join(platformName).join("testing")
+ } else {
+ nil
+ }
+diff --git a/Sources/SWBGenericUnixPlatform/Plugin.swift b/Sources/SWBGenericUnixPlatform/Plugin.swift
+index 2658c81..d46c301 100644
+--- a/Sources/SWBGenericUnixPlatform/Plugin.swift
++++ b/Sources/SWBGenericUnixPlatform/Plugin.swift
+@@ -62,22 +62,19 @@ struct GenericUnixDeveloperDirectoryExtension: DeveloperDirectoryExtension {
+ return nil
+ }
+
+- let realSwiftPath = try fs.realpath(swift).dirname.normalize()
+- let hasUsrBin = realSwiftPath.str.hasSuffix("/usr/bin")
+- let hasUsrLocalBin = realSwiftPath.str.hasSuffix("/usr/local/bin")
+- let path: Path
+- switch (hasUsrBin, hasUsrLocalBin) {
+- case (true, false):
+- path = realSwiftPath.dirname.dirname
+- case (false, true):
+- path = realSwiftPath.dirname.dirname.dirname
+- case (false, false):
+- throw StubError.error("Unexpected toolchain layout for Swift installation path: \(realSwiftPath)")
+- case (true, true):
+- preconditionFailure()
++ let binDir = try fs.realpath(swift).dirname.normalize()
++ guard binDir.basename == "bin" else {
++ throw StubError.error("Unexpected toolchain layout for Swift installation path: \(binDir)")
+ }
+
+- return .swiftToolchain(path, xcodeDeveloperPath: nil)
++ let installationPrefix = binDir.dirname
++ if installationPrefix.basename == "usr" {
++ return .swiftToolchain(installationPrefix.dirname, xcodeDeveloperPath: nil)
++ }
++ if installationPrefix.basename == "local", installationPrefix.dirname.basename == "usr" {
++ return .swiftToolchain(installationPrefix.dirname.dirname, xcodeDeveloperPath: nil)
++ }
++ return .swiftToolchain(installationPrefix, xcodeDeveloperPath: nil)
+ }
+ }
+
+--
+2.55.0
diff --git a/swift-corelibs-foundation.patch b/swift-corelibs-foundation.patch
deleted file mode 100644
index e69de29..0000000
--- a/swift-corelibs-foundation.patch
+++ /dev/null
diff --git a/swift-crypto-CVE-2026-43823.patch b/swift-crypto-CVE-2026-43823.patch
new file mode 100644
index 0000000..7141484
--- /dev/null
+++ b/swift-crypto-CVE-2026-43823.patch
@@ -0,0 +1,22 @@
+# Backport of upstream swift-crypto fix for CVE-2026-43823
+# https://github.com/apple/swift-crypto/commit/47d3869a7291f085c1fb9fb1e6d3b97a793f45c6
+# Adapted for swift-crypto 3.12.5 (_CryptoExtras path): remove duplicative
+# EVP_PKEY_free in catch blocks; deinit frees the pointer.
+--- swift-crypto/Sources/_CryptoExtras/RSA/RSA_boring.swift
++++ swift-crypto/Sources/_CryptoExtras/RSA/RSA_boring.swift
+@@ -226,7 +226,6 @@
+ }
+ CCryptoBoringSSL_EVP_PKEY_assign_RSA(self.pointer, rsaPublicKey)
+ } catch {
+- CCryptoBoringSSL_EVP_PKEY_free(self.pointer)
+ throw error
+ }
+ }
+@@ -268,7 +267,6 @@
+ }
+ CCryptoBoringSSL_EVP_PKEY_assign_RSA(self.pointer, rsaPublicKey)
+ } catch {
+- CCryptoBoringSSL_EVP_PKEY_free(self.pointer)
+ throw error
+ }
+ }
diff --git a/swift-driver-swiftscan-symlink.patch b/swift-driver-swiftscan-symlink.patch
new file mode 100644
index 0000000..e766c29
--- /dev/null
+++ b/swift-driver-swiftscan-symlink.patch
@@ -0,0 +1,42 @@
+From 9653e20962c1a8804695df11239e9cf90a6ba1cc Mon Sep 17 00:00:00 2001
+From: Robert Sturla <rsturla@redhat.com>
+Date: Sun, 20 Sep 2026 16:22:49 +0100
+Subject: [PATCH] [Driver] Resolve compiler symlinks for SwiftScan
+
+SwiftDriver derives the libSwiftScan path from the selected compiler.
+When a compiler is exposed through a symlink outside its toolchain, the
+lookup searches relative to the symlink instead of the installation.
+
+Resolve the compiler path before deriving the toolchain root. Keep the
+selected path as a fallback if symlink resolution fails.
+---
+ Sources/SwiftDriver/Toolchains/Toolchain.swift | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git swift-driver.orig/Sources/SwiftDriver/Toolchains/Toolchain.swift swift-driver/Sources/SwiftDriver/Toolchains/Toolchain.swift
+index af6b9669..51141b90 100644
+--- swift-driver.orig/Sources/SwiftDriver/Toolchains/Toolchain.swift
++++ swift-driver/Sources/SwiftDriver/Toolchains/Toolchain.swift
+@@ -17,6 +17,7 @@ import class Foundation.Bundle
+
+ import func TSCBasic.getEnvSearchPaths
+ import func TSCBasic.lookupExecutablePath
++import func TSCBasic.resolveSymlinks
+ import class TSCBasic.DiagnosticsEngine
+ import protocol TSCBasic.FileSystem
+ import struct TSCBasic.AbsolutePath
+@@ -280,8 +281,9 @@ extension Toolchain {
+ .appending(component: libraryName)
+ #else
+ let compilerPath = try getToolPath(.swiftCompiler)
+- let toolchainRootPath = compilerPath.parentDirectory // bin
+- .parentDirectory // toolchain root
++ let resolvedCompilerPath = (try? resolveSymlinks(compilerPath)) ?? compilerPath
++ let toolchainRootPath = resolvedCompilerPath.parentDirectory // bin
++ .parentDirectory // toolchain root
+
+ let searchPaths = [toolchainRootPath.appending(component: "lib")
+ .appending(component: "swift")
+--
+2.55.0
+
diff --git a/swift-foundation-memberimportvisibility.patch b/swift-foundation-memberimportvisibility.patch
new file mode 100644
index 0000000..14a4a7f
--- /dev/null
+++ b/swift-foundation-memberimportvisibility.patch
@@ -0,0 +1,72 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Fedora Swift Packaging <fedora-swift@fedoraproject.org>
+Date: Sun, 4 Oct 2026 20:29:35 -0400
+Subject: [PATCH] Fix MemberImportVisibility build failure on Linux
+
+Date.swift, FileManager+Basics.swift, and URL_Impl.swift use POSIX
+struct members (timespec, struct stat) on Glibc/Musl but only
+import Glibc/Musl. Because FoundationEssentials forces the
+_FoundationCShims module map to be loaded for the whole target, the
+Swift compiler attributes ownership of these members to
+_FoundationCShims instead of Glibc/Musl. With the upcoming
+MemberImportVisibility feature enabled, this causes build errors such
+as:
+
+ error: initializer 'init()' is not available due to missing
+ import of defining module '_FoundationCShims'
+ [#MemberImportVisibility]
+
+Add an explicit import of _FoundationCShims on the Glibc/Musl paths of
+these three files, matching the pattern already used in sibling files
+such as FileManager+Files.swift and UUID.swift.
+---
+ Sources/FoundationEssentials/Date.swift | 2 ++
+ .../FoundationEssentials/FileManager/FileManager+Basics.swift | 2 ++
+ Sources/FoundationEssentials/URL/URL_Impl.swift | 2 ++
+ 3 files changed, 6 insertions(+)
+
+diff --git a/Sources/FoundationEssentials/Date.swift b/Sources/FoundationEssentials/Date.swift
+index 45b4844..17c909d 100644
+--- a/Sources/FoundationEssentials/Date.swift
++++ b/Sources/FoundationEssentials/Date.swift
+@@ -16,8 +16,10 @@ import Darwin
+ @preconcurrency import Bionic
+ #elseif canImport(Glibc)
+ @preconcurrency import Glibc
++internal import _FoundationCShims
+ #elseif canImport(Musl)
+ @preconcurrency import Musl
++internal import _FoundationCShims
+ #elseif canImport(WinSDK)
+ import WinSDK
+ #elseif os(WASI)
+diff --git a/Sources/FoundationEssentials/FileManager/FileManager+Basics.swift b/Sources/FoundationEssentials/FileManager/FileManager+Basics.swift
+index 96ea0d2..c852763 100644
+--- a/Sources/FoundationEssentials/FileManager/FileManager+Basics.swift
++++ b/Sources/FoundationEssentials/FileManager/FileManager+Basics.swift
+@@ -16,8 +16,10 @@ import Darwin
+ @preconcurrency import Android
+ #elseif canImport(Glibc)
+ @preconcurrency import Glibc
++internal import _FoundationCShims
+ #elseif canImport(Musl)
+ @preconcurrency import Musl
++internal import _FoundationCShims
+ #elseif os(Windows)
+ import CRT
+ import WinSDK
+diff --git a/Sources/FoundationEssentials/URL/URL_Impl.swift b/Sources/FoundationEssentials/URL/URL_Impl.swift
+index 91ed72c..0c96a15 100644
+--- a/Sources/FoundationEssentials/URL/URL_Impl.swift
++++ b/Sources/FoundationEssentials/URL/URL_Impl.swift
+@@ -16,8 +16,10 @@ import Darwin
+ @preconcurrency import Android
+ #elseif canImport(Glibc)
+ @preconcurrency import Glibc
++internal import _FoundationCShims
+ #elseif canImport(Musl)
+ @preconcurrency import Musl
++internal import _FoundationCShims
+ #elseif os(Windows)
+ import WinSDK
+ #elseif os(WASI)
diff --git a/swift-lang.spec b/swift-lang.spec
index 92beeef..3ace2bf 100644
--- a/swift-lang.spec
+++ b/swift-lang.spec
@@ -6,7 +6,18 @@
%global debug_package %{nil}
%undefine _auto_set_build_flags
-Version: 6.3.2
+# By default, build using a previously installed Swift toolchain (from
+# BuildRequires) as the host compiler to build the compiler's own
+# Swift-in-Swift sources. This is fast, but depends on swift-lang already
+# being available.
+#
+# Pass --with bootstrap to instead perform the full four-stage, from-scratch
+# C++ bootstrap (stage0 -> stage1 -> stage2 -> fedora_final), which does not
+# require any previously built swift-lang. Use this when bootstrapping a new
+# architecture, or recovering when no prior swift-lang build is available.
+%bcond bootstrap 0
+
+Version: 6.4.0
# Main swift source and version
%global forgeurl0 https://github.com/swiftlang/swift
@@ -47,9 +58,6 @@ Version: 6.3.2
%global tag8 swift-%{version0}-RELEASE
%global subdir8 swift-lmdb
-%global forgeurl9 https://github.com/KitWare/CMake
-%global tag9 v3.30.2
-%global subdir9 cmake
%global forgeurl10 https://github.com/apple/swift-collections
%global tag10 1.1.6
@@ -80,11 +88,11 @@ Version: 6.3.2
%global subdir16 libxml2
%global forgeurl17 https://github.com/swiftlang/swift-toolchain-sqlite
-%global tag17 1.0.7
+%global tag17 1.0.9
%global subdir17 swift-toolchain-sqlite
%global forgeurl18 https://github.com/WebAssembly/wasi-libc
-%global tag18 wasi-sdk-27
+%global tag18 wasi-sdk-31
%global subdir18 wasi-libc
%global forgeurl19 https://github.com/swiftlang/swift-format
@@ -100,16 +108,13 @@ Version: 6.3.2
%global subdir21 swift-llvm-bindings
%global forgeurl22 https://github.com/swiftwasm/WasmKit
-%global tag22 0.1.6
+%global tag22 0.3.1
%global subdir22 wasmkit
%global forgeurl23 https://github.com/swiftlang/swift-syntax
%global tag23 swift-%{version0}-RELEASE
%global subdir23 swift-syntax
-%global forgeurl24 https://github.com/ninja-build/ninja
-%global tag24 v1.13.1
-%global subdir24 ninja
%global forgeurl25 https://github.com/swiftlang/swift-corelibs-libdispatch
%global tag25 swift-%{version0}-RELEASE
@@ -144,7 +149,7 @@ Version: 6.3.2
%global subdir32 swift-stress-tester
%global forgeurl33 https://github.com/apple/swift-nio
-%global tag33 2.65.0
+%global tag33 2.92.2
%global subdir33 swift-nio
%global forgeurl34 https://github.com/swiftlang/indexstore-db
@@ -212,7 +217,7 @@ Version: 6.3.2
%global subdir49 swift-docc
%global forgeurl50 https://github.com/swiftlang/swift-tools-protocols
-%global tag50 0.0.9
+%global tag50 swift-%{version0}-RELEASE
%global subdir50 swift-tools-protocols
%global forgeurl51 https://github.com/swiftlang/swift-corelibs-blocksruntime
@@ -220,13 +225,17 @@ Version: 6.3.2
%global subdir51 swift-corelibs-blocksruntime
%global forgeurl52 https://github.com/google/brotli
-%global tag52 v1.1.0
+%global tag52 v1.2.0
%global subdir52 brotli
%global forgeurl53 https://github.com/swiftlang/swift-subprocess
-%global tag53 0.2.1
+%global tag53 0.4
%global subdir53 swift-subprocess
+%global forgeurl54 https://github.com/google/boringssl
+%global tag54 817ab07ebb53da35afea409ab9328f578492832d
+%global subdir54 boringssl
+
# End forge sources
Name: swift-lang
@@ -238,7 +247,7 @@ License: Apache-2.0
URL: https://www.swift.org
%{lua:
-for i = 0, 53 do
+for i = 0, 54 do
local forgesource = rpm.expand("%{?forgesource" .. i .. "}")
if forgesource ~= "" then
print("Source" .. i .. ": " .. forgesource .. "\n")
@@ -249,18 +258,32 @@ Source99: swiftlang.conf
Source100: fedora-presets.ini
# NOTE: The patch number corresponds to the source it's packaging. For example,
-# Patch25 is patching Source25, swift-foundation.
+# Patch25 is patching Source25. The 01 suffix marks a second patch for the same source.
Patch0: swift.patch
Patch44: llvm-project.patch
Patch15: cmark.patch
Patch5: llbuild.patch
Patch7: swiftpm.patch
Patch13: swift-foundation.patch
+Patch1301: swift-foundation-memberimportvisibility.patch
Patch25: swift-corelibs-libdispatch.patch
-Patch9: cmake.patch
+Patch42: swift-crypto-CVE-2026-43823.patch
+Patch3501: swift-build-toolchain-layout.patch
+Patch3502: swift-build-ld-version-regex.patch
+Patch1101: swift-driver-swiftscan-symlink.patch
+Patch701: swiftpm-toolchain-layout.patch
BuildRequires: clang
+BuildRequires: cmake
+BuildRequires: ninja-build
BuildRequires: swig
+%if !%{with bootstrap}
+# The compiler's own Swift-in-Swift sources are built with a previously
+# released host compiler. Bounded above by %{version} so we never bootstrap
+# off a newer release than the one being built. Not needed with
+# --with bootstrap, which builds a host compiler from scratch in stage0.
+BuildRequires: (swift-lang >= 6.3.2 with swift-lang <= %{version})
+%endif
BuildRequires: rsync
BuildRequires: python3
BuildRequires: python3-devel
@@ -333,7 +356,7 @@ applications built with Swift.
%forgesetup -a
cd %{builddir}
%{lua:
-for i = 0, 53 do
+for i = 0, 54 do
local subdir = rpm.expand("%{?subdir" .. i .. "}")
if subdir ~= "" then
print(rpm.expand("mv %{archivename" .. i .. "} " .. subdir .. "\n"))
@@ -347,8 +370,13 @@ end
%patch 5
%patch 7
%patch 13
+%patch 1301 -p1 -d swift-foundation
%patch 25
-%patch 9
+%patch 42
+%patch 3501 -p1 -d swift-build
+%patch 3502 -p1 -d swift-build
+%patch 1101 -p1 -d swift-driver
+%patch 701 -p1 -d swiftpm
# Install custom Fedora preset
cp %{SOURCE100} swift/utils/fedora-presets.ini
@@ -365,6 +393,7 @@ export VERBOSE=1
export CFLAGS="-O2 -g -fno-builtin-logf"
export CXXFLAGS="-O2 -g -fno-builtin-logf"
+%if %{with bootstrap}
# Four-stage bootstrap to build Swift from scratch without external Swift compiler
# Stage 0: Build minimal Swift toolchain from C++ using gold linker
# Produces: Swift compiler with C++ legacy driver (no SwiftPM, no swift-driver)
@@ -375,7 +404,7 @@ export CXXFLAGS="-O2 -g -fno-builtin-logf"
# Stage 2: Build Swift compiler using Stage 1 with lld linker
# Produces: Swift compiler + SwiftPM + basic tools (still no swift-driver)
# Stage 2 clang defaults to lld
-# Stage 3: Build final production toolchain using Stage 2
+# Stage 3 (below): Build final production toolchain using Stage 2
# Produces: Complete toolchain with swift-driver, sourcekit-lsp, swift-format, etc.
# This matches upstream first-party distributions
@@ -405,8 +434,22 @@ export PATH=%{_builddir}/stage1/usr/bin:%{_builddir}/stage0/usr/bin:$PATH
extra-cmake-options="-DLLVM_USE_LINKER=lld -DCLANG_DEFAULT_LINKER=ld.lld" \
swift-cmake-options="-DSWIFT_USE_LINKER=lld"
-echo "=== Stage 3: Building final production toolchain with swift-driver ==="
export PATH=%{_builddir}/stage2/usr/bin:%{_builddir}/stage1/usr/bin:%{_builddir}/stage0/usr/bin:$PATH
+%else
+# Use the previously released Swift toolchain (from BuildRequires) as the host
+# compiler to build the compiler's own Swift-in-Swift sources. Pass
+# --with bootstrap to instead perform a full from-scratch C++ bootstrap (see
+# above), which does not require any previously built swift-lang.
+for swift_host_bin in %{_libexecdir}/swift/*/bin; do
+ if [ -x "$swift_host_bin/swiftc" ]; then
+ export PATH="$swift_host_bin:$PATH"
+ break
+ fi
+done
+command -v swiftc
+%endif
+
+echo "=== Building production toolchain ==="
%{builddir}/swift/utils/build-script --preset=fedora_final \
--preset-file=%{builddir}/swift/utils/fedora-presets.ini \
build_subdir=fedora_final \
@@ -432,7 +475,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
cp -a %{_builddir}/usr/bin/* %{buildroot}%{_libexecdir}/swift/%{version}/bin/
# Create symlinks in %{_bindir} for user-facing tools
-TOOLS="swift swiftc swift-build swift-run swift-package swift-test sourcekit-lsp swift-format swift-demangle"
+TOOLS="swift swiftc swift-build swift-run swift-package swift-test sourcekit-lsp swift-format swift-demangle swift-autolink-extract"
for tool in ${TOOLS}; do
if [ -f %{buildroot}%{_libexecdir}/swift/%{version}/bin/$tool ]; then
ln -sf %{_libexecdir}/swift/%{version}/bin/$tool %{buildroot}%{_bindir}/$tool
@@ -518,6 +561,12 @@ if [ -d %{_builddir}/usr/share/swift ]; then
cp -a %{_builddir}/usr/share/swift/* %{buildroot}%{_datadir}/swift/
fi
+# Install SwiftPM resources beside the relocated toolchain
+if [ -d %{_builddir}/usr/share/pm ]; then
+ mkdir -p %{buildroot}%{_libexecdir}/swift/%{version}/share/pm
+ cp -a %{_builddir}/usr/share/pm/. %{buildroot}%{_libexecdir}/swift/%{version}/share/pm/
+fi
+
# Install man pages
if [ -f %{_builddir}/usr/share/man/man1/swift.1 ]; then
install -m 0644 %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/man1/
@@ -548,6 +597,7 @@ export QA_SKIP_RPATHS=1
%{_bindir}/sourcekit-lsp
%{_bindir}/swift-format
%{_bindir}/swift-demangle
+%{_bindir}/swift-autolink-extract
# Man pages
%{_mandir}/man1/swift.1.gz
diff --git a/swiftpm-toolchain-layout.patch b/swiftpm-toolchain-layout.patch
new file mode 100644
index 0000000..cae4467
--- /dev/null
+++ b/swiftpm-toolchain-layout.patch
@@ -0,0 +1,406 @@
+From 100066564a7f875d736563419f03916eeedcbccd Mon Sep 17 00:00:00 2001
+From: Robert Sturla <rsturla@redhat.com>
+Date: Sun, 20 Sep 2026 22:25:31 +0100
+Subject: [PATCH] Resolve toolchain paths through compiler symlinks
+
+### Motivation
+
+SwiftPM assumes that sibling tools and resources are installed relative to the path used to invoke the Swift compiler. This breaks when a public compiler path, such as /usr/bin/swiftc, is a symlink into a complete toolchain under another prefix. Lookup can then miss the selected toolchain or use an unrelated system tool.
+
+### Modifications
+
+Resolve the selected compiler before deriving paths owned by its toolchain. Search the resolved compiler directory before the public directory while preserving configured toolset order and the public path as a fallback.
+
+Use these paths for adjacent tools, the Swift interpreter, plug-in tool searches, SwiftPM configuration and libraries, host SDK tools, index-store loading, and Linux compiler-owned resources. Derive the Swift Build toolchain path from a resolved <prefix>/bin layout while preserving the existing /usr and /usr/local behavior.
+
+### Result
+
+SwiftPM uses tools and resources from the installation that owns the selected compiler. Existing non-symlinked, /usr, and /usr/local layouts keep their current behavior.
+---
+ .../ClangModuleBuildDescription.swift | 6 +-
+ Sources/Build/BuildPlan/BuildPlan.swift | 2 +-
+ .../PackageCommands/PluginCommand.swift | 4 +-
+ Sources/CoreCommands/SwiftCommandState.swift | 2 +-
+ .../DriverSupport/DriverSupportUtils.swift | 2 +-
+ Sources/PackageModel/Toolchain.swift | 87 +++++++++++++++----
+ Sources/PackageModel/UserToolchain.swift | 41 ++++++---
+ Sources/SwiftBuildSupport/PIFBuilder.swift | 2 +-
+ .../SwiftSDKCommand/ConfigureSwiftSDK.swift | 2 +-
+ Sources/SwiftSDKCommand/InstallSwiftSDK.swift | 2 +-
+ Sources/SwiftSDKCommand/ListSwiftSDKs.swift | 2 +-
+ Sources/SwiftSDKCommand/RemoveSwiftSDK.swift | 2 +-
+ 12 files changed, 108 insertions(+), 46 deletions(-)
+
+diff --git a/Sources/Build/BuildDescription/ClangModuleBuildDescription.swift b/Sources/Build/BuildDescription/ClangModuleBuildDescription.swift
+index ffe0bae92..445b99bc8 100644
+--- a/Sources/Build/BuildDescription/ClangModuleBuildDescription.swift
++++ b/Sources/Build/BuildDescription/ClangModuleBuildDescription.swift
+@@ -399,10 +399,8 @@ public final class ClangModuleBuildDescription {
+ // On Linux/Android swift-corelibs-foundation depends on dispatch library which is
+ // currently shipped with the Swift toolchain.
+ if (triple.isLinux() || triple.isAndroid()) && self.package.id == .plain("swift-corelibs-foundation") {
+- let swiftCompilerPath = self.buildParameters.toolchain.swiftCompilerPath
+- let toolchainResourcesPath = swiftCompilerPath.parentDirectory
+- .parentDirectory
+- .appending(components: ["lib", "swift"])
++ let toolchainResourcesPath = try self.buildParameters.toolchain.toolchainLibDir
++ .appending("swift")
+ args += ["-I", toolchainResourcesPath.pathString]
+ }
+
+diff --git a/Sources/Build/BuildPlan/BuildPlan.swift b/Sources/Build/BuildPlan/BuildPlan.swift
+index 1960c4ed3..dcd7528c4 100644
+--- a/Sources/Build/BuildPlan/BuildPlan.swift
++++ b/Sources/Build/BuildPlan/BuildPlan.swift
+@@ -829,7 +829,7 @@ extension BuildPlan {
+ scriptRunner: configuration.scriptRunner,
+ workingDirectory: package.path,
+ outputDirectory: pluginOutputDir,
+- toolSearchDirectories: [buildParameters.toolchain.swiftCompilerPath.parentDirectory],
++ toolSearchDirectories: buildParameters.toolchain.compilerBinDirectories,
+ accessibleTools: accessibleTools,
+ writableDirectories: writableDirectories,
+ readOnlyDirectories: readOnlyDirectories,
+diff --git a/Sources/Commands/PackageCommands/PluginCommand.swift b/Sources/Commands/PackageCommands/PluginCommand.swift
+index 9d75f055f..3b625573b 100644
+--- a/Sources/Commands/PackageCommands/PluginCommand.swift
++++ b/Sources/Commands/PackageCommands/PluginCommand.swift
+@@ -326,8 +326,8 @@ struct PluginCommand: AsyncSwiftCommand {
+ let readOnlyDirectories = writableDirectories
+ .contains { package.path.isDescendantOfOrEqual(to: $0) } ? [] : [package.path]
+
+- // Use the directory containing the compiler as an additional search directory, and add the $PATH.
+- let toolSearchDirs = [try swiftCommandState.getTargetToolchain().swiftCompilerPath.parentDirectory]
++ // Use the toolchain bin directories as additional search directories, and add the $PATH.
++ let toolSearchDirs = try swiftCommandState.getTargetToolchain().compilerBinDirectories
+ + getEnvSearchPaths(pathString: Environment.current[.path], currentWorkingDirectory: .none)
+
+ var buildParameters = try swiftCommandState.toolsBuildParameters
+diff --git a/Sources/CoreCommands/SwiftCommandState.swift b/Sources/CoreCommands/SwiftCommandState.swift
+index 453d08464..30ec8c6f5 100644
+--- a/Sources/CoreCommands/SwiftCommandState.swift
++++ b/Sources/CoreCommands/SwiftCommandState.swift
+@@ -1139,7 +1139,7 @@ public final class SwiftCommandState {
+
+ let store = SwiftSDKBundleStore(
+ swiftSDKsDirectory: self.sharedSwiftSDKsDirectory,
+- hostToolchainBinDir: hostToolchain.swiftCompilerPath.parentDirectory,
++ hostToolchainBinDir: hostToolchain.resolvedSwiftCompilerBinDir,
+ fileSystem: self.fileSystem,
+ observabilityScope: self.observabilityScope,
+ outputHandler: { print($0.description) }
+diff --git a/Sources/DriverSupport/DriverSupportUtils.swift b/Sources/DriverSupport/DriverSupportUtils.swift
+index 1f7ccfadd..8c06eebc3 100644
+--- a/Sources/DriverSupport/DriverSupportUtils.swift
++++ b/Sources/DriverSupport/DriverSupportUtils.swift
+@@ -44,7 +44,7 @@ public enum DriverSupport {
+ args: ["swiftc"],
+ executor: executor,
+ compilerIntegratedTooling: false,
+- compilerExecutableDir: TSCAbsolutePath(toolchain.swiftCompilerPath.parentDirectory)
++ compilerExecutableDir: TSCAbsolutePath(toolchain.resolvedSwiftCompilerBinDir)
+ )
+ let supportedFlagSet = Set(driver.supportedFrontendFlags.map { $0.trimmingCharacters(in: ["-"]) })
+ flagsMap.put([swiftcPathString + "-frontend": supportedFlagSet])
+diff --git a/Sources/PackageModel/Toolchain.swift b/Sources/PackageModel/Toolchain.swift
+index 93d19bf55..07081c768 100644
+--- a/Sources/PackageModel/Toolchain.swift
++++ b/Sources/PackageModel/Toolchain.swift
+@@ -88,6 +88,52 @@ public protocol Toolchain {
+ }
+
+ extension Toolchain {
++ package var resolvedSwiftCompilerBinDir: AbsolutePath {
++ Self.resolvedSwiftCompilerBinDir(swiftCompilerPath)
++ }
++
++ package static func resolvedSwiftCompilerBinDir(_ swiftCompilerPath: AbsolutePath) -> AbsolutePath {
++ ((try? resolveSymlinks(swiftCompilerPath)) ?? swiftCompilerPath).parentDirectory
++ }
++
++ package var compilerBinDirectories: [AbsolutePath] {
++ Self.compilerBinDirectories(swiftCompilerPath: swiftCompilerPath)
++ }
++
++ package static func compilerBinDirectories(swiftCompilerPath: AbsolutePath) -> [AbsolutePath] {
++ let compilerBinDir = swiftCompilerPath.parentDirectory
++ let resolvedCompilerBinDir = resolvedSwiftCompilerBinDir(swiftCompilerPath)
++ return resolvedCompilerBinDir == compilerBinDir
++ ? [compilerBinDir]
++ : [resolvedCompilerBinDir, compilerBinDir]
++ }
++
++ package var toolchainBinDirectories: [AbsolutePath] {
++ Self.toolchainBinDirectories(swiftCompilerPath: swiftCompilerPath, swiftSDK: swiftSDK)
++ }
++
++ package static func toolchainBinDirectories(
++ swiftCompilerPath: AbsolutePath,
++ swiftSDK: SwiftSDK
++ ) -> [AbsolutePath] {
++ let compilerBinDir = swiftCompilerPath.parentDirectory
++ var binDirectories: [AbsolutePath] = []
++ for rootPath in swiftSDK.toolset.rootPaths {
++ let candidates = rootPath == compilerBinDir
++ ? compilerBinDirectories(swiftCompilerPath: swiftCompilerPath)
++ : [rootPath]
++ for candidate in candidates where !binDirectories.contains(candidate) {
++ binDirectories.append(candidate)
++ }
++ }
++ for candidate in compilerBinDirectories(swiftCompilerPath: swiftCompilerPath)
++ where !binDirectories.contains(candidate)
++ {
++ binDirectories.append(candidate)
++ }
++ return binDirectories
++ }
++
+ public func _isClangCompilerVendorApple() throws -> Bool? {
+ return nil
+ }
+@@ -111,24 +157,27 @@ extension Toolchain {
+ /// Toolchain path that's given to Swift Build to determine whether the compiler needs to be overridden.
+ public var toolchainDir: AbsolutePath {
+ get throws {
+- let compilerPath = try resolveSymlinks(swiftCompilerPath)
+- let os = ProcessInfo.hostOperatingSystem
+- switch os {
+- case .windows, .macOS, .linux, .android:
+- return compilerPath
+- .parentDirectory // bin
+- .parentDirectory // usr
+- .parentDirectory // <toolchain>
+- case .freebsd, .openbsd:
+- return compilerPath
+- .parentDirectory // bin
+- .parentDirectory // local
+- .parentDirectory // usr
+- .parentDirectory // <toolchain>
+- case .unknown:
+- throw UnknownToolchainLayout(os: os)
+- }
++ try Self.toolchainDir(swiftCompilerPath: swiftCompilerPath)
++ }
++ }
++
++ package static func toolchainDir(swiftCompilerPath: AbsolutePath) throws -> AbsolutePath {
++ let compilerPath = try resolveSymlinks(swiftCompilerPath)
++ let binDir = compilerPath.parentDirectory
++ guard binDir.basename == "bin" else {
++ throw UnknownToolchainLayout(path: binDir)
++ }
++
++ let installationPrefix = binDir.parentDirectory
++ if installationPrefix.basename == "usr" {
++ return installationPrefix.parentDirectory
++ }
++ if installationPrefix.basename == "local",
++ installationPrefix.parentDirectory.basename == "usr"
++ {
++ return installationPrefix.parentDirectory.parentDirectory
+ }
++ return installationPrefix
+ }
+
+ public var toolchainLibDir: AbsolutePath {
+@@ -164,8 +213,8 @@ extension Toolchain {
+ }
+
+ struct UnknownToolchainLayout: Error, CustomStringConvertible {
+- let os: OperatingSystem
++ let path: AbsolutePath
+ var description: String {
+- "Unknown toolchain layout for host operating system: \(os)"
++ "Unexpected toolchain layout for Swift installation path: \(path)"
+ }
+ }
+diff --git a/Sources/PackageModel/UserToolchain.swift b/Sources/PackageModel/UserToolchain.swift
+index 0bf36ad50..0c3e5f18d 100644
+--- a/Sources/PackageModel/UserToolchain.swift
++++ b/Sources/PackageModel/UserToolchain.swift
+@@ -70,7 +70,11 @@ public final class UserToolchain: Toolchain {
+
+ /// Path of the `swift` interpreter.
+ public var swiftInterpreterPath: AbsolutePath {
+- self.swiftCompilerPath.parentDirectory.appending("swift" + hostExecutableSuffix)
++ let interpreterName = "swift" + hostExecutableSuffix
++ let resolvedPath = self.resolvedSwiftCompilerBinDir.appending(interpreterName)
++ return self.fileSystem.exists(resolvedPath)
++ ? resolvedPath
++ : self.swiftCompilerPath.parentDirectory.appending(interpreterName)
+ }
+
+ private let fileSystem: any FileSystem
+@@ -461,7 +465,7 @@ public final class UserToolchain: Toolchain {
+ // Then, check the toolchain.
+ if let toolPath = try? UserToolchain.getTool(
+ "clang",
+- binDirectories: self.swiftSDK.toolset.rootPaths,
++ binDirectories: self.toolchainBinDirectories,
+ fileSystem: self.fileSystem
+ ) {
+ self._clangCompiler = toolPath
+@@ -494,7 +498,7 @@ public final class UserToolchain: Toolchain {
+ // Look for LLDB next to the compiler first.
+ if let lldbPath = try? UserToolchain.getTool(
+ "lldb",
+- binDirectories: [self.swiftCompilerPath.parentDirectory],
++ binDirectories: self.compilerBinDirectories,
+ fileSystem: self.fileSystem
+ ) {
+ return lldbPath
+@@ -512,7 +516,7 @@ public final class UserToolchain: Toolchain {
+ public func getLLVMCov() throws -> AbsolutePath {
+ try UserToolchain.getTool(
+ "llvm-cov",
+- binDirectories: [self.swiftCompilerPath.parentDirectory],
++ binDirectories: self.compilerBinDirectories,
+ fileSystem: self.fileSystem
+ )
+ }
+@@ -521,7 +525,7 @@ public final class UserToolchain: Toolchain {
+ public func getLLVMProf() throws -> AbsolutePath {
+ try UserToolchain.getTool(
+ "llvm-profdata",
+- binDirectories: [self.swiftCompilerPath.parentDirectory],
++ binDirectories: self.compilerBinDirectories,
+ fileSystem: self.fileSystem
+ )
+ }
+@@ -530,7 +534,7 @@ public final class UserToolchain: Toolchain {
+ package func getLLVMObjdump() throws -> AbsolutePath {
+ try UserToolchain.getTool(
+ "llvm-objdump",
+- binDirectories: [self.swiftCompilerPath.parentDirectory],
++ binDirectories: self.compilerBinDirectories,
+ fileSystem: self.fileSystem
+ )
+ }
+@@ -545,7 +549,7 @@ public final class UserToolchain: Toolchain {
+ }
+ return try UserToolchain.getTool(
+ "swift-api-digester",
+- binDirectories: [self.swiftCompilerPath.parentDirectory],
++ binDirectories: self.compilerBinDirectories,
+ fileSystem: self.fileSystem
+
+ )
+@@ -561,7 +565,7 @@ public final class UserToolchain: Toolchain {
+ }
+ return try UserToolchain.getTool(
+ "swift-symbolgraph-extract",
+- binDirectories: [self.swiftCompilerPath.parentDirectory],
++ binDirectories: self.compilerBinDirectories,
+ fileSystem: self.fileSystem
+ )
+ }
+@@ -797,9 +801,13 @@ public final class UserToolchain: Toolchain {
+ if let customInstalledSwiftPMConfiguration {
+ self.installedSwiftPMConfiguration = customInstalledSwiftPMConfiguration
+ } else {
+- let path = swiftCompilerPath.parentDirectory.parentDirectory.appending(components: [
+- "share", "pm", "config.json",
+- ])
++ let paths = Self.compilerBinDirectories(swiftCompilerPath: swiftCompilerPath).map {
++ $0.parentDirectory.appending(components: ["share", "pm", "config.json"])
++ }
++ let path = paths.first(where: fileSystem.exists)
++ ?? swiftCompilerPath.parentDirectory.parentDirectory.appending(components: [
++ "share", "pm", "config.json",
++ ])
+ self.installedSwiftPMConfiguration = try Self.loadJSONResource(
+ config: path,
+ type: InstalledSwiftPMConfiguration.self,
+@@ -889,7 +897,10 @@ public final class UserToolchain: Toolchain {
+
+ self.librarianPath = try swiftSDK.toolset.knownTools[.librarian]?.path ?? UserToolchain.determineLibrarian(
+ triple: triple,
+- binDirectories: swiftSDK.toolset.rootPaths,
++ binDirectories: Self.toolchainBinDirectories(
++ swiftCompilerPath: swiftCompilers.compile,
++ swiftSDK: swiftSDK
++ ),
+ useXcrun: useXcrun,
+ environment: environment,
+ searchPaths: envSearchPaths,
+@@ -1022,7 +1033,11 @@ public final class UserToolchain: Toolchain {
+ // an alternative cloud be to force explicit locations to always be set explicitly when running in Xcode/SwiftPM
+ // debug and assert if not set but we detect that we are in this mode
+
+- for applicationPath in swiftSDK.toolset.rootPaths {
++ let binDirectories = Self.toolchainBinDirectories(
++ swiftCompilerPath: swiftCompilerPath,
++ swiftSDK: swiftSDK
++ )
++ for applicationPath in binDirectories {
+ // this is the normal case when using the toolchain
+ let librariesPath = applicationPath.parentDirectory.appending(components: "lib", "swift", "pm")
+ if fileSystem.exists(librariesPath) {
+diff --git a/Sources/SwiftBuildSupport/PIFBuilder.swift b/Sources/SwiftBuildSupport/PIFBuilder.swift
+index c2188377a..04b83a181 100644
+--- a/Sources/SwiftBuildSupport/PIFBuilder.swift
++++ b/Sources/SwiftBuildSupport/PIFBuilder.swift
+@@ -350,7 +350,7 @@ public final class PIFBuilder {
+ scriptRunner: pluginScriptRunner,
+ workingDirectory: package.path,
+ outputDirectory: pluginOutputDir,
+- toolSearchDirectories: [buildParameters.toolchain.swiftCompilerPath.parentDirectory],
++ toolSearchDirectories: buildParameters.toolchain.compilerBinDirectories,
+ accessibleTools: accessibleTools,
+ writableDirectories: writableDirectories,
+ readOnlyDirectories: readOnlyDirectories,
+diff --git a/Sources/SwiftSDKCommand/ConfigureSwiftSDK.swift b/Sources/SwiftSDKCommand/ConfigureSwiftSDK.swift
+index 5e3b0e3b2..ccde2ed21 100644
+--- a/Sources/SwiftSDKCommand/ConfigureSwiftSDK.swift
++++ b/Sources/SwiftSDKCommand/ConfigureSwiftSDK.swift
+@@ -122,7 +122,7 @@ struct ConfigureSwiftSDK: AsyncParsableCommand {
+ do {
+ let bundleStore = SwiftSDKBundleStore(
+ swiftSDKsDirectory: swiftSDKsDirectory,
+- hostToolchainBinDir: hostToolchain.swiftCompilerPath.parentDirectory,
++ hostToolchainBinDir: hostToolchain.resolvedSwiftCompilerBinDir,
+ fileSystem: self.fileSystem,
+ observabilityScope: observabilityScope,
+ outputHandler: { print($0) }
+diff --git a/Sources/SwiftSDKCommand/InstallSwiftSDK.swift b/Sources/SwiftSDKCommand/InstallSwiftSDK.swift
+index f5b7ae0ce..283dc692e 100644
+--- a/Sources/SwiftSDKCommand/InstallSwiftSDK.swift
++++ b/Sources/SwiftSDKCommand/InstallSwiftSDK.swift
+@@ -59,7 +59,7 @@ struct InstallSwiftSDK: SwiftSDKSubcommand {
+
+ let store = SwiftSDKBundleStore(
+ swiftSDKsDirectory: swiftSDKsDirectory,
+- hostToolchainBinDir: hostToolchain.swiftCompilerPath.parentDirectory,
++ hostToolchainBinDir: hostToolchain.resolvedSwiftCompilerBinDir,
+ fileSystem: self.fileSystem,
+ observabilityScope: observabilityScope,
+ outputHandler: { print($0.description) },
+diff --git a/Sources/SwiftSDKCommand/ListSwiftSDKs.swift b/Sources/SwiftSDKCommand/ListSwiftSDKs.swift
+index 9e19b4711..1ec48eb10 100644
+--- a/Sources/SwiftSDKCommand/ListSwiftSDKs.swift
++++ b/Sources/SwiftSDKCommand/ListSwiftSDKs.swift
+@@ -38,7 +38,7 @@ package struct ListSwiftSDKs: SwiftSDKSubcommand {
+ ) throws {
+ let store = SwiftSDKBundleStore(
+ swiftSDKsDirectory: swiftSDKsDirectory,
+- hostToolchainBinDir: hostToolchain.swiftCompilerPath.parentDirectory,
++ hostToolchainBinDir: hostToolchain.resolvedSwiftCompilerBinDir,
+ fileSystem: fileSystem,
+ observabilityScope: observabilityScope,
+ outputHandler: { print($0.description) }
+diff --git a/Sources/SwiftSDKCommand/RemoveSwiftSDK.swift b/Sources/SwiftSDKCommand/RemoveSwiftSDK.swift
+index 5e8c61530..d69322059 100644
+--- a/Sources/SwiftSDKCommand/RemoveSwiftSDK.swift
++++ b/Sources/SwiftSDKCommand/RemoveSwiftSDK.swift
+@@ -48,7 +48,7 @@ package struct RemoveSwiftSDK: SwiftSDKSubcommand {
+ } else {
+ let bundleStore = SwiftSDKBundleStore(
+ swiftSDKsDirectory: swiftSDKsDirectory,
+- hostToolchainBinDir: hostToolchain.swiftCompilerPath.parentDirectory,
++ hostToolchainBinDir: hostToolchain.resolvedSwiftCompilerBinDir,
+ fileSystem: self.fileSystem,
+ observabilityScope: observabilityScope,
+ outputHandler: { print($0) }
+--
+2.55.0
reply other threads:[~2026-10-19 10:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179240562900.1.13553395482196249594.rpms-swift-lang-e41d1bd68424@fedoraproject.org \
--to=link@sub-pop.net \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox