-
Notifications
You must be signed in to change notification settings - Fork 33
First wasip3 test #120
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
base: main
Are you sure you want to change the base?
First wasip3 test #120
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,13 +15,27 @@ | |
help="print commands to be executed") | ||
parser.add_argument("--release", action="store_true", | ||
help="build tests in release mode") | ||
parser.add_argument("--toolchain", action="append", | ||
help="TARGET:TOOLCHAIN, pass +TOOLCHAIN to cargo for TARGET") | ||
|
||
args = parser.parse_args() | ||
if args.dry_run: | ||
args.verbose = True | ||
|
||
TOOLCHAINS={} | ||
if args.toolchain is not None: | ||
for toolchain_arg in args.toolchain: | ||
match toolchain_arg.split(':'): | ||
case (target, toolchain): | ||
TOOLCHAINS[target] = toolchain | ||
case arg: | ||
print(f"expected --toolchain=TARGET:TOOLCHAIN, got {toolchain_arg}", | ||
file=sys.stderr) | ||
sys.exit(1) | ||
|
||
CARGO = ['cargo'] | ||
SYSTEMS = ['wasm32'] | ||
VERSIONS = ['wasip1'] # + ['wasip2', 'wasip3'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did you mean wasip2? I see in the compile-tests.yml workflow you configure wasip2 target, not wasip3 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's right as-is: the wasip3 interfaces and toolchain are still under development. There will be no There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is quite confusing and perhaps requires a bit of re-thinking how we define test cases overall. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed with regards to having a shortcut to run e.g. "just the wasip1 tests". But from a directory structure / test suite definition perspective, I don't know how to be more clear: the test sources are in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wingo I agree that its clear when you lay it out that way - can you add text to the readme that describes how the tests for wasi are in tests//wasi, and a comment here in this build script that says wasip2 is an implementation detail until wasip3 ships in rustc? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious what's your long-term plan for adding more tests? Let's say we'll have wasip4 at some point of time, would they go to the wasip4 folder? But then what about tests in wasip3 - are they expected to be copied to wasip4, or is there assumption that all wasip(N-1) work with wasip(N)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, there's no assumption that tests from wasip(N-1) work in wasip(N) - wasi revisions are where we are allowed to make breaking changes, whether because the prior interfaces were flawed or because new component model features allow us to change. So, when its time to add wasip4 (or wasi 1.0 or etc) we'd probably start by making a copy of the prior tests and then making whatever necessary changes according to what changed in the spec. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not fully convinced to the idea of having copies of tests for each version as I'm worried about the overhead this will cause whenever we have to update the tests. I'd be interested if there are any other reasonable alternatives. Having said that, I'm ok with unblocking the progress on wasip3 but really want us to re-think how those tests should be developed going forward. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I get the desire to not copy needlessly, I think here we have a need to do so.
If we were testing something higher-level like libc, then I agree, there is no need to make per-version copies. But here we're testing low-level interfaces, so while I understand the distaste, I don't see another way to do it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Our goal should be that, for older revisions of wasi, the tests are not updated except to clarify what the behavior of a certain revision should be. Whether a given clarification applies to more than one revision applies on a case by case basis. @wingo has been working on two engineering activities in parallel, and I think we should distinguish between them. One effort, here, is to create new tests for wasip3. A second effort, is to clarify the spec of wasip1, in e.g. #118 #119 #124. Of those, only #119 has any applicability at all to wasip3, and when it does, it will be rendered with completely different source code because the wasip3 interfaces for expressing fdflags sync are distinct from wasip1. The other two PRs are for aspects of the wasip1 interfaces that we deliberately removed in wasip2, so there is no possible way to share code between those tests. |
||
VERSIONS = ['wasip1', 'wasip3'] | ||
|
||
def compute_target(system, version): | ||
return f"{system}-{version}" | ||
|
@@ -74,10 +88,13 @@ def mkdir_p(path): | |
target = compute_target(system, version) | ||
build_target = compute_build_target(system, version) | ||
build_mode = "release" if args.release else "debug" | ||
toolchain = [f"+{TOOLCHAINS[target]}"] if target in TOOLCHAINS else [] | ||
|
||
build_args = ["cargo", "build", | ||
f"--manifest-path={BASE_DIR / target / 'Cargo.toml'}", | ||
f"--target={build_target}"] | ||
build_args = CARGO + toolchain + [ | ||
"build", | ||
f"--manifest-path={BASE_DIR / target / 'Cargo.toml'}", | ||
f"--target={build_target}" | ||
] | ||
if args.release: | ||
build_args.append("--release") | ||
run(build_args) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/ |
Uh oh!
There was an error while loading. Please reload this page.