Closed paulyoung closed 5 months ago
If I do the following in
nix/overlay.nix
the error goes away.
I spoke too soon. While the build succeeds, actually trying to use clash
results in a runtime error.
nix build .#clash-ghc
./result/bin/clash --help
clash: unknown RTS option: -xm20000000
...
I made an additional change to nix/overlay.nix
and unsurprisingly the runtime error is gone.
clash-ghc =
let
unmodified =
- hprev.callCabal2nixWithOptions
+ hprev.callCabal2nix
"clash-ghc"
- ../clash-ghc
- "--flag workaround-ghc-mmap-crash" {
+ ../clash-ghc {
inherit (hfinal) clash-lib clash-prelude;
};
nix build .#clash-ghc
./result/bin/clash --help
Usage:
clash [command-line-options-and-input-files]
...
I've tried to override this using various Nix mechanisms
To clarify, what I meant here is that I have the flake in this repository as an input to my own flake.
Thanks for the bug report and the steps to work around it!
It would seem the -xm
flag is only on x86_64:
https://gitlab.haskell.org/ghc/ghc/-/blob/0df8ce27f1c418fee1ba860f1c6575f66cae2ca7/rts/RtsFlags.c?page=2#L1756
We had not realised this. We'll need to make it such that the flag is only passed on x86_64.
Thanks! I’ll probably use a fork in the meantime.
I think Rosetta should also allow people to work around this by doing something like:
…
let
supportedSystems = [
flake-utils.lib.system.aarch64-darwin
flake-utils.lib.system.x86_64-darwin
];
in
flake-utils.lib.eachSystem supportedSystems (system:
let
pkgs = import nixpkgs {
system:
if system == flake-utils.lib.system.aarch64-darwin
then flake-utils.lib.system.x86_64-darwin
else system;
};
…
Should be fixed with https://github.com/clash-lang/clash-compiler/pull/2657. I run aarch64 but didn't use nix flakes so I didn't hit this before.
If I try to build
clash-ghc
using Nix,clash-prelude
fails in thecheckPhase
withunknown RTS option: -xm20000000
when trying to rundoctests
andunittests
.I'm using an M1 Macbook Pro.
If I do the following in
nix/overlay.nix
the error goes away.I've tried to override this using various Nix mechanisms (e.g.
override
,overrideAttrs
, a custom overlay,pkgs.haskell.lib.dontCheck
) and while some of these work when buildingclash-prelude
in isolation, it doesn't help when buildingclash-ghc
for some reason that I don't understand.