Commit Graph

226 Commits

Author SHA1 Message Date
Emily
828d2d79fe swiftPackages.Foundation: backport patches for modern LLVM 2025-09-02 04:09:46 +01:00
Emily
3b773c7bae swiftPackages.Dispatch: backport patch for modern LLVM 2025-09-02 04:09:46 +01:00
Emily
e0d9c9386f swiftPackages.swift-unwrapped: backport patches for modern LLVM 2025-09-02 04:09:46 +01:00
Emily
810bed0854 swiftPackages.swift-unwrapped: vendor Clang patch
The versions of `llvmPackages` that require this patch are going
away soon.
2025-09-02 04:09:46 +01:00
Emily
efde96d9be swiftPackages.swift-unwrapped: drop unnecessary mkdir
Honestly I did this in the middle of trying things and then forgot
about it, and I just don’t feel like bootstrapping the whole thing
again to drop this commit.
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
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Charlotte 🦝 Deleńkec
61593a72a0 swift: throw on unsupported arch 2025-07-11 22:09:01 -05:00
Olivér Falvai
024f70f64d swift: use Python 3.12
https://hydra.nixos.org/build/299109156

Per the release notes: https://docs.python.org/3/whatsnew/3.13.html

> Remove the PyEval_ThreadsInitialized() function, deprecated in Python 3.9. Since Python 3.7, Py_Initialize() always creates the GIL: calling PyEval_InitThreads() does nothing and PyEval_ThreadsInitialized() always returns non-zero.
2025-06-03 18:43:25 +02:00
Jörg Thalheim
d8c42f6f2f swift: use aarch64 instead of arm64 on Linux (#404263) 2025-05-05 12:33:28 +02:00
Michael Hoang
e3895dafc9 swift: use aarch64 instead of arm64 on Linux 2025-05-05 13:06:42 +10:00
K900
f96ac2dcd6 Merge remote-tracking branch 'origin/master' into staging-next 2025-04-26 09:07:48 +03:00
Fernando Rodrigues
05580f4b44 treewide: switch instances of lib.teams.*.members to the new meta.teams attribute
Follow-up to #394797.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2025-04-25 22:20:17 -03:00
Emily
4c6d3b0724 darwin.swift-corelibs-foundation: drop
Broken since at least 24.11, stuck on a version from 2018, and no
longer relevant with the new SDK pattern. A newer version is packaged
separately for the Swift compiler, so maybe it could be revived there
if people clamour for a source‐built CoreFoundation in the future.
2025-04-20 23:19:16 +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
61582c7043 lib/systems: use Darwin architecture names for config and uname
`aarch64-apple-darwin` no longer works with LLVM 20.
2025-04-02 21:22:47 +01:00
Silvan Mosberger
374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
Peder Bergebakken Sundt
5aba99242e treewide: fix typos in comments
Made with

```shell
git restore .
fd '\.nix$' pkgs/ --type f -j1 -x bash -xc "$(cat <<"EOF"
    typos --no-check-filenames --write-changes "$1"
    git diff --exit-code "$1" && exit
    #( git diff "$1" | grep -qE "^\+ +[^# ]") && git restore "$1"
    count1="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> ' | wc -l )"
    count2="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> (<span style="color:#f8f8f2;"> *</span>)?<span style="color:#75715e;">.*</span>$' | wc -l )"
    [[ $count1 -ne $count2 ]] && git restore "$1"
EOF
)" -- {}
```

and filtered with `GIT_DIFF_OPTS='--unified=15' git -c interactive.singleKey=true add --patch`

I initially tried using the tree-sitter cli, python bindings and even ast-grep through various means, but this is what I ended up with.
2025-02-24 10:44:41 +01:00
Wolfgang Walther
b19d0f6d3d treewide: replace substituteAll with replaceVars 2025-02-10 22:51:56 +01:00
Emily
793706e9e6 swiftpm: remove old Darwin SDK pattern detritus 2025-01-03 17:41:02 +00:00
Emily
6240f6c3e3 swiftpm: remove code for macOS < 11 2025-01-03 17:41:02 +00:00
Emily
e05898e313 swift: remove code for macOS < 11 2025-01-03 17:41:02 +00:00
Emily
a9ae918dcc swift: source darwin-sdk-setup.bash (#360207) 2024-12-28 22:13:36 +00:00
sternenseemann
a0a35b6c24 Fix cross eval issues (#362546) 2024-12-14 22:14:52 +01:00
Artturin
276fe40ff3 swift: Fix eval failure error: expected a string but found null: null
Dunno if this is correct, there's other `hostPlatform.isDarwin`
conditionals which may be wrong.

Leaving the other conditionals to swift maintainers or people who are
interested in swift cross-compilation

```
$ nix repl --file . --system aarch64-darwin
nix-repl> pkgsCross.aarch64-multiplatform.swift
«derivation /nix/store/kqbaqwdfc9g0yvkq4ffrlqspranprlmy-swift-wrapper-aarch64-unknown-linux-gnu-5.8.drv»

nix-repl> pkgsCross.aarch64-multiplatform.buildPackages.swift
error:
       error: expected a string but found null: null
       at /home/artturin/nixgits/my-nixpkgs/.worktree/2/pkgs/development/compilers/swift/compiler/default.nix:586:11:
          585|         #WATCHOS_SIMULATOR
          586|       }.${targetPlatform.darwinPlatform}}
             |           ^
          587|
```
2024-12-12 21:09:56 +02: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
c578c48b7f swift: source darwin-sdk-setup.bash
Fixes builds using xcbuild that redefine SDKROOT in the xcbuild wrapper.
SDKROOT will be set using the same logic that other wrappers use.
2024-11-29 14:46:00 -05:00
Olivér Falvai
cfc3088edc swiftpm2nix: use nurl instead of nix-prefetch-git 2024-11-23 21:02:14 +01:00
Masum Reza
e13831335f treewide: stdenv.is -> stdenv.hostPlatform.is (#356363)
* treewide: stdenv.is -> stdenv.hostPlatform.is

* treewide: nixfmt due to ci error
2024-11-17 16:11:54 +05:30
Zhong Jianxin
8dfed1b9a4 swift: Workaround Hydra darwin build problem
Fail to build with ninja 1.12 when NIX_BUILD_CORES is low (Hydra or Github Actions):

```
ld: warning: directory not found for option '-L/nix/store/g9rbp9m6vs1xj4jl6b6vjb6bm8kgr107-SDKs/MacOSX10.15.sdk/usr/lib/swift'
...
ld: warning: Could not find or use auto-linked library 'swiftCompatibility56'
Undefined symbols for architecture arm64:
  "__swift_FORCE_LOAD_$_swiftCompatibility56", referenced from:
      __swift_FORCE_LOAD_$_swiftCompatibility56_$_Optimizer in libswiftCompilerModules-bootstrapping1.a(Optimizer.o)
  ...
```

Can reproduce using `nix --option cores 2 build -f . swiftPackages.swift-unwrapped`.

Until we find out the exact cause, follow [swift upstream][1], pin ninja to version
1.11.1.

[1]: https://github.com/swiftlang/swift/pull/72989
2024-11-08 12:31:09 +08:00
Randy Eckenrode
f4af7eacc4 swiftpm: use darwinMinVersionHook to set the deployment target 2024-10-10 17:24:27 -04: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
15331b1c32 swift: use cctools.libtool directly 2024-10-10 01:07:17 -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
Randy Eckenrode
083d02ffc4 swift: drop libarclite
libarclite is needed to support ARC on very old deployment targets
(10.10 and older). None of these deployment targets are supported
deployment targets in nixpkgs, especially for Swift. This removes the
need to package the command-line tools executables.
2024-10-10 01:07:17 -04:00
Randy Eckenrode
4d080bdf16 swift: add cctools.libtool as a native build input on Darwin 2024-10-10 01:07:17 -04:00
Randy Eckenrode
1ad3206aea swift: clean up ncurses and libedit references 2024-10-10 01:07:17 -04:00
Randy Eckenrode
cf0003e56f swift: fix build with the new Darwin SDK
Swift’s build makes a few assumptions about how the SDK is set up that
are not true anymore with the new SDK. Fix it to find the SDK at
`$SDKROOT` and copy additional stubs it needs to bootstrap.
2024-10-10 01:07:17 -04:00
Randy Eckenrode
7d5f19a354 swift-wrapper: set up Darwin SDK paths for Swift 2024-10-10 01:07:16 -04:00
Artturin
f0e657f3b1 Merge branch 'master' into staging-next 2024-09-25 06:05:01 +03: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]
34de158a5f Merge staging-next into staging 2024-09-13 00:13:45 +00:00
Emily
b4bfb99048 swift: disable zerocallusedregs on all AArch64 2024-09-12 18:39:57 +01:00
Emily
6bbe65701d swift: add LLVM patches for SWIG 4 2024-09-12 18:11:01 +01:00
Wolfgang Walther
fc37487ab2 swiftpm: shellcheck setup hook 2024-09-08 22:06:41 +02:00
Wolfgang Walther
9df84d4c9a swiftpm: support structuredAttrs in setup hook
Currently no problematic package using multiple swiftpmFlags in nixpkgs
to test.
2024-09-08 22:06:41 +02:00
Tristan Ross
f9c6960071 swift: use clang 12 purity patch
LLVM 14's clang purity patch was removed as it is a duplicate of 12's.
2024-08-09 15:20:56 -07:00