Skip to content
This repository was archived by the owner on Oct 28, 2025. It is now read-only.

Build and execute any filesystem path#239

Closed
intelliot wants to merge 2 commits intomainfrom
fix-199
Closed

Build and execute any filesystem path#239
intelliot wants to merge 2 commits intomainfrom
fix-199

Conversation

@intelliot
Copy link
Copy Markdown
Contributor

High Level Overview of Change

Enable the craft build command 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

  • New feature (non-breaking change which adds functionality)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)

Release Note

The craft build command now supports building WASM modules from any filesystem path. Users can specify absolute or relative paths to build projects.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --path option to craft build command for specifying arbitrary project directories
  • Introduces new craft execute command for running pre-built WASM files
  • Updates WASM host simulator to accept explicit WASM file paths via --wasm flag

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.

@intelliot intelliot force-pushed the fix-199 branch 2 times, most recently from 562226e to 2e667a6 Compare September 30, 2025 00:28
@intelliot intelliot requested a review from Copilot September 30, 2025 00:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@intelliot intelliot requested a review from sappenin September 30, 2025 00:31
- Extract path validation into reusable validate_cargo_project_path utility
@intelliot
Copy link
Copy Markdown
Contributor Author

(only rebased on main)

@sappenin
Copy link
Copy Markdown
Collaborator

sappenin commented Oct 1, 2025

@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.

@intelliot
Copy link
Copy Markdown
Contributor Author

craft build --path /external/path
craft execute --wasm /path/to/file.wasm

To execute with the wasm_host_simulator, it currently still requires test data fixtures, but that's a separate problem

@intelliot
Copy link
Copy Markdown
Contributor Author

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

@sappenin
Copy link
Copy Markdown
Collaborator

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).

@sappenin sappenin closed this Oct 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Craft to build + execute from arbitary filesystem paths.

3 participants