Commit Graph

112 Commits

Author SHA1 Message Date
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
Domen Kožar
cfb80ea275
Merge pull request #211908 from stephank/fix/swift-darwin
[staging-next] swift: bootstrap using system stdlib
2023-01-28 11:58:03 +00: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
Guillaume Girol
447ca4bf3b treewide: migrate to nativeCheckInputs 2023-01-21 12:00:00 +00:00
Stéphan Kochen
813c58dab1 swiftPackages.Dispatch: fix linux build 2022-11-21 19:18:10 +01:00
Stéphan Kochen
a567024b44 swift: add canary to verify no compiler dependency 2022-11-21 11:36:18 +01:00
Stéphan Kochen
72ba293675 swift: remove internal wrapperParams arg 2022-11-21 11:15:01 +01:00
Stéphan Kochen
da15d44729 swiftPackages.Foundation: add note about CF 2022-11-21 11:11:29 +01:00
Stéphan Kochen
a4c8c87cb1 swift: remove NIX_BUILD_TOP 2022-11-21 11:04:54 +01:00
Stéphan Kochen
aae355626f swiftpm: factor out cmake glue installation 2022-11-21 11:04:54 +01:00
toonn
a8f9977c6f swiftpm: typo fixes 2022-11-21 11:04:54 +01:00
Stéphan Kochen
7d559a3cb3 swiftPackages: update swiftpm2nix generated files 2022-11-21 11:04:54 +01:00
Stéphan Kochen
449e2f1b01 swift: track version in a central sources.nix 2022-11-15 14:24:25 +01:00
toonn
0e08b082b8 swiftpm: improve setup hook shell conditions 2022-11-15 14:24:02 +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