Commit Graph

91 Commits

Author SHA1 Message Date
Emily
002e6194af Revert "swiftPackages.swift-unwrapped: fix darwin build"
The ld64 issue has been fixed.

This reverts commit 401b87c97d.
2026-07-15 03:26:25 +01:00
sempiternal-aurora
401b87c97d swiftPackages.swift-unwrapped: fix darwin build 2026-07-02 17:43:33 +10:00
Emily
997d97b109 swiftPackages.stdenv: use the default standard environment
Swift now works fine with standard environments using GCC or other
versions of LLVM. Some packages, like components of Swift itself or
others that combine Swift with features like C++ modules or C blocks,
may still need to use an LLVM‐based standard environment, but we
do not need to enforce a uniform `swiftPackages.stdenv` any more.
2025-09-02 05:52:52 +01:00
Emily
2153141b51 swiftPackages.*: build with the default LLVM version 2025-09-02 04:14:28 +01:00
Ihar Hrachyshka
dd0f03a56c treewide: remove usage of deprecated apple_sdk framework stubs
They are not doing anything right now. This is in preparation for their
complete removal from the tree.

Note: several changes that affect the derivation inputs (e.g. removal of
references to stub paths in build instructions) were left out. They will
be cleaned up the next iteration and will require special care.

Note: this PR is a result of a mix of ugly regex (not AST) based
automation and some manual labor. For reference, the regex automation
part was hacked in: https://github.com/booxter/nix-clean-apple_sdk

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-04-19 20:28:20 -04:00
Emily
793706e9e6 swiftpm: remove old Darwin SDK pattern detritus 2025-01-03 17:41:02 +00: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
1279654765 swift: set Foundation to null on Darwin 2024-10-10 17:24:27 -04:00
Randy Eckenrode
9a260e6903 swift: use overrideLibcxx instead of a manual override 2024-10-10 17:24:27 -04:00
Randy Eckenrode
0e9fe46444 swift: drop unnecessary overrides
These are no longer needed with the new Darwin SDK. xcbuild will
automatically use the correct SDK for the stdenv.
2024-10-10 17:24:27 -04:00
Randy Eckenrode
38402a036b swift: update comments 2024-10-10 17:24:27 -04:00
Randy Eckenrode
7c0c8fd74a swift: build Swift with associated SDK version
Swift releases are associated with particular Darwin SDK versions. They
don’t _have_ to use that version, but it makes sense to use that version
by default. The deployment target is set to the supported Swift minimum
versions. Unlike C and C++, Swift requires you to availability
annotations, so propagating a newer SDK should be safe.
2024-10-10 01:07:17 -04:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
github-actions[bot]
f316203fda Merge staging-next into staging 2024-07-19 00:03:05 +00:00
Randy Eckenrode
f9b7f4ec09 tree-wide: use top-level cctools 2024-07-17 22:36:19 -04:00
Anderson Torres
2709408a33 swiftpm2nix: migrate to Swift suite directory
Since they are from the same team.
2024-07-17 23:34:17 -03:00
Sam
f86158cd9a Revert "swift: don't pass -march to swiftc"
This reverts commit 8a7841ceef.
2024-04-02 21:42:01 -07:00
annalee
8ead81a60f Merge remote-tracking branch 'upstream/master' into staging-next 2024-03-17 07:18:11 +00:00
annalee
8a7841ceef swift: don't pass -march to swiftc
swiftc uses cc-wrapper which sets the -march flag on some systems which
breaks the build. This change adds a flag, disableMarch, to cc-wrapper
which disables using the -march flag.
https://github.com/NixOS/nixpkgs/issues/295322
2024-03-16 11:02:44 +00:00
a-n-n-a-l-e-e
ce789e7e35 llvmPackages_{12,13,14,15,16,17,git}.{libcxx,libcxxabi}: merge libcxxabi into libcxx (#292043)
- merge libcxxabi into libcxx for LLVM 12, 13, 14, 15, 16, 17, and git.
- remove the link time workaround `-lc++ -lc++abi` from 58 packages as it is no longer required.
- fixes https://github.com/NixOS/nixpkgs/issues/166205
- provides alternative fixes for. https://github.com/NixOS/nixpkgs/issues/269548 https://github.com/NixOS/nix/issues/9640
- pkgsCross.x86_64-freebsd builds work again

This change can be represented in 3 stages
1. merge libcxxabi into libcxx -- files: pkgs/development/compilers/llvm/[12, git]/{libcxx, libcxxabi}
2. update stdenv to account for merge -- files: stdenv.{adapters, cc.wrapper, darwin}
3. remove all references to libcxxabi outside of llvm (about 58 packages modified)

### merging libcxxabi into libcxx
- take the union of the libcxxabi and libcxx cmake flags
- eliminate the libcxx-headers-only package - it was only needed to break libcxx <-> libcxxabi circular dependency
- libcxx.cxxabi is removed. external cxxabi (freebsd) will symlink headers / libs into libcxx.
- darwin will re-export the libcxxabi symbols into libcxx so linking `-lc++` is sufficient.
- linux/freebsd `libc++.so` is a linker script `LINK(libc++.so.1, -lc++abi)` making `-lc++` sufficient.
- libcxx/default.nix [12, 17] are identical except for patches and `LIBCXX_ADDITIONAL_LIBRARIES` (only used in 16+)
- git/libcxx/defaul.nix  does not link with -nostdlib when useLLVM is true so flag is removed. this is not much different than before as libcxxabi used -nostdlib where libcxx did not, so libc was linked in anyway.

### stdenv changes
- darwin bootstrap, remove references to libcxxabi and cxxabi
- cc-wrapper: remove c++ link workaround when libcxx.cxxabi doesn't exist (still exists for LLVM pre 12)
- adapter: update overrideLibcxx to account for a pkgs.stdenv that only has libcxx

### 58 package updates
- remove `NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}` as no longer needed
- swift, nodejs_v8 remove libcxxabi references in the clang override

https://github.com/NixOS/nixpkgs/pull/292043
2024-03-11 03:53:37 -07:00
Adam Joseph
80472e3754 treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
Randy Eckenrode
efdf4e9d1f swift: use stdenv libc++ on Darwin
Swift uses libc++ 15, but it should really be using the same libc++ from
the stdenv. While not strictly needed currently, Swift 5.9 will support
C++ interop. If Swift is not using the stdenv C++, any C++ library used
with interop would need to be rebuilt against the Swift libc++.
2023-08-04 22:21:10 -04:00
Stéphan Kochen
1f5b379683 swift-format: init at 5.8 2023-05-06 19:40:08 +02:00
Stéphan Kochen
f85d12198f swift: 5.7.3 -> 5.8 2023-04-30 15:03:20 +02:00
Stéphan Kochen
7220d26ed5 swift: bootstrap using system stdlib
`BOOTSTRAPPING-WITH-HOSTLIBS` is also what official builds use on
Darwin. It's unclear why `BOOTSTRAPPING` was working before, but it is
probably not supported on Darwin to begin with. It was now causing
crashes because of mixing of two copies of stdlib at run-time.
2023-01-22 10:36:11 +01:00
Stéphan Kochen
d63aef6c47 swift-docc: init at 5.7 2022-10-10 21:26:50 +02:00
Stéphan Kochen
ce2dd8b8de sourcekit-lsp: init at 5.7 2022-10-10 21:26:50 +02:00
Stéphan Kochen
dcb0eaf66d swift-driver: init at 5.7 2022-10-10 21:26:50 +02:00
Stéphan Kochen
ece9224c8a swiftpm: init at 5.7 2022-10-10 21:26:50 +02:00
Stéphan Kochen
0b877d85e5 swiftPackages.XCTest: init at 5.7 2022-10-10 21:26:50 +02:00
Stéphan Kochen
89f9790858 swiftPackages.Foundation: init at 5.7 2022-10-10 21:26:50 +02:00
Stéphan Kochen
3c54a5dce6 swiftPackages.Dispatch: 5.5 -> 5.7 2022-10-10 21:26:49 +02:00
Stéphan Kochen
8ed924c07a swift: compiler only build & darwin support 2022-10-10 21:26:47 +02:00
Martin Weinelt
3cedef1b6a swift: fix build with libxcrypt 2022-10-09 18:14:34 +02:00
Andreas Stührk
4c5110be76 swift: add myself as maintainer 2022-08-22 22:54:53 +02:00
Andreas Stührk
2004e2a97d swift: 5.5.3 -> 5.6.2 2022-08-22 22:54:52 +02:00
Rick van Schijndel
cd19a0e7b4 swift: mark broken 2022-05-30 13:42:59 +02:00
Ben Siraphob
259fa13d53 treewide: remove nativeBuildInputs that are in stdenv 2022-04-16 21:46:46 +03:00
Felix Buehler
783d2679e5 treewide: rename name to pname&version 2022-03-08 13:24:25 +01:00
Daniel Duan
1b854ecdba swift: 5.5.2 -> 5.5.3
5.5.3 is a patch release specific for Linux and Windows. I build the Nix
  expression locally to verify all tests from the toolchain passed.
2022-02-09 22:23:06 -08:00
Daniel Duan
eedda29425 swift: 5.4.2 -> 5.5.2
Update Swift version.
2022-01-29 18:42:02 -08:00
Connor Brewster
9ce1ca6400 Use lib.makeLibraryPath 2021-12-08 11:15:13 -06:00
Connor Brewster
7ff4e9a588 swift: Fix libuuid path in LIBRARY_PATH that was causing a test failure 2021-12-07 11:10:30 -06:00
Ryan Burns
cac89e1501 swift: fix build
since the linuxHeaders bump to 5.14,
we need to patch out cyclades.h includes
2021-10-22 00:34:30 -07:00
Tom Repetti
b2d4ec4323 swift: 5.1.1 -> 5.4.2 2021-08-10 12:10:43 -04:00
Robert Schütz
3780fbeda2 swift: mark as broken
No successful build on Hydra since 2020-12-23.
2021-01-29 22:59:37 +01:00
Robert Schütz
26cde7b2d3 swift: mark as insecure 2021-01-29 22:59:01 +01:00
volth
bc0d605cf1 treewide: fix double quoted strings in meta.description
Signed-off-by: Ben Siraphob <bensiraphob@gmail.com>
2021-01-24 19:56:59 +07:00
Ben Siraphob
acc5f7b18a pkgs/development/compilers: stdenv.lib -> lib 2021-01-23 08:57:37 +07:00
Jonathan Ringer
9bb3fccb5b treewide: pkgs.pkgconfig -> pkgs.pkg-config, move pkgconfig to alias.nix
continuation of #109595

pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.

python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
2021-01-19 01:16:25 -08:00