Repository navigation
sort: add wasi support for merge operations - #16689
Open
eduardomourar wants to merge 2 commits into
Open
eduardomourar wants to merge 2 commits into
eduardomourar wants to merge 2 commits into
Conversation
Contributor
|
thanks for the patch! |
sylvestre
reviewed
Nov 18, 2026
| /// 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)] |
Contributor
There was a problem hiding this comment.
please avoid the #[allow], and where does 256 come from?
Contributor
Author
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: |
eduardomourar
force-pushed
the
feat/wasi-sort-support-merge
branch
from
November 19, 2026 12:29
f2d23b7 to
162ed9a
Compare
|
GNU testsuite comparison: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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