ryan4yin / nixos-rk3588

Minimal NixOS running on RK3588/RK3588s based SBC(Orange Pi 5 Plus, Orange Pi 5, Rock 5A, etc)
MIT License
156 stars 28 forks source link

Cannot build nixos configuration locally #5

Closed BananchickPasha closed 1 year ago

BananchickPasha commented 1 year ago

Steps to reproduce

More detailed log:

[rk@orangepi5plus:~/nixos-rk3588/demo]$ nix log /nix/store/k6a9yb1jg8v0882pbvxgs8aywfg4cq7x-alsa-firmware-1.2.4.drv
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/z4sarpvzn4rv9a1c6i895l0fxvskvr6i-alsa-firmware-1.2.4.tar.bz2
source root is alsa-firmware-1.2.4
setting SOURCE_DATE_EPOCH to timestamp 1603193562 of file alsa-firmware-1.2.4/configure
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/lg52g3ij57nq5llbi14hc5j9c11wrz7z-musl.patch
patching file hdsploader/digiface_firmware.dat
patching file hdsploader/digiface_firmware_rev11.dat
patching file hdsploader/multiface_firmware.dat
patching file hdsploader/multiface_firmware_rev11.dat
patching file hdsploader/tobin.c
@nix { "action": "setPhase", "phase": "autoreconfPhase" }
autoreconfPhase
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: /nix/store/33h01vq7rrprp5six6k9xvgvvjlmwbsw-autoconf-2.71/bin/autoconf --force
configure.ac:5: warning: The macro `AC_PROG_CC_FOR_BUILD' is obsolete.
configure.ac:5: You should run autoupdate.
m4/ax_prog_cc_for_build.m4:54: AC_PROG_CC_FOR_BUILD is expanded from...
configure.ac:5: the top level
configure.ac:8: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:8: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:8: the top level
configure.ac:56: warning: AC_OUTPUT should be used without arguments.
configure.ac:56: You should run autoupdate.
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
vxloader/Makefile.am:47: warning: '%'-style pattern rules are a GNU make extension
autoreconf: Leaving directory '.'
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./config.sub
Updating Autotools / GNU config script to a newer upstream version: ./config.guess
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
fixing libtool script ./ltmain.sh
configure flags: --disable-dependency-tracking --prefix=/nix/store/4zxzy5244h4d80jf2sj34d3b0qsqzh9j-alsa-firmware-1.2.4 --with-hotplug-dir=\$\(out\)/lib/firmware --build=aarch64-unknown-linux-gnu --host=aarch>
checking for aarch64-unknown-linux-gnu-gcc... aarch64-unknown-linux-gnu-gcc
checking whether the C compiler works... no
configure: error: in `/build/alsa-firmware-1.2.4':
configure: error: C compiler cannot create executables
See `config.log' for more details

I also tried to disable everything in configuration.nix, as well as providing options services.jack.alsa.enable = false; and hardware.enableAllFirmware = false; in attempt to disable building of alsa-fimware, but it didn't help. Updating flake.lock didn't help either

ryan4yin commented 1 year ago

@BananchickPasha Thanks for the feedback! I'll test this when I have time, or you can use nixos-rebuild directly for local deployment. It is not necessary to use colmena in local deployment

ryan4yin commented 1 year ago

Native builds don't need to use crossSystem, so you need to remove this part of the code from flake.nix as well:

 # line 35...
          {
            nixpkgs.crossSystem = {
              config = "aarch64-unknown-linux-gnu";
            };
          }
 # line 40...
ryan4yin commented 1 year ago

The command nix run nixpkgs#colmena build works properly after making the following changes in flake.nix:

  1. Replace system = "x86_64-linux"; to system = "aarch64-linux";
  2. Remove the config related to nixpkgs.crossSystem.
$ nix run nixpkgs#colmena build
warning: Git tree '/root/nixos-rk3588' is dirty
[INFO ] Using flake: git+file:///root/nixos-rk3588?dir=demo
[INFO ] Enumerating nodes...
[INFO ] Selected all 1 nodes.
      🕙 18m 1 running, 1 succeeded
 opi5 ✅ 9s Evaluated opi5
      ✅ 38m All done!
 opi5 ✅ 9s Evaluated opi5
 opi5 ✅ 38m Built "/nix/store/11zyzik8bjj93s7ybfi625ig0jymzixx-nixos-system-orangepi5-23.05pre-git"