fedimint / fedimint

Federated E-Cash Mint
https://fedimint.org/
MIT License
530 stars 209 forks source link

fix: only require firefox on linux for wasm check #5060

Closed tvolk131 closed 1 week ago

tvolk131 commented 1 week ago

Currently when I run just wasm-check on my Apple silicon Macbook, I get an error (see dropdown below). The issue has to do with the firefox package not being present. This PR fixes it by only requiring firefox on linux (since that's the only platform we're running wasm tests on currently). I'm still unable to run wasm tests on my Macbook, but now I'll at least be able to check that the code compiles.

Local Apple silicon error ``` tommys-mbp-14:fedimint tommyvolk$ just check-wasm warning: ignoring untrusted substituter 'https://fedimint.cachix.org', you are not a trusted user. Run `man nix.conf` for more information on the `substituters` configuration option. error: … while calling the 'derivationStrict' builtin at :9:12: 8| 9| strict = derivationStrict drvAttrs; | ^ 10| … while evaluating derivation 'nix-shell' whose name attribute is located at /nix/store/g861759ghxxwvyfdbv17xf3iahgm8rcb-source/pkgs/stdenv/generic/make-derivation.nix:348:7 … while evaluating attribute 'nativeBuildInputs' of derivation 'nix-shell' at /nix/store/g861759ghxxwvyfdbv17xf3iahgm8rcb-source/pkgs/stdenv/generic/make-derivation.nix:392:7: 391| depsBuildBuild = elemAt (elemAt dependencies 0) 0; 392| nativeBuildInputs = elemAt (elemAt dependencies 0) 1; | ^ 393| depsBuildTarget = elemAt (elemAt dependencies 0) 2; (stack trace truncated; use '--show-trace' to show the full trace) error: Package ‘firefox-124.0.2’ in /nix/store/g861759ghxxwvyfdbv17xf3iahgm8rcb-source/pkgs/applications/networking/browsers/firefox/wrapper.nix:418 is not available on the requested hostPlatform: hostPlatform.config = "aarch64-apple-darwin" package.meta.platforms = [ "i686-cygwin" "x86_64-cygwin" "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin" "i686-freebsd13" "x86_64-freebsd13" "x86_64-solaris" "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "loongarch64-linux" "m68k-linux" "microblaze-linux" "microblazeel-linux" "mips-linux" "mips64-linux" "mips64el-linux" "mipsel-linux" "powerpc64-linux" "powerpc64le-linux" "riscv32-linux" "riscv64-linux" "s390-linux" "s390x-linux" "x86_64-linux" "aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd" "i686-netbsd" "m68k-netbsd" "mipsel-netbsd" "powerpc-netbsd" "riscv32-netbsd" "riscv64-netbsd" "x86_64-netbsd" "i686-openbsd" "x86_64-openbsd" "x86_64-redox" ] package.meta.badPlatforms = [ "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin" ] , 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. error: Recipe `check-wasm` failed with exit code 1 ```
dpc commented 1 week ago

Why draft? :)