You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when the user runs wasmer run ls, the behaviour is as follows...
If the command has already been installed (i.e. wasmer install user/some-package where the package contains a ls command),
Execute it
Otherwise,
Ask the WAPM backend which packages include a ls command (query)
Automatically install the package that was most recently published
Execute it
This mostly works, but there’s no guarantee which package you are installing if someone else publishes a package with the same command name (not good for ergonomics or security).
One idea @syrusakbary raised is that we could use the [dependencies] section in wapm.toml (soon to be renamed wasmer.toml) to figure out which commands are available.
For example:
# wapm.toml
[package]
name = "..."
[[command]]
name = "ls"package = "markj/coreutils"
[dependencies]
"mark/coreutils" = "..""sharrattj/coreutils:ls" = "1.2.3"
To help users, the wapm install mark/coreutils command could automatically update the "closest" wapm.toml file, and running wasmer run ls without an ls command in your wapm.toml would give you a suggestion like this:
$ wasmer run lsERROR: The "ls" command isn't currently installed. You might want to install one of the following packages:- sharrattj/coreutils- mark2/coreutils
If we behave similar to git and npm by recursively searching parent files for a wapm.toml, this effectively gives us a "global install" command for free - if no wapm.toml is found, add it to $HOME/.wapm.toml (or $WASMER_HOME/wapm.toml or $HOME/.config/wasmer/wapm.toml or wherever).
The text was updated successfully, but these errors were encountered:
There is no longer the concept of "installing" commands. Instead, since merging the wapm and wasmer CLIs and re-implementing wasmer run (#3924), wasmer run will now accept
a URL or file path pointing to a *.webc file
the name (and version) of a package that we'll fetch from the current registry, or
the path to a directory containing a wasmer.toml file
Currently, when the user runs
wasmer run ls
, the behaviour is as follows...wasmer install user/some-package
where the package contains als
command),ls
command (query)This mostly works, but there’s no guarantee which package you are installing if someone else publishes a package with the same command name (not good for ergonomics or security).
One idea @syrusakbary raised is that we could use the
[dependencies]
section inwapm.toml
(soon to be renamedwasmer.toml
) to figure out which commands are available.For example:
To help users, the
wapm install mark/coreutils
command could automatically update the "closest"wapm.toml
file, and runningwasmer run ls
without anls
command in yourwapm.toml
would give you a suggestion like this:If we behave similar to
git
andnpm
by recursively searching parent files for awapm.toml
, this effectively gives us a "global install" command for free - if nowapm.toml
is found, add it to$HOME/.wapm.toml
(or$WASMER_HOME/wapm.toml
or$HOME/.config/wasmer/wapm.toml
or wherever).The text was updated successfully, but these errors were encountered: