RJ Budzyński
RJ Budzyński2mo ago

deno notebook can't import skia_canvas

It seems that --unstable-ffi is required, but I have no idea how to make the deno jupyter kernel use that flag.
14 Replies
Deno AI Helper
Deno AI Helper2mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on your message, if the skia_canvas module requires the --unstable-ffi flag, you would typically need to pass this flag to the Deno runtime when it starts. For the Deno Jupyter kernel, you would need to configure it to pass the --unstable-ffi flag to the Deno runtime. This configuration might involve modifying the kernel specification or the startup script that initializes the Deno runtime within the Jupyter environment. Please note that this advice is not based on the Deno documentation, and I would recommend double-checking the accuracy of this advice. You might also want to explore the documentation or support resources specific to the Deno Jupyter kernel or reach out to the community for more detailed guidance on how to configure the kernel with additional Deno flags.
NeTT
NeTT2mo ago
I can import it tho from both /x and jsr
RJ Budzyński
RJ Budzyński2mo ago
I'm on Linux in case it matters, and the trace says that dlopen not found. I'm trying at the CLI now - with --unstable-ffi the message about dlopen goes away, instead there is an error involving shared library incompatibility. FWIW I'm on current ubuntu LTS. /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found - that's the message
AapoAlas
AapoAlas2mo ago
Hmm. That's probably either a sign that you need to provide some LD_LIBRARY_PATH or that you're trying to run a library that's not meant for Linux.
RJ Budzyński
RJ Budzyński2mo ago
No idea where that could be coming from. I'm guessing that import skia_canvas downloads a native binary shared lib, that is compiled with a dependency that's not present on my system. Pretty weird considering that I'm running the most common linux distro there is, and it's fully up to date.
AapoAlas
AapoAlas2mo ago
Stack Overflow
"`GLIBCXX_3.4.32' not found" error at runtime. GCC 13.2.0
I am using Ubuntu 22.04.3 LTS in WSL. I successfully built and installed GCC 13.2.0 from source. This is how I configured it: ../gcc/configure --host=x86_64-pc-linux-gnu --disable-multilib --enable-
RJ Budzyński
RJ Budzyński2mo ago
Hmm the output of strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX on my system ends with GLIBCXX_3.4.30. I guess this means that the shared lib pulled in by skia_canvas is compiled with a newer gcc? So I need to either install a newer libstdc++, or try to import an older version of skia_canvas?
AapoAlas
AapoAlas2mo ago
🤔 Honestly not sure.
RJ Budzyński
RJ Budzyński2mo ago
Even that, if the guess is right, would only fix importing outside of notebooks - because in a notebook the error I get is Deno.dlopen is not a function.
AapoAlas
AapoAlas2mo ago
I think I remember people using FFI from notebooks somehow. Probably just a matter of figuring out how the unstable-ffi parameter should be passed in.
NeTT
NeTT2mo ago
I haven't had any problem with ffi in notebooks I never had to pass any --unstable-ffi they just worked
AapoAlas
AapoAlas2mo ago
(Specifically I remember someone asking why print to stdout from within FFI libs aren't appearing in notebook output. That's still not done though.) Were you possibly using the general --unstable flag back then?
NeTT
NeTT2mo ago
I am one of those who asked that Just hitting run worked in Jupyter notebooks
RJ Budzyński
RJ Budzyński2mo ago
I wouldn't know how to pass a flag like --unstable to a jupyter kernel - and that is the problem, maybe this changed over deno versions?