Skip to content

Prefer alloc::io than no_std_io2 - #3722

Merged
tatetian merged 3 commits into
asterinas:mainfrom
lrh2000:no-std-io
Aug 16, 2026
Merged

Prefer alloc::io than no_std_io2#3722
tatetian merged 3 commits into
asterinas:mainfrom
lrh2000:no-std-io

Conversation

@lrh2000

@lrh2000 lrh2000 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Our toolchain version is now nightly-2026-07-21.

This is a nice number, which means that rust-lang/rust#158544 has been merged (2026-07-18), so that alloc::io::Read is available to use.

use no_std_io2::io::{Cursor, Read};

Therefore, there is no need to rely on no_std_io2. I propose removing it to eliminate another external crate.

We can use alloc::io::Read instead. See the changes in this first commit.

(Note: libflate still depends on no_std_io2. I don't think it is controversial to clean up our dependencies first, though.)


I also noticed that InodeWriter has only one user. Given that I cannot think of a second user and it does not rely on any inode's implementation details, I think it is better to just move it to where it is used. This is done in the second commit.

The third commit performs some random style cleanups. The correctness should be obvious.

@tatetian

Copy link
Copy Markdown
Contributor

/aster-code-review

@github-actions

Copy link
Copy Markdown

✅ On it! I'll review the PR diff, running the PR's own aster-code-review skill and coding guidelines.

Track progress here: https://github.com/asterinas/asterinas/actions/runs/31935628510

I'll post the results back on this PR when the run finishes.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note

These comments were generated by AI using the aster-code-review skill. Please take them seriously——but also with a grain of salt. You can run aster-code-review locally to iterate on your changes (review -> fix -> re-review) and catch issues before they reach manual review.

The change successfully removes the direct no_std_io2 dependency and keeps the
replacement alloc::io usage compiling for cpio-decoder and aster-core on
x86_64-unknown-none. I did not find runtime correctness, security, hardware,
or documentation defects in the reviewed diff.

The remaining issue is commit hygiene: the final cleanup commit combines several
unrelated edits under one generic subject, which makes the series harder to
review and bisect.


Findings not attachable to this PR's diff

Note

These couldn't be pinned to a changed line
— usually they sit on lines this PR didn't change (likely pre-existing issues),
or concern a commit message.
Listed here so they aren't lost.

commit cc45285ef messageatomic-commits (minor): cc45285ef groups unrelated cleanups: it narrows FileLike::access_mode, changes inotify log/error wording and local naming, removes #[inline] from check_length, adds whitespace in init process setup, and rewrites a local VmarMapOptions binding. That makes the commit hard to review or bisect as one logical change.

Fix. Split this into one commit per logical cleanup, or fold each small cleanup into the commit that introduced the nearby code it adjusts.

@tatetian tatetian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks for the contribution!

@tatetian
tatetian merged commit 5aea946 into asterinas:main Aug 16, 2026
69 of 70 checks passed
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