Skip to content

Per-target rust testsuite #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wingo
Copy link
Contributor

@wingo wingo commented Aug 21, 2025

As in #112, we reorganize the directory structure and change to a python build script, with the goal of making space for wasip3.

Before, it was:

  • tests/rust/: Root of cargo package

  • tests/rust/src: Rust source files

  • tests/rust/testsuite: JSON test files, fs-tests.dir; built .wasm files dumped here

Now it is:

  • tests/rust/wasm32-wasip1: Root of cargo package for wasip1 builds

  • tests/rust/wasm32-wasip1/src: Rust source, but also JSON and fs-tests.dir

  • tests/rust/testsuite/: Removed; instead it is a built dir

  • tests/rust/testsuite/wasm32-wasip1: All wasm and json files copied here

Note, the workflows are not yet updated.

@wingo wingo force-pushed the rust-multi-target branch 2 times, most recently from fc573cd to 3e885d1 Compare August 21, 2025 08:48
@wingo wingo marked this pull request as ready for review August 21, 2025 12:07
As in WebAssembly#112, we
reorganize the directory structure and change to a python build script,
with the goal of making space for wasip3.

Before, it was:
  - tests/rust/: Root of cargo package

  - tests/rust/src: Rust source files

  - tests/rust/testsuite: JSON test files, fs-tests.dir; built .wasm files
    dumped here

Now it is:
  - tests/rust/wasm32-wasip1: Root of cargo package for wasip1 builds

  - tests/rust/wasm32-wasip1/src: Rust source, but also JSON and fs-tests.dir

  - tests/rust/testsuite/: Removed; instead it is a built dir

  - tests/rust/testsuite/wasm32-wasip1: All wasm and json files copied here
@wingo wingo force-pushed the rust-multi-target branch from 3e885d1 to e63e727 Compare August 21, 2025 12:37
@pchickey pchickey requested a review from loganek August 21, 2025 17:24
return f"{system}-{version}"

def compute_build_target(system, version):
if version == 'wasip3':
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure why do we need this check? Looks like we never attempt to call this function for wasip3

def compute_build_target(system, version):
if version == 'wasip3':
# wasm32-wasip3 triple not yet supported.
return compute_target(system, 'wasip2')
Copy link
Collaborator

Choose a reason for hiding this comment

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

if wasm32-wasip3 is not supported, then we should throw an error, instead of using another version. But as I stated in my previous comment, we could perhaps remove this if statement completely.

Comment on lines +12 to +14
parser.add_argument("--dry-run", action="store_true")
parser.add_argument("--verbose", action="store_true")
parser.add_argument("--release", action="store_true")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider adding help for each of those, not all the parameters are self-explanatory

return compute_target(system, 'wasip2')
return compute_target(system, version)

BASE_DIR = Path(__file__).parent
Copy link
Collaborator

Choose a reason for hiding this comment

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

That could be a cli argument with the default value set to Path(__file__).parent for local executions.

Comment on lines +36 to +38
r = subprocess.run(argv)
if r.returncode != 0:
sys.exit(r.returncode)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should have similar effect

Suggested change
r = subprocess.run(argv)
if r.returncode != 0:
sys.exit(r.returncode)
r = subprocess.run(argv, check=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants