wasmerio/wapm-cli

The WebAssembly Package Manager CLI

md of Wasmer, you can install wapm-cli together by the following command:

Introduction

. This tool enables installing, managing, and publishing wasm packages on the wapm.io registry.

Installation

With Wasmer:

As described in README.md of Wasmer, you can install wapm-cli together by the following command:

curl https://get.wasmer.io -sSfL | sh

With Cargo:

cargo install wapm-cli

With Homebrew:

brew install wapm

Get Started

Read the wapm-cli user guide on wapm.io to get started using the tool and use the wapm-cli reference for information about the CLI commands.

Get Help

Feel free to take a look at the WAPM documentation. You can also join the discussion on spectrum chat in the wapm-cli channel, or create a GitHub issue. We love to help!

Contributing

See the contributing guide for instruction on contributing to wapm-cli.

Development

Update GraphQL Schema

If the WAPM GraphQL server has been updated, update the GraphQL schema with:

graphql get-schema -e prod

Note: You will need graphql-cli installed for this: npm install -g graphql-cli.

Issues

Collection of the latest Issues

wchaudry

wchaudry

enhancement
Comment Icon0

When a user does a login with wapm login wap_b66ca3797418d17a90429baaaadb5b910846f58b2130864f10eca75e4ad971e0 you should show in the response to the user at least her username instead of just log the message `Login for WAPM saved”

wchaudry

wchaudry

enhancement
Comment Icon0

When initializing with wapm init the name of the package suggested should concatenate the username + directory, otherwise, when publishing, it complains about “Error: Global use for aliases is disabled for now. Try renaming your package to: 'francisco-perez-sorrosal/simple_wasmer' or use a different namespace”

Action: Provide the default user namespace Alternative: Provide a list of namespaces the user might be a member of.

syrusakbary

syrusakbary

Comment Icon0

If you create a command with an identical name that another one already installed, wapm does not throw an error/warning (e.g. I created a command python when I already had Syrus’ package already installed)

Michael-F-Bryan

Michael-F-Bryan

Comment Icon0

Describe the bug

The wapm CLI tool doesn't use the $WASMER_DIR variable when saving its logs or database file.

Steps to reproduce

Expected behavior

The wapm CLI should have written wapm.log and wapm.sqlite to ~/.config/wasmer ($WASMER_DIR).

Actual behavior

It uses the hard-coded ~/.wasmer directory.

Additional context

This version of wapm was installed via cargo install.

Michael-F-Bryan

Michael-F-Bryan

Comment Icon3

Describe the bug

The error message that gets printed when wapm can't parse a wapm.toml file give the user no way of fixing the parse error.

Given the following wapm.toml:

Trying to publish it then says it was unable to parse the cuboid-model module, but doesn't actually say what was wrong with the module or how I can fix it.

Expected behavior

I would expect the wapm CLI to tell me why it was unable to build the package. In this case, the error message would probably look like:

Additional context

Michael-F-Bryan

Michael-F-Bryan

Comment Icon1

Motivation

Publishing a Rust crate to WAPM is currently a manual task where you need to modify your manifest.toml then make sure you compile in release mode and move all files to be published into the right place.

Proposed solution

Create a cargo wapm command which will automatically publish a Rust crate to WAPM.

As part of the publishing process, it would

  • Offer to bump version numbers and add a git tag (I'm on the fence for this one because I'll typically just use cargo release)
  • compile the crate in release mode
  • automatically construct a manifest.toml based on your existing Cargo.toml (possibly with the help of the metadata table)
  • copy everything to the target/wapm/ folder
  • Publish to WAPM

I'm not sure of the semantics regarding Cargo workspaces vs packages here. It might make sense for a single Rust crate to correspond to a single WAPM package, but at the same time you might want the entire workspace to be a WAPM package and each crate gets added as a [[module]].

Alternatives

Nothing about this process requires knowledge of WAPM internals, so it's quite feasible for users to roll their own solution. This might look like a cargo xtask, an explicit deploy.sh script, or a task in your project's Makefile.

BernhardRode

BernhardRode

Comment Icon0

Describe the bug

I'm trying to install wasmer on latest OS X. And i get an error about wasmer not being able to install cowsay.

So it created some folders, but did not manage to put the cowsay.wasm file into the correct folder.

Steps to reproduce

Error

Expected behavior

Cowsay should be installed and executable via cowsay

Actual behavior

I did a clean install and tried to run wapm install -g cowsay

Additional context

I saw that $WASMER_CACHE_DIR was not created during install, so i created it, which did not help.

I've also seen, that the error outputs for package "syrusakbary/cowsay 0.2.0". No such file or directory (os error 2)where there is a space in the package name. Could this be the issue?

MarkMcCaskey

MarkMcCaskey

Comment Icon0

The Wapm update notification will display the wrong thing if the value stored there is out of date.

For example if the value in the $WASMER_DIR/.wapm_update.json is 1.0.0-alpha3 and we're on 1.0.0-beta1, it will say to update to an older version because it's different and we don't invalidate the old value stored there.

We should put a relatively short lifetime on the value stored there to prevent this from happening.

erlend-sh

erlend-sh

Comment Icon0

Some of the newest package managers being made are effectively becoming package manager platforms. See for instance Yarn v2:

https://github.com/yarnpkg/yarn/issues/6953

Yarn will be designed to support different install targets than Node

Package management is a problem that keeps on being reinvented - even Yarn itself did it in the past. We believe the reason for this is that all package managers need to layout the installed packages in slightly different ways in order for them to be read by the host. This unfortunately is rarely possible, and it ends up being easier to rewrite the package manager and discard the already-existing user experience and features. Starting from Berry, we made it an explicit goal that each component of our pipeline can be switched to adapt to different install targets. In a way, Yarn will now be a package manager platform as much as a package manager. If you're interested into implementing PHP, Python, Ruby package installers without ever leaving Yarn, please open an issue and we'll help you get started!

Does WAPM have similar design goals as a platform?

whitequark

whitequark

Comment Icon1

Motivation

I've published many of the FOSS FPGA tools as WebAssembly-based PyPI packages in the YoWASP project. All of these tools require data files located in the filesystem, and it is impractical to adjust their code to read file data embedded directly in the binary. Because of this, they are currently distributed together with a small Python stub that sets up the preopens.

I'd like to distribute these tools via WAPM too.

Proposed solution

It would be great if WAPM made it possible to provide data files as a part of the package. These files would be mounted in a location accessible only to the package itself, preopened automatically.

Alternatives

Some kind of WASI interposer that allows embedding data files in the WASM file without requiring any changes to the source would also work.

KSXGitHub

KSXGitHub

Comment Icon0

Motivation

I want to publish my package automatically from CI, but wapm authentication model does not make it easy:

  • wapm login provides no option to login without user interaction.
  • wapm.io does not provide auth token, meaning that I have to save my password in the CI. This may pose a security threat.

Proposed solution

Provide a way to publish package using auth token.

Alternatives

Additional context

vshymanskyy

vshymanskyy

Comment Icon0

Currently it's possible to download a wasm file from wapm io, i.e following a link: https://registry-cdn.wapm.io/contents/vshymanskyy/wasm3/0.4.6/build/wasm3.wasm

It would be nice if we could download the latest version without specifying the exact version, like #404

Also, in this case it would be beneficial to access the wapm.toml file, i.e: #404

I'd like to use WAPM registry directly in some of my CI scripts.

frank-dspeed

frank-dspeed

Comment Icon8

Thanks for proposing a new feature!

Motivation

It would be nice if I could build a local proxy registry as we did it with verdaccio for npm. The idea here is to run a small proxy in front of your registry that supports additional login and private packages. as also acting as an offline registry.

Proposed solution

opensource the full registry implementation so we can run a similar one locally.

Alternatives

Open Source, at last, a 100% Spec for the registry.

Additional context

Add any other context or screenshots about the feature request here.

alexreg

alexreg

Comment Icon1

This is just a note that I created a macOS Homebrew formula for wapm (naturally named wapm), and this got merged today, so it's now available. Maybe you can put it in one of your guides (or not, no big deal).

MarkMcCaskey

MarkMcCaskey

bug
Comment Icon0

@torch2424 ran into an issue with source being a relative path that started with ../.. and was outside the manifest directory. The error message they got was vague enough that there's no chance someone not familiar with the code would be able to spot the error.

MarkMcCaskey

MarkMcCaskey

enhancement
Comment Icon1

It'd be nice to be able to install globally from a local package, something like wapm install --path . or something. Suggested by @torch2424

filips123

filips123

Comment Icon10

Describe the bug

I can't run python and rustpython packages with WAPM.

I tested this both with global Wasmer installation on Windows and Wasmer installation on Debian Buster in Docker Toolbox on Windows 10. Both of them don't work.

Enviroment

Windows:

Debian in Docker:

Logs

Windows, after wapm run python:

Debian, after wapm run python:

Steps to reproduce

  1. Install python package with WAPM.
  2. Try to run python package with WAPM.
  3. You will see error (on Windows) or nothing will happen (Debian).

Expected behavior

I should be able to run packages with WAPM.

Actual behavior

Windows

After trying to run python package with WAPM, this happens:

Manually running python.wasm while specifying llvm as backlend results in other problem:

It does nothing, it just hangs. But after about half-a-minute, the process just stops, also without any output.

It happens the same with rustpython package.

Debian

After trying to run python package with WAPM, this happens:

But sometimes is just hangs as on Windows.

However, rustpython works here:

The only problem with rustpython on Debian is that it takes a few seconds to load.

MarkMcCaskey

MarkMcCaskey

Comment Icon1

There are places where shell injection is probably possible.

Hopefully there's a Rust crate for this.

This should be fixed before the next release

MarkMcCaskey

MarkMcCaskey

enhancement
Comment Icon0

This is a tracking issue for improving the security of wapm. Feedback welcome!

We should aim for at least tier 2 with the less intrusive parts of tier 3 from https://github.com/OWASP/packman#tiers-and-controls

Tier 2

  • Strong Authentication (verify that this is the case)
  • MFA To Push Artifacts
    • Add 2fa
    • integrate it into wapm-cli
  • Security Contacts
  • Packages Can Notify of Security Issues
    • design this system
  • Code package tied to source code (ambiguous, relevant?)
  • Prevents Credential from Being Published
    • prevent private key from being published
      • packaging
      • key registration
    • protect password?
      • design this (scanning through all data is harder if salted + hashed, but we shouldn't store the password directly either)
  • Update notifications
    • wapm itself
    • packages too (design this system)
galo

galo

question
Comment Icon4

Summary

Can wasmer/wapm run on Alpine distributions without glibc, so it can be packaged in container such as

xmclark

xmclark

bug
Comment Icon0

wapm-cli incorrectly fills the ABI field when it is missing. This causes the ABI to be set to None when not explicitly set for WASI projects.

To re-create issue: Create a rust project that targets WASI. Create the wapm toml below. Install a new dependnecy with wapm-cli e.g. wapm install sqlite

After install, The toml will updated to include the dependency, and the module will be updated to include the ABI field with the default of None. This is incorrect because the module is actually a WASI module.

Versions

Find the latest versions by id

v0.5.4 - Apr 07, 2022

What's Changed

New Contributors

Full Changelog: https://github.com/wasmerio/wapm-cli/compare/v0.5.3...v0.5.4

v0.5.3 - Feb 18, 2022

This release fixes a bug with the wapm install mechanism (caused by a tempfile issue)

v0.5.2 - Feb 15, 2022

WAPM can now compile to WASI, and also has the ability to add custom access tokens via login.

v0.5.1 - Apr 01, 2021

Minor changes and version bump, see the changelog for all the details.

v0.5.0 - Mar 11, 2020

Adds wax command, WAPM_RUNTIME environment variable for easy interoperability with other WebAssembly runtimes, and various miscellaneous improvements

0.4.3 - Jan 16, 2020

0.4.2 - Jan 08, 2020

Fixes a bug related to the manifest resolution rules causing some features to not work when installed globally or locally

0.4.1 - Nov 12, 2019

Fixes a bug with migrating lockfile version 3 to version 4

0.4.0 - Nov 11, 2019

Changes

  • Added the wapm add and wapm remove commands for adding dependencies from the command line.
  • Changed wapm init to be interactive, use wapm init -y for the non-interactive mode.

v0.3.7 - Jul 31, 2019

Changelog

  • Remove unwrap in validate subcommand
  • Make update notifications async; add config option

v0.3.6 - Jul 23, 2019

Adds precaching by storing hashes of modules in the lock file and an update notification and daily check

v0.3.5 - Jul 16, 2019

Adds proxy support, new wasm interface syntax, and a bug fix with the run command

v0.3.4 - Jul 05, 2019

This release includes changes to Wasm Interface which improve the error messages and fixes bugs relating to validating exports . It also simplifies the syntax of interfaces in the manifest file.

0.3.3 - Jul 03, 2019

Fixes a bug related to signed packages in the global namespace and cached keys

v0.3.0 - Jun 17, 2019

Added

  • Wasm contracts (experimental way of validating imports and exports)
  • Package signing
    • Packages can be signed and verified with Minisign keys
    • wapm keys for relevant subcommands
  • SQLite database as backing store for data like keys and contracts

Information - Updated Jul 27, 2022

Stars: 303
Forks: 27
Issues: 37

Repositories & Extras

maomi: A rust wasm framework for building pages with components

maomi is a MVVM-like framework for web development

maomi: A rust wasm framework for building pages with components

Rust / Wasm client web app framework

Pull requests which improve test coverage are also very welcome

Rust / Wasm client web app framework

A Rust/WASM Library to interact with Bitcoin SV

npm i bsv-wasm-bundler --save

A Rust/WASM Library to interact with Bitcoin SV

WASM / Rust / D3 example

Fetch data with Rust + WASM and show it with JS + D3

WASM / Rust / D3 example

@texhno-rust-wasm-game-of-life

A template for kick starting a Rust and WebAssembly project using Tutorial

@texhno-rust-wasm-game-of-life

rust wasm worker hello world

Built using the template at which

rust wasm worker hello world

👷‍♀️🦀🕸️ rustwasm-worker-template

A template for kick starting a Cloudflare worker project using

👷‍♀️🦀🕸️ rustwasm-worker-template

Rust WASM Web Worker Examples

This repository contains four different examples of using web workers in conjunction with WASM in

Rust WASM Web Worker Examples

rust-wasm-mandelbrot

WebAssembly でマンデルブロ集合を描きます

rust-wasm-mandelbrot
Facebook Instagram Twitter GitHub Dribbble
Privacy