wasi: add cat/sort/tail/touch integration coverage and related fixes - #11712
wasi: add cat/sort/tail/touch integration coverage and related fixes#11712DePasqualeOrg wants to merge 17 commits into
Conversation
|
Would you split PR (at least for symlink support)? |
9bced35 to
aa75a81
Compare
|
I separated the symlink changes out into #11713. |
|
I added a new commit to address an issue that would cause CI failures. The WASI CI uses stable Rust, but
|
|
I resolved the linter error in CI. |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
6b396f5 to
562cefd
Compare
|
GNU testsuite comparison: |
|
Is it able to split PR per utility? Diff is still too big. How about |
|
The changes here are interdependent, and splitting out |
562cefd to
e6f63b1
Compare
|
I've added WASI integration coverage for four more tools, plus the fixes needed to make those tests pass. New integration testsAdded Fixestouch: sort: cp: replaced uucore: cat: stub stays – when stdout is inherited from a host file descriptor, wasmtime reports its fstat as all-zero so dev/inode comparison can never match. Comment updated to reflect that accurately. Deferred
VerificationIntegration tests pass on macOS host and on Linux in an Ubuntu 24.04 Docker container (1592 passed / 0 failed / 176 ignored). |
9645693 to
7c34168
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
| } else { | ||
| filetime::set_file_times(dest, atime, mtime)?; | ||
| #[cfg(target_os = "wasi")] | ||
| { |
There was a problem hiding this comment.
please move that into a new function
|
i am sorry but it can't be merged this way, it needs to be split into several PRs also, it adds way too many wasi_no_threads everywhere |
de79c07 to
eaa010b
Compare
|
GNU testsuite comparison: |
5aa26b0 to
f96a56c
Compare
|
Before I split this up, I moved the sync/threaded variants into separate files, which reduces the number of cfg attributes in uu_sort significantly. If that's the direction you'd like to take, I'll start splitting this into separate PRs. |
f96a56c to
260501c
Compare
e7a99ab to
f2a1656
Compare
b887346 to
ae780ef
Compare
|
could you please keep your comments shorter on this PR ? it is hard to read otherwise. |
1 similar comment
|
could you please keep your comments shorter on this PR ? it is hard to read otherwise. |
Add #[cfg(target_os = "wasi")] blocks alongside existing unix and windows platform code. No changes to existing platform behavior. Enables compilation to wasm32-wasip1 and wasm32-wasip1-threads targets for running in WASI-compatible runtimes like WasmKit and Wasmer.
On wasm32-wasip1 (no atomics), sort crashes because ext_sort, merge, check, and rayon all spawn threads unconditionally. Add synchronous code paths gated on cfg(all(target_os = "wasi", not(target_feature = "atomics"))) so sort works on both wasip1 (sync) and wasip1-threads (threaded). Key changes: - Extract read_to_chunk() from chunks::read() for shared use - Add synchronous ext_sort with chunked sort-write-merge flow - Add SyncFileMerger for threadless merge operations - Add synchronous check for order verification - Gate rayon par_sort with sequential fallback
ae780ef to
7c4fd27
Compare
| # The gap this closes: integration tests are host-built and many are gated | ||
| # with #[cfg(not(target_vendor = "apple"))] / #[cfg(target_os = "linux")], | ||
| # so macOS silently excludes them. |
There was a problem hiding this comment.
This has been improved a bit with the merge of #13666, where we have enabled more tests that can run in Unix-based systems (including macOS).
|
I believe I missed this PR because it was in draft. There are few changes here that are overlapping with PR #13625 I am currently working on. Also, the spin-off PRs I created might simplify the implementation for this PR. |
|
@sylvestre, let me know if you agree on the following proposal, please? Already covered by my PRs (please drop from this PR):
Unique value in this PR that I'd love to see land:
Suggested path forward:
|
@sylvestre, I don't know why you keep posting that. We already discussed this. Just ignore this draft PR. As I stated multiple times before, this is in draft because it's not meant for review. It's my combined Wasm fixes from which smaller PRs can be split out. @eduardomourar, I had Codex review your PRs, comparing them with the changes I already have here, and it found multiple issues. For that reason, I'll submit my own PRs based on this work that I submitted already four months ago, and @sylvestre can decide which he wants to work with. |
|
I don't think I follow your reasoning. You have this PR in draft (that part I understand). You will be creating multiple PRs out of this one. Then, I say that I have already started doing that for you (without me realizing it, of course). If you have found any issues, I am happy to make the necessary changes to accommodate your approach. It is very similar so they should be small tweaks that can done without any real impact. |
because i am tired of seeing 3 pages comments written by LLM |
|
@sylvestre, there are no 3-page comments here. Just ignore this draft PR and any other draft PRs, which represent work in progress, until they're marked as ready for review, at which point comments will be concise as per your preference. |
This draft tracks the combined WASI work that is being divided into smaller PRs. It is not intended to merge in its current form.
Planned sequence
catPR will enable its WASI integration coverage and document the small set of unsupported test conditions.touchPR will add WASI timestamp support and focused integration coverage.cpPR will add WASI symlink and timestamp behavior with focused tests.tailPR will enable its WASI coverage and document follow-mode and platform limitations.sortwork will be divided into independently buildable review stages before submission because the current combined diff remains too large.