Skip to content

mkfifo: fix build where mode_t is not u32 - #13775

Open
pkubaj wants to merge 1 commit into
uutils:mainfrom
pkubaj:patch-1
Open

mkfifo: fix build where mode_t is not u32#13775
pkubaj wants to merge 1 commit into
uutils:mainfrom
pkubaj:patch-1

Conversation

@pkubaj

@pkubaj pkubaj commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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.

Comment thread src/uu/mkfifo/src/mkfifo.rs Outdated
@codspeed-hq

codspeed-hq Bot commented Aug 6, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 3.43%

⚠️ 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 regressed benchmarks
✅ 344 untouched benchmarks
⏩ 47 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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)

Open in CodSpeed

Footnotes

  1. 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
pkubaj force-pushed the patch-1 branch 2 times, most recently from 39ba52d to 192e71b Compare August 6, 2026 12:30
@sylvestre

Copy link
Copy Markdown
Contributor

on which bsd? thanks

@pkubaj

pkubaj commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

FreeBSD.

Comment thread src/uu/mkfifo/src/mkfifo.rs Outdated
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/misc/sync. tests/misc/sync is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout-group (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

`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.
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.

3 participants