Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Bring back "load module from fd" #101

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wgwoods
Copy link
Contributor

@wgwoods wgwoods commented Aug 23, 2021

This builds on the previous PR (#100) and brings back the ability to load the WebAssembly module from an inherited file descriptor, using the new --module-on-fd NUM flag. (The docstring in main.rs has been updated accordingly.)

@wgwoods wgwoods force-pushed the module-on-fd branch 2 times, most recently from 4b318f3 to e20f294 Compare August 24, 2021 14:42
src/main.rs Outdated
let mut reader = File::open(&path)
.with_context(|| format!("failed opening {:?}", path))?;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like cfg_if! in general. And it doesn't make sense here either. Let's find a way to split this more reasonably and drop the dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed an updated version that drops cfg_if in favor of a helper function.

This patch brings back the ability to load the module to be run from an
open file descriptor, which must be 3 or higher (so as not to collide
with stdin/stdout/stderr).

It also tweaks CLI parsing slightly - the '--' separating wasmldr args
from module args is now required.

Signed-off-by: Will Woods <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants