Closed dong-lufei closed 1 year ago
Try running with deno run -A --unstable index.ts
, as described here:
Since this library depends on the unstable FFI API, you must pass --allow-env, --allow-ffi and --unstable flags. Network and FS permissions are also needed on macOS and Linux to download and cache prebuilt library. It's recommended to just use --allow-all/-A flag since FFI basically gives full access.
deno run -A --allow-ffi --unstable index.ts OK 了
If you pass -A, --allow-ffi isn't needed separately. Apart from that, is it working for you now?
At that time, I ran deno run -A --unstable index.ts and also reported an error. I don’t know if it is a cache problem or a problem with our Chinese firewall. So adding --allow-ffi found that the operation was successful.
That is quite weird. Try upgrading to Deno 1.30.0 and Deno SQLite3 0.7.3 and run with deno run -A --unstable index.ts
Thanks first of all for all the hard work on this! I am unfortunately also experiencing a similar issue.
Testing on WSL on Windows 10, Description: Ubuntu 20.04.5 LTS
deno 1.30.2 (release, x86_64-unknown-linux-gnu) v8 10.9.194.5 typescript 4.9.4
Running the same code as OP, I get:
$ deno run -A --unstable testsqlite.ts
Download https://github.com/denodrivers/sqlite3/releases/download/0.7.3/libsqlite3.so
error: Uncaught Error: Failed to load SQLite3 Dynamic Library
const error = new Error("Failed to load SQLite3 Dynamic Library");
^
at https://deno.land/x/sqlite3@0.7.3/src/ffi.ts:566:17
Caused by: Error: Could not open library: Could not open library: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/johan/.cache/deno/plug/https/github.com/72de3c3884468e55e916274372759c9b1c01127577737e7dfaa5b56718dcdb40.so)
at new DynamicLibrary (deno:ext/ffi/00_ffi.js:368:48)
at Object.dlopen (deno:ext/ffi/00_ffi.js:500:12)
at prepare (https://deno.land/x/plug@0.5.2/plug.ts:117:15)
at async https://deno.land/x/sqlite3@0.7.3/src/ffi.ts:549:12
Where is GLIBC_2.33 coming from and how to install?
So upgrading to WSL Ubuntu 22.04.1 LTS solved the problem with that library on 20.04 being an unsupported version.
@johanbove yeah, since the libsqlite3.so
file is built on a ubuntu-20.04 runner, that means it's only compatible on computers with a glibc version of 2.33
or higher.
@DjDeveloperr would you accept a PR that changes the GH action workflow to use ubuntu-20.04
instead of ubuntu-latest
, so the libsqlite3.so
is compatible with more servers? Currently ubuntu-latest
points to ubuntu-22.04
, and GLIBC version 2.33
is pretty high and doesn't run in a lot of places. Another option is the ubuntu-18.04
runner, but that's gonna be deprecated in a few months
PR would be welcome @asg017 :) I'll make a new release 0.7.4 later once the patch lands
Next release will have support for older GLIBC versions (to an extent), otherwise this issue seems pretty stale so I'll close it for now.
example:
deno run -A index.ts
deno v1.29.4