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

Can't run haskell plugins #5

Closed
mhmd-azeez opened this issue Jun 2, 2024 · 1 comment
Closed

Can't run haskell plugins #5

mhmd-azeez opened this issue Jun 2, 2024 · 1 comment
Assignees

Comments

@mhmd-azeez
Copy link
Collaborator

Uncomment the haskell test and then run npm run test:

PS D:\dylibso\pg_extism> npm run test

> @extism/extism-plv8@1.0.0-rc1 test
> cross-env NODE_OPTIONS='--experimental-wasi-unstable-preview1' jest --coverage --config jest.config.js

  console.debug
    Haskell (reactor) runtime detected.

      at debug (src/index.ts:631:11)

  console.log
    newBoundTask: RTS is not initialised; call hs_init() first

      at log (src/index.ts:423:17)

  console.log


      at log (src/index.ts:423:17)

 FAIL  tests/index.test.ts
  test extism
    √ fails on hash mismatch (32 ms)
    √ can create and call a plugin (8 ms)
    √ can detect if function exists or not (4 ms)
    √ errors when function is not known (8 ms)
    √ plugin can allocate memory (268 ms)
    √ plugin can fail gracefuly (4 ms)
    √ host functions works (7 ms)
    √ can deny http requests (10 ms)
    × can initialize haskell runtime (60 ms)

  ● test extism › can initialize haskell runtime

    proc_exit: 1

      489 |       },
      490 |       proc_exit(rval: number): void {
    > 491 |         throw new Error(`proc_exit: ${rval}`);
          |               ^
      492 |       },
      493 |       clock_time_get(id: number, precision: bigint, time: number): number {
      494 |         const buffer = new DataView(memory().buffer);

      at proc_exit (src/index.ts:491:15)
      at __wasi_proc_exit (wasm:/wasm/00459472:1:27082)
      at _Exit (wasm:/wasm/00459472:1:45622)
      at exit (wasm:/wasm/00459472:1:90271)
      at stg_exit (wasm:/wasm/00459472:1:695506)
      at newBoundTask (wasm:/wasm/00459472:1:82416)
      at rts_lock (wasm:/wasm/00459472:1:572802)
      at testing (wasm:/wasm/00459472:1:790932)
      at Plugin.func [as callRaw] (src/index.ts:101:5)
      at Plugin.callRaw [as call] (src/index.ts:107:25)
      at Object.<anonymous> (tests/index.test.ts:124:35)

----------|---------|----------|---------|---------|--------------------------------------------------------------------------------------------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|--------------------------------------------------------------------------------------------------------
All files |   64.28 |    48.61 |   59.09 |   64.72 |
 index.ts |   64.28 |    48.61 |   59.09 |   64.72 | ...399,430-488,494-525,533,539-550,561,586,588-592,598,627,647,650,655-657,669,707-732,775,796,814,824
----------|---------|----------|---------|---------|--------------------------------------------------------------------------------------------------------
Test Suites: 1 failed, 1 total
Tests:       1 failed, 8 passed, 9 total
Snapshots:   0 total
Time:        1.681 s, estimated 2 s
Ran all test suites.
@mhmd-azeez mhmd-azeez self-assigned this Jun 2, 2024
@mhmd-azeez
Copy link
Collaborator Author

Fixed in ea14584

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

1 participant