nixpkgs/pkgs/development/compilers/swift/swiftpm
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
..
generated
patches swift: fix build w/ glibc-2.39 2024-03-02 19:01:51 +01:00
cmake-glue.nix
default.nix swift: fix build w/ glibc-2.39 2024-03-02 19:01:51 +01:00
setup-hook.sh