Also drop diffutils from the `inherit (prevStage)` overrides in
pkgs/stdenv/linux/default.nix. Once the package lives in pkgs/by-name,
that pin gives the top-level `diffutils` attribute a source location
even though it is defined via `_internalCallByNamePackageFile`, which
nixpkgs-vet rejects (NPV-102). Dropping the pin lets the by-name
auto-definition stand on its own, at the cost of no longer reusing the
bootstrap-stage build (a stdenv-class rebuild, hence staging).
Co-authored-by: Philip Taron <philip.taron@gmail.com>
Assisted-by: Claude Code (claude-opus-4-8)
libxcrypt was built twice (xgcc and stage2). Adding it to the inherit list
at xgcc and stage2 chains it through: stage1 produces the single build,
xgcc/stage2/stage3 inherit. Total bootstrap-stage builds: 2 -> 1.
libxcrypt is build-time-only — it is needed at build time by tools that
support libcrypt-style password hashing, but its `out` is not in the final
stdenv runtime closure (glibc no longer depends on libxcrypt at runtime;
applications that need it link directly).
Safe with respect to the `disallowedRequisites` check on the final
stdenv-linux.
python3Minimal was being rebuilt at stages 3 and 4. It is used only as a
native build input (e.g. meson, glib build helpers); its outputs do not
appear in the final stdenv's runtime closure.
Inheriting from prevStage at stage3 and stage4 collapses 2 -> 1 build.
Build-only dependency, safe with respect to the `disallowedRequisites`
check on the final stdenv-linux.
autoconf269 was being rebuilt at stages 2 and 3. It is used only as a
native build input (to regenerate `configure` scripts in autotools-using
packages); its outputs never appear in the final stdenv's runtime closure.
Inheriting it from prevStage at stage2 and stage3 collapses 2 -> 1 build.
Build-only dependency, safe with respect to the `disallowedRequisites`
check on the final stdenv-linux.
nukeReferences was rebuilt at every stage where it appeared (xgcc, stage2,
stage3 — 3 redundant builds beyond stage1's initial build). It is used only
at build time (to scrub references from libidn2/libunistring at stage2),
never appears in the final stdenv's runtime closure, and its outputs are
not propagated into other final-closure derivations.
Adding it to the inherit list at xgcc, stage2, and stage3 collapses the
chain to a single stage1 build. Stage4 still produces its own nukeReferences
through the regular package set; that one is unused by the final stdenv.
Build-only dependency, so this is safe with respect to the
`disallowedRequisites` check on the final stdenv-linux.
dejagnu is never demand-built in the bootstrap closure (verified via
`nix-store --query --requisites | grep dejagnu` returning empty on
master). The override existed but the resulting derivation was never
referenced by anything stage2+ actually builds.
Verified by drv-hash equality: stdenv.drvPath is unchanged
(q2xn5647kadsgpz40xcmjssa0pmdmiwi-stdenv-linux.drv).
The override at `super.binutils-unwrapped.override { enableGold = false; }`
defined a stage1 `binutils-unwrapped` derivation that was never used:
xgcc-stage and stage2 both build their own fresh `super.binutils-unwrapped`
without inheriting from stage1, so the gold-disabled rebuild never appeared
in the build graph (verified via `nix-store --query --requisites`).
Verified by drv-hash equality: stdenv.drvPath is unchanged
(q2xn5647kadsgpz40xcmjssa0pmdmiwi-stdenv-linux.drv).
The hook was added six times — once in each of stages 1, xgcc, 2, 3, 4
(and again at the final stdenv) — to teach configure scripts about
non-x86_64 architectures. Wire it once inside stageFun instead, guarded
by `prevStage ? updateAutotoolsGnuConfigScriptsHook` so the dummy stage
(whose prevStage is the raw stub) is unaffected.
The final stdenv (built outside stageFun) keeps its explicit entry.
Eval-verified: stdenv.drvPath is unchanged from master
(q2xn5647kadsgpz40xcmjssa0pmdmiwi-stdenv-linux.drv).
The `sheevaplug` kernel configuration was added a very long time
ago and has not been adjusted for years. `pogoplug4` was identical
to `sheevaplug` except for an even more stripped‐down kernel
configuration, no device tree support, and a different load address
for the uImage.
These days, the stock kernel configuration builds and there has been
an upstream device tree for the Pogoplug Series 4 for years; unify
`sheevaplug` and `pogoplug4` into an `armv5tel-multiplatform` that
uses the standard configuration.
ARMv5 was also the only platform that defaulted to uImage, the [legacy
U‐Boot image format] that is deprecated upstream. Our bootloader
machinery in NixOS does not handle these images in any special way
and even the original ARMv6 Raspberry Pi platform defaults to the
standard zImage. We switch `armv5tel-multiplatform` to zImage to match.
[legacy U‐Boot image format]: https://docs.u-boot.org/en/latest/usage/cmd/bootm.html#legacy-boot
It is of course natural to worry about backwards compatibility
here: this switches to a different kernel image format and drops
support for root on NFS along with random oddities like KGDB and
LatencyTOP. Renaming the platform is intended to help mitigate
this risk.
The reality, however, is that it is currently very
difficult to build a configuration for ARMv5. I found
<https://github.com/thefloweringash/sheevaplug-nix> online as
an example configuration from many years ago; it already set
`autoModules`, and builds U‐Boot using `CONFIG_DISTRO_DEFAULTS`,
which should work out of the box without requiring the legacy U‐Boot
image format.
Even then, however, I confirmed with the author that it hasn’t
been used in years, and I could barely get it to build with
a modern Nixpkgs: OpenSSH is broken, Nix is broken, multiple
default `environment.systemPackages` in the SD image profile
are broken, `boot.initrd.includeDefaultModules` is broken, and
`hardware.enableAllHardware` is broken.
I conclude that if anyone is actively building systems on ARMv5, they
have a forked Nixpkgs or a very custom setup. Given our general move
to standard boot chains and no platform‐specific hacks, and the
decaying state of our unofficial support for 32‐bit ARM, I think
it is not worth maintaining support for the legacy image format for
this one ancient platform.
If anyone is running a heavily stripped‐down NixOS configuration on
mission‐critical SheevaPlugs using a custom Nix‐free deployment
setup relying on the legacy U‐Boot image format and somehow none
of these kernel changes manage to loudly break their build, hopefully
they’ll at least notice the release notes entry! Otherwise there’s
always JTAG…
By doing this, we can cache the rest of the file, including the import
of problems.nix. This allows genCheckProblems to be cached on every
bootstrapping stage, and not re-called each time.
it would be as simple as setting `strictDeps = true` and
`buildInputs = [ bashNonInteractive ]` except this package is used
during the bootstrap of `stdenv`: this method of manually patching
seems to be the least complex way to get correct behavior while
avoiding cyclic when deriving `stdenv` itself.
successfully built the following, from x86_64-linux:
- `gnu-config`
- `pkgsCross.aarch64-multiplatform.buildPackages.gnu-config` (equivalent)
- `pkgsCross.aarch64-multiplatform.gnu-config`
- `pkgsCross.musl32.gnu-config`
- `pkgsMusl.gnu-config`
- `pkgsStatic.gnu-config`
- `pkgsi686Linux.gnu-config`
successfully eval'd `gnu-config` for the following systems:
- `aarch64-darwin`
- `aarch64-freebsd`
- `aarch64-linux-musl`
- `aarch64-linux`
- `x86_64-cygwin`
- `x86_64-darwin`
- `x86_64-freebsd`
- `x86_64-linux-musl`
- `x86_64-linux`
Rather than implementing this at the wrapper level (which has been
attempted but not merged in # 252310 and # 205031), configuring GCC
directly with --enable-default-pie is simple and matches mainstream
distribution practices. Packages that cannot build with PIE can
explicitly pass -no-pie when needed, and mostly already do
due to the prevalence of GCCs built with this flag.
Requires followup to decide what to do with "pie" flag.
Picking up where #414321 left off, we can now simplify some things by
using `pkgs.libc` or `targetPackages.libc` consistently.
Individual packages should probably continue using `stdenv.cc.libc`, for
now at least, since it is possible they are given a `stdenv.cc` with an
alternative libc, but for the treewide code, the top-level `libc`
package is preferable and easier to work with.
Co-authored-by: Tristan Ross <rosscomputerguy@protonmail.com>
This allows on-the-fly rewriting of URLs before they are passed from
fetchurl (or fetchurlBoot) to curl.
The intended use is to allow inserting company-internal mirrors, or
working around company firewalls and similar network restrictions,
without having to extensively patch across all of nixpkgs. Instead,
users can pass a function in their nixpkgs that performs the necessary
URL rewrites.
Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
Add the same trick for gettext as for libunistring below, skipping
"checking for working iconv" which requires locales and gconv modules
(and other stuff we don't have in bootstrapTools?)
It tries to run the following check in `iconv.m4` which fails:
```c
#include <iconv.h>
#include <string.h>
int
main (void)
{
int result = 0;
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
provided. */
{
/* Try standardized names. */
iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
/* Try IRIX, OSF/1 names. */
iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
/* Try AIX names. */
iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
/* Try HP-UX names. */
iconv_t cd4 = iconv_open ("utf8", "eucJP");
if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
&& cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
result |= 16;
if (cd1 != (iconv_t)(-1))
iconv_close (cd1);
if (cd2 != (iconv_t)(-1))
iconv_close (cd2);
if (cd3 != (iconv_t)(-1))
iconv_close (cd3);
if (cd4 != (iconv_t)(-1))
iconv_close (cd4);
}
return result;
;
return 0;
}
```
Then it assumes iconv is not there and tries to use some built-in iconv
function? idk
Resulting in following error:
```
iconv-ostream.c:311:3: error: initialization of 'void (*)(struct
any_ostream_representation *, ostream_flush_scope_t)' from incompatible
pointer type 'void (*)(struct any_ostream_representation *)' []
```
This isn't causing a build failure in other architectures because we
haven't updated bootstrapTools to gcc14, so the error isn't noticeable,
but it's there. Check https://hydra.nixos.org/build/294707390/nixlog/10
Starting from glibc 2.34, all functionality previously implemented in
libpthread, libdl, libutil and libanl are now integrated into libc.
https://lists.gnu.org/archive/html/info-gnu/2021-08/msg00001.html
As loongarch64 support was merged into glibc after 2.34, libutil.so is
no longer in there, thus breaking bootstrap.
https://github.com/loongson-community/discussions/issues/29
libdl is not removed because bash still links against it, and libpthread
is not removed because xgcc depends on it to build libatomic.