!xmLtiCaAJxfhURjrXl:matrix.org

NixOS RISC-V

235 Members
NixOS on RISC-V https://wiki.nixos.org/wiki/RISC-V https://pad.lassul.us/NixOS-riscv64-linux https://github.com/orgs/NixOS/teams/risc-v68 Servers

Load older messages


SenderMessageTime
30 Mar 2024
@alex:tunstall.xyzAlex *

Well, I've gotten it to evaluate.

diff --git a/flake.nix b/flake.nix
index a3995c4..837952e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -7,7 +7,7 @@
   };
 
   inputs = {
-    nixpkgs.url = "github:geekygays/nixpkgs";
+    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
     nixos-hardware.url = "github:nixos/nixos-hardware";
     systems.url = "github:geekygays/systems";
 
diff --git a/modules/nixos/core/default.nix b/modules/nixos/core/default.nix
index 75ef1c9..45fbf7e 100644
--- a/modules/nixos/core/default.nix
+++ b/modules/nixos/core/default.nix
@@ -65,7 +65,7 @@
     '';
   };
   environment.systemPackages = with pkgs; [
-    nvd nixpkgs-fmt nix-output-monitor
+    nvd nixpkgs-fmt
     coreutils mime-types file
     usbutils pciutils gitFull git-crypt
   ];

This works for two reasons:

  1. Compiling nix-output-monitor requires GHC.
  2. Your custom Nixpkgs incorporates my ghc-cross branch, which prevents the ShellCheck fix from working.

To compile ShellCheck and nix-output-monitor, you must overlay the default GHC builds to replace them with a usable GHC.

Note that my ghc-cross branch doesn't do all of that; it only makes it possible to build a cross-compiler. Something similar to the example module I wrote into the notes is needed to do that.

(If you don't want to make your flake impure, you can use packages.x86_64-linux instead of builtins.storePath and it won't complain about being unable to build x86_64-linux as long as the output is already in the cache.)

17:52:26
@hive:the-apothecary.clubMs. Demeanorthank u <333317:58:22
@hive:the-apothecary.clubMs. Demeanorur incredible17:58:32
@alex:tunstall.xyzAlex

tau I've been modernising my RISC-V configuration, so I just so happen to have a pure flake that can evaluate GHC. It's not yet done building so I'm not entirely sure it'll work flawlessly on my VF2, but feel free to use it as a reference for how to overlay GHC.

https://github.com/AlexandreTunstall/nixos-riscv

18:06:38
31 Mar 2024
@hive:the-apothecary.clubMs. Demeanorright now it's doing an emulated build, and i'm guessing there's no way to get it to do a cross build ?05:45:32
@hive:the-apothecary.clubMs. Demeanori don't think nix build has an option for that05:46:16
@hive:the-apothecary.clubMs. Demeanori know nix-build does, but i have been able to find a flag for nix build anywhere05:46:37
@alex:tunstall.xyzAlex
In reply to @hive:the-apothecary.club
right now it's doing an emulated build, and i'm guessing there's no way to get it to do a cross build ?

Cross-compiling Haskell packages doesn't work.

I think the main issue is probably that Cabal needs to compile Setup.hs for the build platform, so you can't just instruct it to use a GHC that targets the host platform.

06:29:33
@alex:tunstall.xyzAlex
In reply to @hive:the-apothecary.club
i don't think nix build has an option for that
Nix can cross-compile an entire NixOS system, but not when using flakes unless the flake was specifically written for cross-compilation (e.g. by setting nixpkgs.buildPlatform).
06:35:46
@hive:the-apothecary.clubMs. Demeanoralright, thanks06:57:41
@hive:the-apothecary.clubMs. Demeanorafter a 9 hour build, the build for diffutils failed the overflow checks,,, ;-;20:37:50
@hive:the-apothecary.clubMs. DemeanorDownload diffutils-log.txt20:39:54
@hive:the-apothecary.clubMs. Demeanorit successfully built so i really have no idea why the checks failed20:40:35
@hive:the-apothecary.clubMs. Demeanori think i should probably report this bug to nixpkgs20:42:00
@alex:tunstall.xyzAlex

Segmentation fault

Check kernel log.

20:50:16
@hive:the-apothecary.clubMs. Demeanorwould that be journalctl20:51:00
@alex:tunstall.xyzAlex
journalctl -ek

If on a systemd distribution (like NixOS)

20:51:22
@alex:tunstall.xyzAlexAt the very least those logs should tell you exactly which process segfaulted and a bit of information about what exactly it tried to do.20:54:10
@hive:the-apothecary.clubMs. Demeanori'm not seeing any segfaults in the logs20:56:37
@hive:the-apothecary.clubMs. Demeanor https://github.com/NixOS/nixpkgs/issues/300550 20:58:15
@hive:the-apothecary.clubMs. Demeanori'll try to get it to crash again and see if i can find it20:58:26
@hive:the-apothecary.clubMs. Demeanorwould it show up in dmesg ?20:58:37
@alex:tunstall.xyzAlex On the system that ran the build?
There should definitely be something there at the timestamp at which it crashed...
20:58:46
@alex:tunstall.xyzAlex I don't know, I never use dmesg 20:58:55
@hive:the-apothecary.clubMs. Demeanoryeah on the system that ran the build21:00:23
@hive:the-apothecary.clubMs. Demeanorto be fair i don't really know what i'm looking for21:00:29
@hive:the-apothecary.clubMs. Demeanori skimmed the logs and tried to / search for SEG or FAULT but i couldn't find anything21:00:48
@alex:tunstall.xyzAlex

Example:

ghc_worker[772846]: unhandled signal 11 code 0x1 at 0x0000004e3584b582
CPU: 2 PID: 772846 Comm: ghc_worker Not tainted 6.5.0 #1-NixOS
Hardware name: StarFive VisionFive 2 v1.3B (DT)
epc : 0000004e3584b582 ra : 0000003ff3e06900 sp : 00000004e3ffa730
 gp : 000000000006ea80 tp : 00000004e3fff8e0 t0 : 0000000000004000
 t1 : 0000003ff3e00628 t2 : 0000003ff6f86598 s0 : 00000004f148d652
 s1 : 0000003fedb8afd8 a0 : 0000000000000000 a1 : 0000003fed8dd038
 a2 : 0000000000000002 a3 : 0000000000000002 a4 : 0000000000000032
 a5 : 09e1854e3584b583 a6 : 0000000000000000 a7 : 0000003ff7ffdd50
 s2 : 00000004f311b9f8 s3 : 00000004f16d93c8 s4 : 0000003fed8dc5e0
 s5 : 00000004f31140c0 s6 : 00000004f148d638 s7 : 00000004f36d2870
 s8 : 00000004f2ce1000 s9 : 00000000000003bd s10: 0000003fedb59058
 s11: 00000004f31140c0 t3 : 0000003fed2f0514 t4 : 0000000000000001
 t5 : 0000003fed9c6e2a t6 : 000000000000002e
status: 8000000200006020 badaddr: 0000004e3584b582 cause: 000000000000000c
21:01:11
@alex:tunstall.xyzAlexIn case you're not familiar: a segfault (short for segmentation fault) is what happens when a process tries to access memory that it isn't supposed to.21:02:51
@hive:the-apothecary.clubMs. Demeanorcouldn't find "unhandled" anywhere21:02:52

Show newer messages


Back to Room ListRoom Version: 10