This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.
Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
Without the change `weechat` fails to build on `binutils-2.45` as:
Pre-boot error; key: misc-error, args: ("load-thunk-from-memory" "missing DT_GUILE_ENTRY" () #f)Subprocess aborted
This happens because `guile-3` uses `ELF` format to store guile bytecode
and `strip` sometimes destroys `guile`-specific details in `ELF` files.
The upstream patch fixes an include error.
Adding autoreconfHook fixes
> make -C libguile scmconfig.h
> make[1]: Entering directory '/build/guile-3.0.10/libguile'
> cd .. && /nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin/bash /build/guile-3.0.10/build-aux/missing automake-1.16 --gnu libguile/Makefile
> /build/guile-3.0.10/build-aux/missing: line 81: automake-1.16: command not found
> WARNING: 'automake-1.16' is missing on your system.
> You should only need it if you modified 'Makefile.am' or
> 'configure.ac' or m4 files included by 'configure.ac'.
> The 'automake' program is part of the GNU Automake package:
> <https://www.gnu.org/software/automake>
> It also requires GNU Autoconf, GNU m4 and Perl in order to run:
> <https://www.gnu.org/software/autoconf>
> <https://www.gnu.org/software/m4/>
> <https://www.perl.org/>
> make[1]: *** [Makefile:2734: Makefile.in] Error 127
> make[1]: Leaving directory '/build/guile-3.0.10/libguile'
> make: *** [Makefile:2615: libguile/scmconfig.h] Error 2
which occurs because we patch a Makefile.am .
guile will fail in the configure phase on darwin due to libunistring not
building with libiconv as libunistring 1.3 rejects darwin's libiconv
implementation. Work around this by using the gnu libiconv.
https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00375.html
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
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"
```
This backports a patch from current Guile HEAD which fixes a
platform-specific bug causing all subprocess spawns to fail on (at
least) Darwin and GNU Hurd, and possibly other platforms as well.
Upstream patch:
<https://git.savannah.gnu.org/cgit/guix.git/plain/gnu/packages/patches/guile-hurd-posix-spawn.patch>
Note that despite the patch name and comments, other OSes than Hurd
are affected as well.
Thanks to @civodul for the hint that this patch would fix the problem.
Guile 3.0 calls `__sincos`, which should be defined in `math.h`, but the
version of that header in the 10.12 SDK is very old (predating 10.12).
Until there is a version of that header available, use the 11.0 SDK to
build Guile.
Guile 2.2 calls `__sincos`, which should be defined in `math.h`, but the
version of that header in the 10.12 SDK is very old (predating 10.12).
Until there is a version of that header available, use the 11.0 SDK to
build Guile.
The include/ directory for libunistring is inside the libunistring.dev
package, not libunistring, thus the .pc file was pointing to a
non-existing path.
Without the change updater script extracts location from `guile` (`guile_2_2`).
I did not notice it initially as I use local override of `guile = guile_3_0`.