I’m trying to setup my Raspberry Pi 3 with NixOS. I’ve read the WiKi page about it and I think I understand the overall process, thankfully it’s rather simple. However, I’m having trouble with the nixos-rebuild switch --upgrade command I’m supposed to run after editing /etc/nixos/configuration.nix. Thanks to the outstanding .xz decompression Nix bug, @dezgeg’s image still doesn’t work but @qolii’s image does - the WiKi is accurate.
I’ve had 2 nixos-rebuild attempts which failed differently. It was very hard to record the errors it spit, since I ran this inside the native tty (can’t use UART, never mind…).
Both failures occurred during the build phase of GCC which nix somehow decided it needs to build by himself. Other packages which required an update were either compiled locally fine or retrieved from a cache. The full command I ran was:
nixos-rebuild switch --fast --option binary-caches 'https://nixos-arm.dezgeg.me/channel' --option binary-cache-public-keys 'nixos-arm.dezgeg.me-1:xBaUKS3n17BZPKeyxL4JfbTqECsT+ysbDJz29kLFRW0=%'
As proposed in this section of the WiKi page.
The 1st failure of nixos-rebuild was probably due to an overheat of the CPU and so I didn’t record it.
The 2nd attempt however, failed with the following error:
rm -f include/stdint.h
if [ wrap = wrap ]; then
rm -f include/stdint-gcc.h;
cp ../../gcc-7.4.0/gcc/ginclude/stdint-gcc.h include/stdint-gcc.h;
chmod a+r include/stdint-gcc.h;
cp ../../gcc-7.4.0/gcc/ginclude/stdint-wrap.h include/stdint.h;
chmod a+r include/stdint.h;
elif [ wrap = provide ]; then
cp ../../gcc-7.4.0/gcc/ginclude/stdint-gcc.h include/stdint.h;
chmod a+r include/stdint.h;
fi
set -e; for ml in `cat fixinc_list`; do
sysroot_headers_suffix=`echo ${ml} | sed -e 's/;.*$//'`;
multi_dir=`echo ${ml} | sed -e 's/^[^;]*;//'`;
fix_dir=include-fixed${multi_dir};
if true ; then
cat ../../gcc-7.4.0/gcc/limitx.h ../../gcc-7.4.0/gcc/glimits.h ../../gcc-7.4.0/gcc/limity.h > tmp-xlimits.h;
else
cat ../../gcc-7.4.0/gcc/glimits.h > tmp-xlimits.h;
fi;
/nix/store/65sxp86ypi3ca914pq069blazwq9qzr1-bootstrap-tools/bin/bash ../../gcc-7.4.0/gcc/../mkinstalldirs ${fix_dir};
chmod a+rx ${fix_dir} || true;
/nix/store/65sxp86ypi3ca914pq069blazwq9qzr1-bootstrap-tools/bin/bash ../../gcc-7.4.0/gcc/../move-if-change
tmp-xlimits.h tmp-limits.h;
rm -f ${fix_dir}/limits.h;
cp -p tmp-limits.h ${fix_dir}/limits.h;
chmod a+r ${fix_dir}/limits.h;
done
rm -f include-fixed/README
cp ../../gcc-7.4.0/gcc/../fixincludes/README-fixinc include-fixed/README
chmod a+r include-fixed/README
echo timestamp > stmp-int-hdrs
/build/build/./gcc/xgcc -B/build/build/./gcc/ -nostdinc -x c /dev/null -S -o /dev/null -fself-test=../../gcc-7.4.0/gcc/testsuite/selftests
compilation terminated due to -fmax-errors=3070189568.
make[3]: *** [Makefile:1933: s-selftest] Error 1
make[3]: *** Waiting for unfinished jobs....
rm gcc.pod
make[3]: Leaving directory '/build/build/gcc'
make[2]: *** [Makefile:4584: all-stage2-gcc] Error 2
make[2]: Leaving directory '/build/build'
make[1]: *** [Makefile:21366: stage2-bubble] Error 2
make[1]: Leaving directory '/build/build'
make: *** [Makefile:21570: bootstrap] Error 2
builder for '/nix/store/9riiqqd5zwb9nz2brdxd775c0513xl6m-gcc-7.4.0.drv' failed with exit code 2
cannot build derivation '/nix/store/4jmdjhkpbadyjh5h6dpfdwv2qdqj5v5a-bootstrap-stage4-gcc-wrapper-7.4.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/m44xjf4b39ym1ckbqfk0s2bvimnfbpwh-gcc-wrapper-7.4.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/c18dr6xznmlmjr27p5mn49rwvz3lipxv-perl-5.28.2.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/inkfxkv8qf9in6ww3bxkdjaj3r73a5rf-perl-5.28.2.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/inmrk391y06kdidn71b6zg65pnx57fm7-perl-5.28.2.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/123w8ip31552d1kliahk7lzh2029zi8a-stdenv-linux.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/rps3r6mdp6yfy3kflgzirl0r9jbrx2jn-stdenv-linux.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/icy8mgk40nkvl7zydlyfhd9z3vfwr2sq-nixos-system-NIXPI-19.09pre186563.b5f5c97f7d6.drv': 1 dependencies couldn't be built
error: build of '/nix/store/icy8mgk40nkvl7zydlyfhd9z3vfwr2sq-nixos-system-NIXPI-19.09pre186563.b5f5c97f7d6.drv' failed
I’ve found no clue as for this -fmax-errors error… Could it be a general problem with the build that occurs only on an armv7l machine?
Generally speaking, the problem is that there seems no binary cache which contains an updated GCC derivation. I hope I can get @dezgeg’s attention by mentioning him and perhaps learn why did he choose only a subset of packages and not include GCC there…
I can’t describe to you how frustrating it was to find out after 3-4 hours of the GCC build on my pour Raspberry Pi, that it failed and that I have no idea what is this error all about…
If I could only get this derivation precompiled, I will be happy.
Are there any alternative binary cache I can use? I read this announcement and I couldn’t understand exactly what does it mean for me as an armv7l end-user… The WiKi says there’s a binary cache by @clever, and a arm cachix cache (announcement thread).
Is there a way to specify nixos-rebuild to use all of those binary caches together? This way I could verify that none of them helps me…