Skip to content

Statically import libsql targets#89

Closed
msanchezdev wants to merge 1 commit intotursodatabase:mainfrom
msanchezdev:main
Closed

Statically import libsql targets#89
msanchezdev wants to merge 1 commit intotursodatabase:mainfrom
msanchezdev:main

Conversation

@msanchezdev
Copy link
Copy Markdown

I am not sure if there are more targets, but developing with bun using the single-file executable mode the libsql driver fails to be imported from the embedded file system as Bun doesn't detect what files are to be imported if done dynamically.

As the code dynamically imports the proper target module we can get a false positive if the built file is run in a project that has the node_modules/@libsql/* target folders so it's recommended to test this by copying the binary file to another directory or simply running it from somewhere else:

e.g:
image

Image Error Transcript:

error: Cannot find module "@libsql/linux-x64-gnu" from "/$bunfs/root/test-build"

@msanchezdev msanchezdev marked this pull request as draft March 11, 2024 12:31
@penberg
Copy link
Copy Markdown
Contributor

penberg commented Mar 11, 2024

Oh, nice @msanchezdev! Does it mean we can drop the @neon-rs/load dependency too?

@msanchezdev
Copy link
Copy Markdown
Author

msanchezdev commented Mar 11, 2024

@penberg I wasn't sure about neon, have to check how it works, but I am trying another approach now as this way it actually seems to be bundling all into the binary

@giovannibenussi
Copy link
Copy Markdown
Contributor

Hey, there are any updates regarding this? It would be nice to drop the @neon-rs/load dependency!

@penberg penberg force-pushed the main branch 3 times, most recently from 3dd2f0a to 4a3f0cc Compare June 17, 2024 06:51
@penberg
Copy link
Copy Markdown
Contributor

penberg commented Jun 12, 2025

Obsoleted by #182

@penberg penberg closed this Jun 12, 2025
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

Successfully merging this pull request may close these issues.

4 participants