| 30 Mar 2024 |
tau | i don't intend to be doing much building on my riscv dev board lol | 00:02:22 |
Alex | If 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 |
tau | couldn't get that working | 00:04:48 |
Alex | 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 |
tau | ah ok | 00:05:42 |
Alex | Btw 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 |
tau | including all of stdenv ? | 00:10:35 |
Alex | Yes | 00:10:41 |
tau | wowee | 00:10:45 |
| Jack Leightcap joined the room. | 00:11:01 |
Alex | 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 |
tau | we do have the server set to powersave mode, so it's probably something similar, but i don't think we could afford to run it without it | 00:15:53 |
tau | oh well | 00:16:01 |
Alex | IIRC powersave means it will always use the min frequency | 00:16:35 |
tau | ye | 00:16:39 |
tau | tbh after thinking it over, it's probably costing more to have the server running this long, so i will probably turn power saver off after this | 00:17:47 |
Alex | On the other hand lower cpufreq should be more power efficient (due to lower core temperatures).
I guess if you wanted to maximise power efficiency the only way of finding the sweet spot is a lot of benchmarking. | 00:20:04 |
tau | yeah | 00:26:32 |
| Shalok Shalom left the room. | 00:27:37 |
tau | In reply to @skeuchel:matrix.org
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.
i really don't understand why it's not building, i added the crossSystem and localSystem options,
┏━ 1 Errors:
⋮
┃ 182| buildCommand = ''
┃ | ^
┃ 183| mkdir -p $out/nix-support $out/sd-image
┃
┃ (stack trace truncated; use '--show-trace' to show the full trace)
┃
┃ error: Package ‘ghc-9.6.4’ in /nix/store/y45vqv6pa8bhgag1dw86rvi6rk55xhxn-source/pkgs/development/compilers/ghc/common-hadrian.nix:525 is not available o…
┃ hostPlatform.config = "riscv64-unknown-linux-gnu"
┃ package.meta.platforms = [
┃ "aarch64-darwin"
┃ "aarch64-linux"
┃ "i686-linux"
┃ "x86_64-darwin"
┃ "x86_64-linux"
┃ ]
┃ package.meta.badPlatforms = [ ]
┃ , refusing to evaluate.
┃
┃ a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
┃ for a single invocation of the nix tools.
┃
┃ $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
┃
┃ Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
┃ then pass `--impure` in order to allow use of environment variables.
┃
┃ b) For `nixos-rebuild` you can set
┃ { nixpkgs.config.allowUnsupportedSystem = true; }
┃ in configuration.nix to override this.
┃
┃ c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
┃ { allowUnsupportedSystem = true; }
┃ to ~/.config/nixpkgs/config.nix.
┣━━━
┗━ ∑ ⚠ Exited with 1 errors reported by nix at 00:52:48 after 7s
| 00:54:58 |
tau | ┏━ 1 Errors:
┃ error:
┃ … while calling the 'derivationStrict' builtin
┃
┃ at /derivation-internal.nix:9:12:
┃
┃ 8|
┃ 9| strict = derivationStrict drvAttrs;
┃ | ^
┃ 10|
┃
┃ … while evaluating derivation 'nixos-sd-image-24.05.20240327.2726f12-riscv64-linux-starfive-visionfive2.img'
┃ whose name attribute is located at /nix/store/y45vqv6pa8bhgag1dw86rvi6rk55xhxn-source/pkgs/stdenv/generic/make-derivation.nix:331:7
┃
┃ … while evaluating attribute 'buildCommand' of derivation 'nixos-sd-image-24.05.20240327.2726f12-riscv64-linux-starfive-visionfive2.img'
┃
┃ at /nix/store/y45vqv6pa8bhgag1dw86rvi6rk55xhxn-source/nixos/modules/installer/sd-card/sd-image.nix:182:7:
┃
┃ 181|
┃ 182| buildCommand = ''
┃ | ^
┃ 183| mkdir -p $out/nix-support $out/sd-image
┃
┃ (stack trace truncated; use '--show-trace' to show the full trace)
┃
┃ error: cannot bootstrap GHC on this platform ('riscv64-linux' with libc 'defaultLibc')
┣━━━
┗━ ∑ ⚠ Exited with 1 errors reported by nix at 00:53:28 after 6s
( when adding the --impure flag ) | 00:55:41 |
tau | if cross compilation is supported, why do i keep getting this error ? it's really frustrating | 00:56:48 |
tau | ok even after i've built ghc locally | 02:01:47 |
tau | and i've set the nixpkgs to alexandretunstall/nixpkgs/ghc-cross-usable | 02:01:54 |
tau | it still saying cannot bootstrap ghc on this platform | 02:02:08 |
tau | i do not understand what is going on | 02:02:13 |
Alex | It looks like you're missing the overlay that replaces the Nixpkgs GHCs with those based off of the cross-compiled GHC.
Do you have a link to a reproducer I can look at? | 07:46:13 |
tau | git.solarpunk.moe/geekygays/nixconf | 17:12:33 |
tau | * https://git.solarpunk.moe/geekygays/nixconf | 17:12:41 |
Alex | nixosConfigurations.cmb2.config.system.build.toplevel on branch magrathea?
Let me take a look... | 17:20:12 |