#Trying to lock a wasm file

11 messages · Page 1 of 1 (latest)

elder tiger
#

Hey, I'm trying to use deno lock.json so that I can build something with Nix. One of the requirements of using Nix is that there has to be a deterministic list of dependencies because the build sandbox is cut off from the internet. I'm trying to lock https://deno.land/x/wasm@v1.2.2/wasi.ts, which depends on a .wasm file in https://deno.land/x/wasm@v1.2.2/pkg/wasmer_wasi_js_bg.wasm, but that dependency isn't getting recorded in my lock.json:

{
  "version": "2",
  "remote": {
    "https://deno.land/x/wasm@v1.2.2/pkg/wasmer_wasi_js.d.ts": "0e202696f693f922ed63e1f372dd7b4641ce587d357fcf32de3d09cb48785867",
    "https://deno.land/x/wasm@v1.2.2/pkg/wasmer_wasi_js.js": "33c58765ded371211b754157955a7ab1d2de921a9c8fee8748112d25605726dd",
    "https://deno.land/x/wasm@v1.2.2/wasi.ts": "4fde34f8fa8c52af06adcc241f1b18fabf2df0d8b1f1b62d05e70377688a8fcb"
  }
}

Is there a way to force-add the dependency to the list without having to do something like manually writing a lock.json with my own program?

elder tiger
#

hmm it looks like I may have to vendor my own copy of wasmer_wasi_js_bg.wasm somewhere and have the code specify the correct location at browser runtime. This is workable but a bit annoying. I'll do more hacking.

craggy bough
#

what's the big thing with nix btw

elder tiger
#

as in why am I using it?

craggy bough
#

yeah

elder tiger
#

I'm using it as a build automation tool to simplify deployment to my servers

#

mostly so I don't have to remember how to build things or leave things open to the unrelenting chaos of docker builds being nondeterministic

craggy bough
#

what's the compile time comparison between deno installed and deno with nix

elder tiger
#

i don't understand what you mean by your question

#

compile speed is not the only factor in the equation though, the determinism is the bigger factor so you can more reliably go from one input (source tarball) to one output (production ready package)

craggy bough
#

yeah I'm just curious about compile time