mkfifo: fix build where mode_t is not u32 - #13775
Open
pkubaj wants to merge 1 commit into
Open
Conversation
oech3
reviewed
Aug 6, 2026
Merging this PR will degrade performance by 3.43%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | cksum_multiple_files |
60.6 ms | 63 ms | -3.8% |
| ❌ | Simulation | du_max_depth_balanced_tree[(6, 4, 10)] |
60.1 ms | 62 ms | -3.05% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing pkubaj:patch-1 (8020cb1) with main (667a82b)
Footnotes
-
47 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. ↩
pkubaj
force-pushed
the
patch-1
branch
2 times, most recently
from
August 6, 2026 12:30
39ba52d to
192e71b
Compare
Contributor
|
on which bsd? thanks |
Contributor
Author
|
FreeBSD. |
oech3
reviewed
Aug 6, 2026
|
GNU testsuite comparison: |
`rustix::fs::Mode` is a bitflags over `rustix::fs::RawMode`, which
aliases `libc::mode_t`. That is `u32` on Linux but `u16` on the BSDs,
so handing the `u32` mode straight to `Mode::from_bits_truncate()`
fails to compile there:
error[E0308]: mismatched types
--> src/uu/mkfifo/src/mkfifo.rs:146:50
|
146 | mkfifoat(CWD, path, Mode::from_bits_truncate(mode))
| ------------------------ ^^^^ expected `u16`, found `u32`
Cast to `RawMode` first, which is a no-op on Linux and matches what
`mkdir` already does in src/uu/mkdir/src/mkdir.rs.
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.
rustix::fs::Modeis a bitflags overrustix::fs::RawMode, which aliaseslibc::mode_t. That isu32on Linux butu16on the BSDs, so handing theu32mode straight toMode::from_bits_truncate()fails to compile there:Cast to
RawModefirst, which is a no-op on Linux and matches whatmkdiralready does in src/uu/mkdir/src/mkdir.rs.