Skip to content

WASM bindings broken? #181

@ste26054

Description

@ste26054

Hi!

I am trying to figure out how make make test-js work from the bindings folder (running Node 21.6.0). My goal is being able to evaluate vanilla jsonnet files with imports working through WASI.

I managed to get vm.evaluateSnippet to work on tag v0.5.0-pre96-test, but I cannot get vm.evaluateFile to work. It seems there was a refacto done at some point and bindings got broken 🤔. I now need to enable interop feature, but JsonnetImportCallback type got changed.

Here is my progress to make it work, though without much success for now: https://github.com/CertainLach/jrsonnet/compare/v0.5.0-pre96-test...ste26054:wasm-bindings?expand=1

make test-js                                                                                                                         
node --experimental-wasi-unstable-preview1 js/index
(node:70102) ExperimentalWarning: WASI is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Version = v0.19.1
4
Error: import io error: failed to find a pre-opened file descriptor through which "./test.jsonnet" could be opened
    at JsonnetVM.evaluateFile (/Users/ste26054/jrsonnet/bindings/js/index.js:74:18)
    at /Users/ste26054/jrsonnet/bindings/js/index.js:191:18

Any help would be much appreciated 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions