summaryrefslogtreecommitdiff
path: root/pkgs/development/compilers/swift/wrapper
AgeCommit message (Collapse)Author
2026-02-10swift.swift: fix linux buildDavid McFarland
2025-11-09swiftPackages.swift: prefix unguarded-availability flag with -XccSam
The Swift wrapper uses a hook directly from cc-wrapper to set the `-target` flag appropriately. This works because Clang and Swift use the same syntax for `-target`, but there was never a guarantee that this compatibility would be true for every option set in the hook. Indeed, commit 369cc5c66b1efdbca2f136aa0055fedca1117304 (PR #445119) made availability warnings into errors by setting the `-Werror=unguarded-availability` flag in this hook, which Swift doesn't accept at the top level. This caused all invocations of Swift to fail with the error `unknown argument: '-Werror=unguarded-availability'` - including the bootstrap Swift, which meant that `swiftPackages.swift` would fail. This commit adds all `-Werror` flags to the list of flags that need to be prefixed with `-Xcc`. I could have just dropped the flag, since Swift already makes this an error, but you can have C/C++ targets in Swift packages and we'd want to pass this flag on to them. (I'm not sure whether the clang used for those targets is already wrapped, but if it is there is no harm done.)
2025-10-10swiftPackages.swift: check for modern CXX interop flag in wrapperSam
This check is what determines whether the appropriate CFLAGS are set so that Swift can find the C++ headers it needs for interop
2025-09-02swiftPackages.swift{,-unwrapped}: get libc++ headers from Swift’s LLVMEmily
libc++ only supports a limited range of Clang versions, so this was relying on the LLVM version corresponding to the one used in Swift’s fork. Since Swift builds its own LLVM 15 anyway, we can simply install the required libc++ headers along with it.
2025-09-02swiftPackages.swift{,-unwrapped,-driver}: ignore `$NIX_CC`Emily
Swift needs Clang to link with. The linker patch breaks linking when using Swift with a GCC‐based standard environment. Similarly, the internal Clang headers in the resource directory are coupled to the corresponding version of Clang. The resource root patch caused Swift’s Clang to use the resource directory from the version of Clang used in the build environment, which is only compatible if the versions match. Instead, hard‐code the Clang path in the patches and wrappers.
2025-09-02swift.tests.cxx-interop-test: initEmily
I used this to verify the libc++ changes.
2024-12-28swift: source darwin-sdk-setup.bash (#360207)Emily
2024-12-10treewide: format all inactive Nix filesSilvan Mosberger
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \ --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7 result/bin/apply-formatting $NIXPKGS_PATH
2024-11-29swift: source darwin-sdk-setup.bashRandy Eckenrode
Fixes builds using xcbuild that redefine SDKROOT in the xcbuild wrapper. SDKROOT will be set using the same logic that other wrappers use.
2024-10-10swift-wrapper: set up Darwin SDK paths for SwiftRandy Eckenrode
2024-06-15clang: don't set machine flags for overridden targetAlyssa Ross
We already did this for -march in 12b0e8ac74f8 ("clang: don't set -march for overridden target"), but it should have been done for all machine flags, for the same reason. Example bug this fixes: nix-shell -E ' with import ./. { crossSystem = { system = "powerpc64le-linux"; gcc.cpu = "power10"; }; }; clangStdenv.mkDerivation { name = "test"; } ' --run '$CC -target wasm32-unknown-unknown -c /dev/null' Which previously failed with: clang: error: unsupported option '-mcpu=' for target 'wasm32-unknown-unknown'
2024-04-02swiftc: pass -Xcc before -marchSam
2023-04-30swift: 5.7.3 -> 5.8Stéphan Kochen
2023-02-13treewide: use optionalStringFelix Buehler
2022-11-21swift: remove internal wrapperParams argStéphan Kochen
2022-10-10swift-driver: init at 5.7Stéphan Kochen
2022-10-10swift: compiler only build & darwin supportStéphan Kochen