Commit Graph

14 Commits

Author SHA1 Message Date
Ihar Hrachyshka
58a38b9adb swift: strip -mtls-dialect=gnu2 from clang wrapper (#542332) 2026-08-14 03:56:48 +00:00
JD Flamm
0c841ee8da swift: strip -mtls-dialect=gnu2 from clang wrapper
Guard the substituteInPlace that strips -mtls-dialect=gnu2 with
lib.optionalString so it only runs when the flag could actually
be present:

  targetPlatform.isLinux && targetPlatform.isx86
  && lib.versionAtLeast (lib.getVersion clang) "19.1"

This matches the condition the cc-wrapper uses when adding the
flag, preventing breakage on Darwin and aarch64-linux where the
option does not exist in the wrapper scripts.

Assisted-by: OpenClaw (friendli/zai-org/GLM-5.2)
2026-08-13 09:08:56 -06:00
Stefan Frijters
9137a7cd08 swift: do not use passAsFile for buildCommand
This is not necessary (stdenv uses either buildCommand or buildCommandPath,
depending on what's available), but it is confusing since it's not explicitly
used and would not work if structuredAttrs is enabled.
2026-08-11 18:22:18 +02:00
Emily
6d91911139 Revert "swiftPackages.swift{,NoSwiftDriver}: work around ld64 hardening issue"
The ld64 issue has been fixed.

This reverts commit eb22b856d1.
2026-07-15 03:26:25 +01:00
Emily
eb22b856d1 swiftPackages.swift{,NoSwiftDriver}: work around ld64 hardening issue 2026-07-04 20:06:51 +01:00
Emily
37cad5dfd5 swiftPackages.swift{,-unwrapped}: get libc++ headers from Swift’s LLVM
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-02 04:14:28 +01:00
Emily
809f7d037c swiftPackages.swift{,-unwrapped,-driver}: ignore $NIX_CC
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-02 04:09:46 +01:00
Emily
0ec026a14a swift.tests.cxx-interop-test: init
I used this to verify the libc++ changes.
2025-09-02 04:09:46 +01:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
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 a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Randy Eckenrode
7d5f19a354 swift-wrapper: set up Darwin SDK paths for Swift 2024-10-10 01:07:16 -04:00
Felix Buehler
cdb39a86e0 treewide: use optionalString 2023-02-13 21:52:34 +01:00
Stéphan Kochen
72ba293675 swift: remove internal wrapperParams arg 2022-11-21 11:15:01 +01:00
Stéphan Kochen
dcb0eaf66d swift-driver: init at 5.7 2022-10-10 21:26:50 +02:00
Stéphan Kochen
8ed924c07a swift: compiler only build & darwin support 2022-10-10 21:26:47 +02:00