Giter Site home page Giter Site logo

cargo-wasmer's People

Contributors

dynamite-bud avatar michael-f-bryan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cargo-wasmer's Issues

Shall it be `cargo wapm publish` instead of just `cargo wapm`?

I tried cargo wapm, expecting to see what WAPM-related commands does cargo-wapm has. But it immediately tried to publish the package.

Maybe publishing should be a separate subcommand (even if currently it is the only subcommand), to make room for other future things like cargo wapm add for adding dependencies from WAPM? Or cargo wapm yank for unpublishing packages, if/when it will be supported.

Add compiled binaries to GitHub Releases

It'd be nice if people can use cargo wapm in CI without needing to do a full cargo install cargo-wapm.

Let's add a releases.yml job which will compile binary artifacts, create a release, and attach the artifacts to it. We'd also want to update README.md with a one-liner people can use to download the latest binaries.

Allow one `Cargo.toml` file to generate a WAPM package with multiple modules

When constructing a wapm_toml::Manifest, we call determine_target() which takes a cargo_metadata::Package (i.e. a parsed Cargo.toml) and returns a reference to the one cargo_metadata::Target in that Package. From there, we construct a wapm_toml::Manifest with a single wapm_toml::Module that corresponds to that Target (i.e. a WASI executable or WebAssembly library).

WAPM packages support multiple modules, so it'd be nice if our "autodiscovery" can generate a wapm_toml::Manifest containing multiple wapm_toml::Modules, where we have one Module per Target (e.g. if your crate contains a library and a binary, the WAPM package would make both available).

Wai manifest error while publishing

When I use cargo wapm --dry-run with the following:

[package.metadata.wapm]
namespace = "wasmer"
abi = "none"
bindings = { wai-version = "0.2.0", exports = "sha2.wai" }

I get the errrors:

Error: Could not parse manifest because missing field `wit-exports` for key `module.bindings` at line 14 column 1.
Error: Unable to publish "sha2-wasm"

Caused by:
    The wapm CLI exited unsuccessfully with exit code -1

Publish to the registry directly

Publishing Rust crates with the wapm command no longer works because you run into validation errors around bulk memory operations.

$ cargo wapm --dry-run
2023-07-19T02:43:40.113941Z  INFO publish: cargo_wapm::publish: Getting ready to publish dry_run=true pkg="wapm-to-webc"
Error: WASM file "/Users/work/Documents/wasmer/pirita/target/wapm/wapm2pirita.wasm" detected as invalid because bulk memory support is not enabled (at offset 4615795)
            ╭─────────────────────────────────────────────────────────────────────────────╮
            │                                                                             │
            │       There's a new version of wasmer and wapm! 4.0.0-beta.1 → v3.3.0       │
            │      Changelog: https://github.com/wasmerio/wasmer/releases/tag/v3.3.0      │
            │                       Update with wasmer self-update                        │
            │                                                                             │
            ╰─────────────────────────────────────────────────────────────────────────────╯
Error: Unable to publish "wapm-to-webc"

Caused by:
    The wapm CLI exited unsuccessfully with exit code 255

The wapm command has also been removed from the Wasmer toolchain and its functionality was merged into the main wasmer CLI. As part of this migration, we also renamed wapm.toml to wasmer.toml.

To avoid more breaking changes in the future, we should publish to the Wasmer registry directly. This will involve:

  • Generate a wasmer.toml instead of wapm.toml
  • Publish to the registry (either via wasmer_registry::publish or by querying the GraphQL API directly)

Cannot publish WASI command-line tool.

There is a tool that can be built for WASI along with other non-wasm platforms.

But cargo wapm does not to publish it.

$ cargo wapm --dry-run
2022-08-12T21:39:43.681554Z  INFO publish: cargo_wapm: Publishing dry_run=true pkg="random-distributions-cli"
Error: Unable to publish "random-distributions-cli"

Caused by:
    The package doesn't contain a library with the "cdylib" crate-type

Or is WAPM only for libraries, not for executables, unlike crates.io?

Metadata files contain absolute paths

It looks like when cargo-wapm generates the wapm.toml, it uses absolute paths for things like the README rather than making them relative to the base directory.

Here is one example:

[package]
name = "aysjha/sgp3"
version = "0.1.5"
description = "sgp4 for wasm, published on WAPM"
license = "MIT OR Apache-2.0"
readme = "/Users/ayushjha/git/wasmer/sgp4/README.md"

This used to work previously because we never did any validation on the manifest and wapm2pirita blindly copied everything from the package directory into the *.tar.gz file that gets published, whereas newer versions are more selective in what they upload.

@ayys this is why we're seeing a bunch of failures at the moment.

Rename to "cargo wasmer"

With wasmerio/wasmer-toml#8 now being merged, we should rename the command to cargo wasmer and switch to the wasmer-toml crate.

For compatibility, it might be a good idea to leave the cargo-wapm binary around for a while and print a big warning so people know to use the cargo wasmer sub-command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.