Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enables the craft build command to build and execute WASM modules from any filesystem path, addressing issue #199. It adds flexibility for developers to work with WASM projects located anywhere on the filesystem.
- Adds
--pathoption tocraft buildcommand for specifying arbitrary project directories - Introduces new
craft executecommand for running pre-built WASM files - Updates WASM host simulator to accept explicit WASM file paths via
--wasmflag
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| craft/src/main.rs | Adds --path flag to build command and new execute subcommand with CLI argument parsing |
| craft/src/utils/mod.rs | Improves project name detection by reading from Cargo.toml instead of relying on directory name |
| craft/src/commands/mod.rs | Implements execute_wasm function for running pre-built WASM files |
| craft/src/commands/test.rs | Updates test runner to handle both directory and WASM file paths |
| wasm-host-simulator/src/main.rs | Adds --wasm argument for direct WASM file execution |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
562226e to
2e667a6
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Extract path validation into reusable validate_cargo_project_path utility
|
(only rebased on main) |
|
@intelliot Can you give some examples of how this new feature is supposed to work. I'm not able to see this in action in the CLI prompts. |
|
craft build --path /external/path To execute with the wasm_host_simulator, it currently still requires test data fixtures, but that's a separate problem |
|
External projects (not using craft workspace) need the https://github.com/ripple/craft/blob/main/rust-toolchain.toml file in order to use wasm32v1-none |
|
This PR is no longer in-scope. Please see https://github.com/ripple/xrpl-wasm-std for now and feel free to re-open a PR like this one in that project, if appropriate (we may revisit a CLI in the future, but for now are continuing work on the XRPL WASM standard library in that project). |
High Level Overview of Change
Enable the
craft buildcommand to build and execute WASM modules from any filesystem path, not just the current directory or predefined project locations.Fix #199
Context of Change
Previously, it was difficult to work with WASM projects located elsewhere on the filesystem.
The fix modifies the build command to accept and properly handle absolute and relative filesystem paths, allowing developers to build WASM modules from any location. This provides greater flexibility in project organization and development workflows.
Type of Change
Release Note
The
craft buildcommand now supports building WASM modules from any filesystem path. Users can specify absolute or relative paths to build projects.