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>
After #400734 the path to the binutils wrapper is no longer passed via
-B and is instead passed via $PATH. This had the following consequences
for gnat-bootstrap:
- GCC appends $prefix/$triple/bin to collect2's $COMPILER_PATH, which
is where gnat-bootstrap's bundled linker binary is installed. For
normal gcc packages, this has no impact on linker selection because
binutils and gcc are installed to separate prefixes.
- -B paths are also added to $COMPILER_PATH but they appear before
$prefix/$triple/bin. This meant that gnat-bootstrap's collect2 would
find the binutils wrapper before #400734.
- collect2 searches for the linker on $PATH but only after failing to
find it on $COMPILER_PATH. Because #400734 caused the binutils wrapper
path to be removed from $COMPILER_PATH while the bundled linker on
$prefix/$triple/bin was still present, gnat-bootstrap started finding
the bundled linker on $COMPILER_PATH after #400734.
The bundled ld binaries should not be used by builds utilizing
gnat-bootstrap because we need our binutils wrappers to be used so that
RPATH is set correctly. The ld binaries are unused as far as I'm aware,
so remove them from the package so that collect2 finds the binutils
wrapper on $PATH.
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:
nix-build ci -A fmt.check
This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).
This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).
Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).
If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
This commit makes `url` dependent on the gnat version, and allows
for `alireRevision` to be empty (in which case no hyphen is added
after ${gccVersion} in `version`).
This should cause no changes to eval on `gnat11` or `gnat12`.
This is submitted in order to reduce the size of #225191