Skip to content

Using crane with wasm-pack #193

Answered by ipetkov
yannham asked this question in Q&A
Dec 21, 2022 · 2 comments · 5 replies
Discussion options

You must be logged in to vote

Hi @yannham glad you are appreciating the documentation!

It's been a while since I've last used wasm-pack (especially since the last time I tried using it with Nix too) and I do remember hitting some headaches from it trying to access the network from inside the sandbox. Although it doesn't seem to support an offline mode, I believe it will skip trying to install various tools if they're already on the path (IIRC it needs pkgs.binaryen and pkgs.wasm-bindgen-cli on the PATH)

Assuming that fixes any sandbox related issues, I think it should be possible to make a build work. You might have to drop down to using mkCargoDerivation, here's a quick and dirty example:

{
  inputs = {
    nixpkgs.url 

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@yannham
Comment options

@ipetkov
Comment options

@yannham
Comment options

@ipetkov
Comment options

Answer selected by yannham
Comment options

You must be logged in to vote
1 reply
@ipetkov
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants