Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sure I'm using fenix correctly for targetting wasm32-wasi #143

Open
augustebaum opened this issue Mar 18, 2024 · 1 comment
Open

Not sure I'm using fenix correctly for targetting wasm32-wasi #143

augustebaum opened this issue Mar 18, 2024 · 1 comment

Comments

@augustebaum
Copy link

I'm trying to package javy with Nix, with the help of fenix because it needs the wasm32-wasi toolchain.
I'm not using flakes, and there doesn't seem to be an example that exactly covers my use-case. Here's my default.nix:

let
  # sources.nix is generated using `niv`
  sources = import ./sources.nix {};
  pkgs = import sources.nixpkgs {};

  fenix = import sources.fenix {};
  toolchain = fenix.targets.wasm32-wasi.stable.toolchain;
in {
  javy = pkgs.callPackage ./javy.nix {
    rustPlatform = pkgs.makeRustPlatform {
      cargo = toolchain;
      rustc = toolchain;
    };
  };
}

I'm not sure if I'm using fenix correctly.

If I am, maybe you can help me with the error I'm getting when I reach this line in the buildPhase:

cargo build --package="javy-core" --target="wasm32-wasi" --release
javy> /nix/store/<hash>-cargo/bin/cargo: line 3: /nix/store/<hash>-cargo/bin/cargo: Argument list too long

Full stack trace:

this derivation will be built:
  /nix/store/mz3z3faan13f0a8304ndx2hv761vf0bc-javy-unstable-2024-03-05.drv
javy> building '/nix/store/mz3z3faan13f0a8304ndx2hv761vf0bc-javy-unstable-2024-03-05.drv'
javy> unpacking sources
javy> unpacking source archive /nix/store/qrqgf1i1pi2kw0n3pvfndcddv6minh2i-source
javy> source root is source
javy> Executing cargoSetupPostUnpackHook
javy> unpacking source archive /nix/store/xhvk181l0lvhsvxip3nahcnsynzc5zxm-javy-unstable-2024-03-05-vendor.tar.gz
javy> Finished cargoSetupPostUnpackHook
javy> patching sources
javy> Executing cargoSetupPostPatchHook
javy> Validating consistency between /build/source/Cargo.lock and /build/javy-unstable-2024-03-05-vendor.tar.gz/Cargo.lock
javy> Finished cargoSetupPostPatchHook
javy> configuring
javy> building
javy> /nix/store/923a1kaypjsk2dz4qjj6anxylk8127xd-cargo/bin/cargo: line 3: /nix/store/923a1kaypjsk2dz4qjj6anxylk8127xd-cargo/bin/cargo: Argument list too long
javy> /nix/store/923a1kaypjsk2dz4qjj6anxylk8127xd-cargo/bin/cargo: line 3: /nix/store/923a1kaypjsk2dz4qjj6anxylk8127xd-cargo/bin/cargo: Success
error: builder for '/nix/store/mz3z3faan13f0a8304ndx2hv761vf0bc-javy-unstable-2024-03-05.drv' failed with exit code 126;

Will appreciate any help. Thanks for reading (and for fenix)!

@eureka-cpu
Copy link

Try adding the -L option, it may give you more information about the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants