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

Support Deno.dlopen for bundling libraries #21

Closed
mwcz opened this issue Jan 25, 2022 · 6 comments
Closed

Support Deno.dlopen for bundling libraries #21

mwcz opened this issue Jan 25, 2022 · 6 comments

Comments

@mwcz
Copy link

mwcz commented Jan 25, 2022

This is somewhat related to #19, but I opened a separate issue because dlopen seems uniquely different from other filesystem reads. This would be make it possible to use leaf to bundle, a Rust library, for example, in a single executable.

@clemens-tolboom
Copy link
Contributor

Testing the CLI

Deno --unstable
> Deno.dlopen
[Function: dlopen]

Leaf uses const fileContent = Deno.readFileSync(filePath); and overrides it.

Can you provide a typescript example opening and serving out from a Deno.readFileSync + (magic?) + Deno.dlopen using a public DLL?

@mwcz
Copy link
Author

mwcz commented Mar 15, 2022

Consensus in discord is that this request isn't possible because dlopen is provided by the OS, so it can't be overridden in leaf.

@mwcz mwcz closed this as completed Mar 15, 2022
@clemens-tolboom
Copy link
Contributor

Where did that discussion took place? Do you have a link to Discord discussion? I spend some time writing so useful feedback would help :-)

@mwcz
Copy link
Author

mwcz commented Mar 15, 2022

Sure, here's the conversation. I'm not sure how to link to discord messages, but here's some screenshots.

markup_23931
markup_23934
Screenshot_20220315-134903
Screenshot_20220315-134925

@clemens-tolboom
Copy link
Contributor

clemens-tolboom commented Mar 15, 2022

Thanks for your answer ... lol ... discussed a long time ago :-p

I just clicked the ellipsis then Copy Message Link https://discord.com/channels/684898665143206084/769285344809451572/935575448254054461

image

I myself was wondering as Leaf stores files you could extract it to real FS then load it with dlopen, but have no experience with dlopen yet.

@mwcz
Copy link
Author

mwcz commented Mar 16, 2022

Ah, I was on my phone and the copy link feature must not be possible on discord mobile.

What you suggest should work, it's just kind of a pain and introduces new error cases that have to be handled, like fs permission errors, no tmp dir available, no disk space, etc. It's what I was getting at with this comment in the thread:

Screenshot_20220316-093959

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

2 participants