Commit Graph

150 Commits

Author SHA1 Message Date
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
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
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