!xmLtiCaAJxfhURjrXl:matrix.org

NixOS RISC-V

231 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-v69 Servers

Load older messages


SenderMessageTime
29 Mar 2024
@skeuchel:matrix.orgSteven KeuchelThe error message that you are seeing comes from trying to build ghc from a binary bindist.12:32:39
@skeuchel:matrix.orgSteven KeuchelBut there is not bindist for riscv64, e.g. in here for ghc963Binary https://github.com/NixOS/nixpkgs/blob/6a2bf3ad24583dd4486bf669b6790d61ac239879/pkgs/development/compilers/ghc/9.6.3-binary.nix#L44-L11112:33:00
@skeuchel:matrix.orgSteven Keuchelyou should not be seeing that error message for a cross-compile though12:33:25
@hive:the-apothecary.clubhive ⬡hmm ok12:33:47
@skeuchel:matrix.orgSteven Keuchel

tau: Here is a minimal flake that at least evaluates

{
  inputs = {
    nixpkgs.url = "github:AlexandreTunstall/nixpkgs/ghc-cross";
  };

  outputs = { nixpkgs, ... }:
    {
      nixosConfigurations.riscv64 = nixpkgs.lib.nixosSystem {
        modules = [({lib, pkgs, ...}: {
          nixpkgs.crossSystem.system = "riscv64-linux";
          nixpkgs.localSystem.system = "x86_64-linux";
          environment.systemPackages = [
             pkgs.haskell.compiler.native-bignum.ghc948
          ];
          # Dummy values
          fileSystems."/".device  = lib.mkDefault "/dev/sda1";
          boot.loader.grub.device = lib.mkDefault "/dev/sda";
        })];
      };
    };
}

Maybe you can use that to figure out what is going wrong.

12:58:51
@skeuchel:matrix.orgSteven KeuchelThis won't build a complete config though since https://github.com/NixOS/nixpkgs/pull/298001 is not in Alex's branch.12:59:22
@hive:the-apothecary.clubhive ⬡ok, thanks12:59:57
@misuzu:matrix.orgmisuzu
In reply to @hive:the-apothecary.club
i looked through the chat and couldn't find any good binary caches, maybe i missed something, but https://github.com/misuzu/nixos-vf2/blob/master/flake.nix#L3 seems to just give a 404 ? at the very least, when trying it i'm still getting the error with ghc so i'm not sure what's going on here
That cache only has binaries for that flake
18:08:51
@alex:tunstall.xyzAlex

tau you're in luck because I was planning on writing some instructions in the shared notes (see room description) this evening.

I'll let you know when the instructions are ready.

18:10:19
@hive:the-apothecary.clubhive ⬡oh awesome18:20:00
@alex:tunstall.xyzAlex

tau Steven Keuchel fgaz the shared notes now have instructions for how to get a working GHC.

(Disclaimer: It's been a while since I first booted GHC and I haven't yet had time to properly test the instructions.)

19:39:30
@hive:the-apothecary.clubhive ⬡it's been building for like23:58:16
@hive:the-apothecary.clubhive ⬡since you sent that message23:58:22
@hive:the-apothecary.clubhive ⬡and it only got to ghc like, 30 minutes ago23:58:34
@hive:the-apothecary.clubhive ⬡and this is on my like build server lmao23:58:49
@hive:the-apothecary.clubhive ⬡i'm going to be pushing this to cachix so other people don't have to build it lol23:59:17
@alex:tunstall.xyzAlex I couldn't find a way of only patching cc-wrapper and binutils-wrapper for GHC, so you had to rebuild the entire stdenv. 23:59:26
@hive:the-apothecary.clubhive ⬡womp23:59:38
30 Mar 2024
@alex:tunstall.xyzAlex

Wait until you see how long native GHC takes to build on RISC-V hardware :)

(I doubt you'll be able to build much beyond GHC itself with the cross-compiled GHC.)

00:01:37
@hive:the-apothecary.clubhive ⬡i don't intend to be doing much building on my riscv dev board lol00:02:22
@alex:tunstall.xyzAlexIf you just want to cross-compile Haskell packages for RISC-V, you don't actually need my changes; Nixpkgs can already do build = host != target.00:04:31
@hive:the-apothecary.clubhive ⬡couldn't get that working00:04:48
@alex:tunstall.xyzAlex I'm afraid I can't help there, because I've spent all my time on getting working native compilation and no time on cross-compiling haskellPackages :D 00:05:32
@hive:the-apothecary.clubhive ⬡ah ok00:05:42
@alex:tunstall.xyzAlexBtw I suspect your build server isn't particularly fast... My Ryzen 5 5600X desktop finished the GHC build over 90 minutes ago (I can't remember when I started it, but it was definitely not more than an hour before I sent that message).00:09:50
@hive:the-apothecary.clubhive ⬡including all of stdenv ?00:10:35
@alex:tunstall.xyzAlexYes00:10:41
@hive:the-apothecary.clubhive ⬡wowee00:10:45
@jackleightcap:matrix.org@jackleightcap:matrix.org joined the room.00:11:01
@alex:tunstall.xyzAlex Just a few months ago I noticed that my system was using the powersave CPU frequency scaling driver instead of amd-pstate. Changing that made things significantly faster. If you're on an AMD CPU, maybe you have the same problem? 00:15:17

Show newer messages


Back to Room ListRoom Version: 10