Commit Graph

130 Commits

Author SHA1 Message Date
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
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
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
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
Anderson Torres
7246208bc7 treewide: update meta.maintainers for Swift suite 2024-07-17 23:34:16 -03:00
Anderson Torres
2a9a026118 treewide: add lib.teams.swift.members to Swift suite 2024-07-17 23:34:16 -03:00
Anderson Torres
c9f7d60011 treewide: remove dtzWill as maintainer [no orphans]
Since theey is not active in a long span of time.

None of the packages in this commit are orphan.

All the packages listed here are related to Swift programming language compiler
suite.
2024-07-17 23:34:16 -03:00
David McFarland
514d22d117 swift: mark as unbroken on darwin 2024-07-12 13:09:06 -03:00
David McFarland
a5373e00f0 swift: disable zerocallusedregs hardening
Fixes: #320900
2024-07-12 13:09:06 -03:00
Vladimír Čunát
25c945df28
swift: fixup build after upgrade to python-3.12
https://hydra.nixos.org/build/264423982/nixlog/4/tail
I tested only building on x86_64-linux.
2024-07-06 09:00:37 +02:00
Martin Weinelt
fda13875da Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
- pkgs/development/python-modules/deebot-client/default.nix
- pkgs/development/python-modules/pytest-examples/default.nix
- pkgs/development/python-modules/w3lib/default.nix
2024-07-05 13:04:01 +02:00
Guanran Wang
b9d5f7ca1e
swift: mark as broken on darwin (#324593) 2024-07-04 20:37:41 -04:00
Alyssa Ross
6f756b4065 clang: don't set machine flags for overridden target
We already did this for -march in 12b0e8ac74 ("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-06-15 08:02:29 +02:00
Alexis Hildebrandt
f8c4a98e8e treewide: Remove the definite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"([Tt]he)? ' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Tt]he (.)/\1\U\2/'
2024-06-09 23:08:46 +02:00
Peder Bergebakken Sundt
db15bbc3d5
treewide: remove unreferenced patch files (#308127)
Found with `fd \\.patch$ pkgs/ -x bash -c 'rg -F "{/}" pkgs/ -q || echo {}'`
2024-05-02 12:41:45 +00:00
Sam
f86158cd9a
Revert "swift: don't pass -march to swiftc"
This reverts commit 8a7841ceef.
2024-04-02 21:42:01 -07:00
Sam
9fd2efac08
swiftc: pass -Xcc before -march 2024-04-02 21:41:45 -07:00
Vladimír Čunát
ddc361cfca
Merge #287594: glibc: 2.38-44 -> 2.39-5
...into staging
2024-03-24 06:41:49 +01:00
Martin Weinelt
3321e63b12
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
- pkgs/development/python-modules/sphinx-autobuild/default.nix
2024-03-19 04:00:32 +01:00
stuebinm
ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01: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
Maximilian Bosch
2dcdf60272
swift: fix build w/ glibc-2.39
Failing Hydra build: https://hydra.nixos.org/build/249763077/nixlog/12

The problem is that glibc commit
64b1a44183a3094672ed304532bedb9acc707554 marked the `FILE*` argument of a few
functions including `fread` & `ferror` as non-null. The applied patch
("Android: add better nullability checks for nullability annotations added in NDK 26")
is targeted for the Android platform, but fixes said issue as well: the
handle returned from `fopen` is of type `Optional<T>` and the `guard`
expression unwraps that now (and throws an exception if `nil` is
returned). The previous `nil`-check didn't modify the type of `fp`, but
only raised the exception and moved on with `Optional<T>`.

It's a little sad that the patch needs to be applied at so many places,
but I guess that's what you get with language-level package managers 🤷
Also, seems good-enough to me given that it's actually temporary, the
patch is already upstream and will probably be obsolete at one of the
next Swift updates.
2024-03-02 19:01:51 +01:00
Weijia Wang
a291d04a15
Merge pull request #269015 from paveloom/swiftpm
swift: force-unwrap file handles in `swift-tools-support-core`
2024-01-13 22:47:23 +01:00
Pavel Sobolev
92e04e12ca
swift-format: force-unwrap file handles in swift-tools-support-core 2024-01-12 19:30:33 +00:00
Pavel Sobolev
d231730525
sourcekit-lsp: force-unwrap file handles in swift-tools-support-core 2024-01-12 18:54:21 +00:00
Sergei Trofimovich
e5ec997164 swift: fix build against gcc-13
Without the change `swift` build fails on bundled `llvm` on
`staging-next` as:

    In file included from /build/src/llvm-project/llvm/lib/Support/Signals.cpp:14:
    /build/src/llvm-project/llvm/include/llvm/Support/Signals.h:119:24:
        error: unknown type name 'uintptr_t'; did you mean '__intptr_t'?
      void CleanupOnSignal(uintptr_t Context);
                           ^~~~~~~~~
                           __intptr_t

THe change pulls in upstream fix.
2024-01-03 19:54:04 +00:00
zimbatm
19ea7859af swift-format: add meta.mainProgram 2024-01-02 22:20:19 +01:00
Adam Joseph
80472e3754 treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
Pavel Sobolev
647e9c8668
swift-driver: force-unwrap file handles in swift-tools-support-core 2023-11-21 21:49:21 +03:00
Pavel Sobolev
56aa31d0b4
swiftpm: force-unwrap file handles in swift-tools-support-core 2023-11-21 21:19:55 +03:00
Maximilian Bosch
e016224a79
swiftPackages.Foundation: fix build w/ glibc-2.38
Failing Hydra build: https://hydra.nixos.org/build/236210473
2023-09-27 14:36:44 +02:00
Randy Eckenrode
e7cf9a7c45
swift: update for cc-wrapper changes
The Swift compiler derivation modifies the clang wrapper to use
`exec -a "$0"` to allow it to use the same binary for both `clang` and
`clang++`. The sed script it uses to do this fails after the cc-wrapper
changes in 6f2b3ba027 were merged.

This is fixed by updating `makeClangWrapper` to work with the cc-wrapper
changes by having Bash invoke a simple script that uses `exec -a "$0"`
to set the required name for clang.

This fixes the staging-next build failures with Swift on Darwin and Linux.

https://github.com/NixOS/nixpkgs/pull/248496#issuecomment-1676831102
2023-08-20 00:17:10 -04: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
Weijia Wang
9362b60a80
Merge pull request #234901 from figsoda/flags
treewide: convert *Flags to a list
2023-05-30 06:12:27 +03:00
figsoda
f7f0512311 swiftPackages.swift-docc: convert swiftFlags to a list 2023-05-29 20:16:22 -04:00
figsoda
34233107b9 swift-format: convert swiftpmFlags to a list 2023-05-29 20:15:20 -04:00
figsoda
c05fa24286 sourcekit-lsp: move pkg-config to nativeBuildInputs 2023-05-29 19:52:22 -04:00
figsoda
8733c5536e swiftpm: move pkg-config to nativeBuildInputs 2023-05-29 19:51:01 -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
cc2738c71a swift: reduce closure size of swift-lib 2023-03-15 19:08:38 +01:00
Felix Buehler
cdb39a86e0 treewide: use optionalString 2023-02-13 21:52:34 +01:00
Stéphan Kochen
72fa71720b swiftpm: disable -index-store-path Apple extension 2023-02-01 08:29:36 +01:00
Stéphan Kochen
a34a8db902 swift: enable experimental flags to match upstream 2023-02-01 08:29:36 +01:00
Stéphan Kochen
cb959e7018 swift: 5.7 -> 5.7.3 2023-02-01 08:29:35 +01:00