Repository navigation
sort: add wasi support for merge operations - #16689
eduardomourar wants to merge 1 commit into
Conversation
|
thanks for the patch! |
| /// WASI has no `getrlimit`; guess a conservative limit instead of `None`, so | ||
| /// `--batch-size`/merge stay bounded on wasmtime's often-smaller fd table. | ||
| #[cfg(target_os = "wasi")] | ||
| #[allow(clippy::unnecessary_wraps)] |
There was a problem hiding this comment.
please avoid the #[allow], and where does 256 come from?
There was a problem hiding this comment.
I made the modification accordingly. I am not too happy with it visually. If this was not what you had in mind, please propose the way in the code concretely so I can learn for next time.
|
Binary size comparison: |
f2d23b7 to
162ed9a
Compare
|
GNU testsuite comparison: |
|
thanks for the work on this! |
162ed9a to
cb673f7
Compare
|
All addressed. The |
sort -m spawns an OS thread per merge batch to overlap reading and sorting. WASI has no real threads, so this panicked into an
unreachabletrap instead of a usable error, and every affected merge test was skipped under WASI.Add a synchronous
target_os = "wasi"merge and--checkpath that reads chunks on the calling thread instead of handing them to a reader thread, reusing the same chunk-parsing code. Also tighten--batch-sizehandling: WASI has nogetrlimit, so it now assumes a conservative fd limit instead of treating merge batch size as unbounded.Addresses the
sort -mhalf of #16599 (dd's thread spawn is a separate issue).🤖 Generated with Claude Code