-
Notifications
You must be signed in to change notification settings - Fork 824
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
Introduce a package resolver #3831
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Michael-F-Bryan
force-pushed
the
resolver-abstraction
branch
from
May 1, 2023 11:14
b483615
to
f16a6da
Compare
syrusakbary
reviewed
May 1, 2023
syrusakbary
reviewed
May 1, 2023
john-sharratt
requested changes
May 2, 2023
theduke
reviewed
May 2, 2023
john-sharratt
approved these changes
May 2, 2023
Michael-F-Bryan
force-pushed
the
resolver-abstraction
branch
from
May 3, 2023 03:46
76ead4b
to
fbb72ab
Compare
theduke
approved these changes
May 3, 2023
(let’s not merge until we release Wasmer 3.3) |
Michael-F-Bryan
force-pushed
the
resolver-abstraction
branch
from
May 3, 2023 14:28
fbb72ab
to
d2862f2
Compare
…d a bunch of dead code
…webc" use case still works
Michael-F-Bryan
force-pushed
the
resolver-abstraction
branch
from
May 4, 2023 08:35
d2862f2
to
2f83b25
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This adds a
PackageResolver
getter toWasiRuntime
and wires it up to theModuleCache
.TL;DR:
WasiRuntime
trait now has apackage_resolver()
method which gives you anArc<dyn PackageResolver>
PackageResolver
will resolve package identifiers to aBinaryPackage
(expect the return type to change - eventually I want to return awasmer_wasix::runtime::resolver::ResolvedPackage
)PluggableRuntime
will use the "builtin" resolver fromlib/wasi/src/runtime/resolver/builtin.rs
by default, this just calls into the existingwasmer_wasix::wapm::fetch_webc()
code which uses the WAPM backend and will cache*.webc
files to diskBuiltinResolver::from_env()
constructor that will eventually set things up using$WASMER_HOME/wasmer.toml
(I've just added a quick'n'dirty implementation for now)ModuleCache::get_webc()
module now just defers toruntime.package_resolver().resolve_package(...)
because the PackageResolver implementation should be in charge of cachingModuleCache
doesn't keep the in-memory cache of resolvedBinaryPackage
s I've added awith_cache()
method that returnsInMemoryCache<Self>
so you can wrap an existingPackageResolver
with an in-memory caching layer--include-webc
flag fromwasmer run
because it used to explicitly add items to theModuleCache
's WEBC cache and all that code has been deleted (not sure if this should have been a hard delete or if we should warn people when they use it that--include-webc
is now a no-op)engine()
getter from theWasiRuntime
trait so we can introduce a separate mechanism for module compilation and caching (nothing used this anyway, they just calledWasiRuntime::new_store()
)CC: #3603.