| 28 Mar 2024 |
Alex | 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 Error with GHC?
AFAIK GHC is not in any binary caches (at least, I haven't uploaded my GHC builds to one). | 23:49:14 |
tau | ah, ok | 23:49:26 |
| 29 Mar 2024 |
tau | so i'm trying to build with your branch, but i'm getting the error:
error: cannot bootstrap GHC on this platform ('riscv64-linux' with libc 'defaultLibc')
| 11:54:02 |
tau | i'm not sure what i'm doing wrong :( | 12:00:00 |
tau | nix build "git+https://git.solarpunk.moe/geekygays/nixconf?ref=magrathea#nixosConfigurations.cmb2.config.system.build.sdImage"; | 12:13:16 |
tau | if you want to try | 12:13:19 |
Steven Keuchel | There are no official ghc bindists available for riscv64. So you cannot built it natively with vanilla nixpkgs. | 12:27:53 |
tau | it's not vanilla | 12:29:28 |
tau | it has alex's patches | 12:29:50 |
Steven Keuchel | yeah but that branch does not add any bindists, it's about getting ghc itself to cross compile when build != host = target | 12:30:55 |
tau | i was trying to cross compile though | 12:32:38 |
Steven Keuchel | The error message that you are seeing comes from trying to build ghc from a binary bindist. | 12:32:39 |
Steven Keuchel | But 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-L111 | 12:33:00 |
Steven Keuchel | you should not be seeing that error message for a cross-compile though | 12:33:25 |
tau | hmm ok | 12:33:47 |
Steven 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 |
Steven Keuchel | This won't build a complete config though since https://github.com/NixOS/nixpkgs/pull/298001 is not in Alex's branch. | 12:59:22 |
tau | ok, thanks | 12:59:57 |
misuzu | 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 | 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 |
tau | oh awesome | 18:20:00 |
Alex | 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 |
tau | it's been building for like | 23:58:16 |
tau | since you sent that message | 23:58:22 |
tau | and it only got to ghc like, 30 minutes ago | 23:58:34 |
tau | and this is on my like build server lmao | 23:58:49 |
tau | i'm going to be pushing this to cachix so other people don't have to build it lol | 23:59:17 |
Alex | 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 |
tau | womp | 23:59:38 |
| 30 Mar 2024 |
Alex | 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 |