deno_installer icon indicating copy to clipboard operation
deno_installer copied to clipboard

Fix 'create_installer' obsolete encoding operation

Open ovsky opened this issue 3 years ago • 7 comments

New Deno versions requires using of the Uint32 / BigInt, instead Uint8Array, when exporting module function. The original way currently resusts in error and exception when trying to createInstaller(), when using latest and probably some previous Deno releases.

  error: Uncaught (in promise) TypeError: Invalid FFI pointer type, expected null, integer or BigInt
  let rawResult = _lib.symbols.create_installer(a0_buf, a0_buf.byteLength)
                               ^
    at create_installer (file:///D:/Projects/Personal/deno_installer/bindings/bindings.ts:59:32)
    at Installer.createInstaller (file:///D:/Projects/Personal/deno_installer/mod.ts:18:11)
    at async file:///D:/Projects/Personal/deno_installer/examples/oak/build.ts:24:1

I've make a small fix in ths PR, which result is that the Installer is working well again, by using Uint32 in the bindings.ts create_installer method export.

ovsky avatar Jan 24 '23 16:01 ovsky

Looks like Windows is failing, do you mind taking a look? If you can't, I will do it :D

marc2332 avatar Jan 24 '23 16:01 marc2332

Yeah, there was a single problem when trying to create UnsafePointerView, which caused error when trying to run candle by Windows tests.ts. I have missed it beacuse the whole deno_bindgen were running well on my machine.

I have pushed new commit, that fixes also this issue. Now all tests should pass (and passes on my PR branch actions). So, let's try if you can (I can't run the pipeline on your repo)! :D

ovsky avatar Jan 24 '23 17:01 ovsky

hehe, looks like it's still failing 🤔

marc2332 avatar Jan 24 '23 18:01 marc2332

Damn, I can't reproduce this failure - in remote pipeline log I see only one important error - the weird candle execution exception after assert(exist) call - maybe it's related to GitHub pods, as it sometimes is?

Everything works well on my personal machine, on this PR:

img

Please, try to re-run the tests in a while. In the meantime, I'll try to reproduce the problem.

ovsky avatar Jan 24 '23 18:01 ovsky

It also happened on my windows, weird 🤔

marc2332 avatar Jan 24 '23 20:01 marc2332

I might know why, not your fault, I will push the fix asap 😄

marc2332 avatar Jan 24 '23 20:01 marc2332

It works now thanks @marc2332 @ovsky

git clone [email protected]:ovsky/deno_modern_installer.git
cd deno_modern_installer
cargo build --release
cd examples/oak
deno run --allow-all --unstable build.ts

7flash avatar Sep 16 '23 15:09 7flash