Skip to content

feat(uucore): support fsext feature on more platforms - #14627

Open
xtqqczze wants to merge 1 commit into
uutils:mainfrom
xtqqczze:uucore-fsext
Open

xtqqczze wants to merge 1 commit into
uutils:mainfrom
xtqqczze:uucore-fsext

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

The feature now compiles successfully on Haiku, Hermit and Hurd targets:

RUSTC_BOOTSTRAP=1 cargo clippy -q -Zbuild-std=std,panic_abort -p uucore --features=fsext --all-targets --target=x86_64-linux-android --target=i686-linux-android --target=x86_64-pc-cygwin --target=aarch64-apple-darwin --target=x86_64-unknown-freebsd --target=x86_64-unknown-haiku --target=x86_64-unknown-hurd-gnu --target=aarch64-unknown-illumos --target=x86_64-unknown-linux-gnu --target=i686-unknown-netbsd --target=x86_64-unknown-openbsd --target=x86_64-unknown-redox --target=x86_64-pc-solaris --target=wasm32-wasip1 --target=x86_64-pc-windows-gnu

Closes #14933

@xtqqczze
xtqqczze marked this pull request as ready for review September 16, 2026 21:53
@xtqqczze
xtqqczze force-pushed the uucore-fsext branch 4 times, most recently from 9768ae6 to 0cbea87 Compare September 16, 2026 22:37
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)

@xtqqczze
xtqqczze force-pushed the uucore-fsext branch 5 times, most recently from 528406c to 1034335 Compare September 18, 2026 21:42
@xtqqczze
xtqqczze marked this pull request as draft September 18, 2026 21:42
@xtqqczze

This comment was marked as off-topic.

@xtqqczze xtqqczze changed the title uucore: support fsext feature for more platforms feat(uucore): support fsext feature on more platforms Sep 18, 2026
@xtqqczze
xtqqczze force-pushed the uucore-fsext branch 2 times, most recently from 1b13f3b to d5c0d2b Compare September 18, 2026 22:55
@xtqqczze

This comment was marked as outdated.

@xtqqczze
xtqqczze force-pushed the uucore-fsext branch 2 times, most recently from 4abd9a1 to e2b26c9 Compare September 19, 2026 18:45
@xtqqczze
xtqqczze marked this pull request as ready for review September 24, 2026 01:09
}

#[cfg(all(unix, not(any(target_os = "aix", target_os = "redox"))))]
#[cfg(any(

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.

the same 7-target cfg list now appears 5 times. could we use a cfg alias or group these fns in a module?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, ideally. I haven't yet worked out the best approach for this (see #11016), so I was going to defer that for now.

Comment thread src/uucore/src/lib/features/fsext/mod.rs Outdated
),
expect(clippy::unnecessary_wraps)
)]
#[allow(clippy::unnecessary_wraps)]

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.

why switch from expect to allow here? we don't want to silence clippy with #[allow(...)]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I switched to avoid the verbose cfg_attr, since the rest of the changes aren't using expect.

@xtqqczze
xtqqczze marked this pull request as draft September 24, 2026 14:03
))]
{
// No method to read mounts on these platforms
Ok(Vec::new())

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's perhaps worth questioning for follow-up on whether returning Ok is appropriate in this case of no available method.

@codspeed

codspeed Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ 111 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 1 benchmark has no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
❌ 1 regressed benchmark
✅ 317 untouched benchmarks
⏩ 135 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation five_38_bit_primes 1.7 s 1.8 s -6.38%
⚡ Simulation three_39_bit_primes 434.1 ms 325.6 ms +33.32%
⚡ Simulation thirteen_39_bit_primes 9.6 s 8.9 s +7.08%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing xtqqczze:uucore-fsext (de51447) with main (38336e9)

Open in CodSpeed

Footnotes

  1. 135 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@xtqqczze
xtqqczze marked this pull request as ready for review September 24, 2026 15:50
};
#[cfg(target_os = "haiku")]
return Self {
blocksize: statvfs.block_size().try_into().unwrap(),

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.

the FsMeta methods already do these conversions for haiku, could you use statvfs.total_blocks(), avail_blocks() etc. here instead of repeating try_into().unwrap()?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

f_blocks and f_bsize are different fields, though. FsMeta doesn't expose f_bsize as a u64, so using the FsMeta helpers here wouldn't cover all of these conversions. I'd prefer to keep the explicit conversions here rather than add more refactoring on top.

The feature now compiles successfully on Haiku, Hermit and Hurd targets:

```sh
RUSTC_BOOTSTRAP=1 cargo clippy -q -Zbuild-std=std,panic_abort -p uucore --features=fsext --all-targets --target=x86_64-linux-android --target=i686-linux-android --target=x86_64-pc-cygwin --target=aarch64-apple-darwin --target=x86_64-unknown-freebsd --target=x86_64-unknown-haiku --target=x86_64-unknown-hurd-gnu --target=aarch64-unknown-illumos --target=x86_64-unknown-linux-gnu --target=i686-unknown-netbsd --target=x86_64-unknown-openbsd --target=x86_64-unknown-redox --target=x86_64-pc-solaris --target=wasm32-wasip1 --target=x86_64-pc-windows-gnu
```

This branch has not been deployed

No deployments
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.

uucore: support fsext feature on more platforms

2 participants