Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impl new API std::os::unix::fs::mkfifo under feature unix_fifo #139450

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NobodyXu
Copy link
Contributor

@NobodyXu NobodyXu commented Apr 6, 2025

Tracking issue #139324

@rustbot
Copy link
Collaborator

rustbot commented Apr 6, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 6, 2025
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-19 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#19 exporting to docker image format
#19 sending tarball 20.2s done
#19 DONE 32.9s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-19]
[CI_JOB_NAME=x86_64-gnu-llvm-19]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-19', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-19/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
   Compiling addr2line v0.24.2
[RUSTC-TIMING] addr2line test:false 0.278
[RUSTC-TIMING] gimli test:false 2.048
[RUSTC-TIMING] object test:false 2.714
error[E0425]: cannot find function `mkfifo` in module `sys::fs`
    --> library/std/src/os/unix/fs.rs:1134:14
     |
1134 |     sys::fs::mkfifo(path.as_ref(), permissions.mode())
     |              ^^^^^^ not found in `sys::fs`
     |
help: consider importing this function
     |
7    + use libc::mkfifo;
     |
help: if you import `mkfifo`, refer to it directly
     |
1134 -     sys::fs::mkfifo(path.as_ref(), permissions.mode())
1134 +     mkfifo(path.as_ref(), permissions.mode())
     |

For more information about this error, try `rustc --explain E0425`.
[RUSTC-TIMING] std test:false 1.794
error: could not compile `std` (lib) due to 1 previous error

@@ -1100,3 +1100,36 @@ pub fn lchown<P: AsRef<Path>>(dir: P, uid: Option<u32>, gid: Option<u32>) -> io:
pub fn chroot<P: AsRef<Path>>(dir: P) -> io::Result<()> {
sys::fs::chroot(dir.as_ref())
}

/// Create fifo at the specified path with the specified mode.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe "Create a FIFO special file at the specified path..."

/// # };
/// # fn main() -> std::io::Result<()> {
/// # remove_file("/tmp/fifo")?;
/// mkfifo("/tmp/fifo", Permissions::from_mode(0o774))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

If this test is to be run (I think it's a good idea to have some form of test), it may be better to call mkdtemp and create the FIFO there to ensure it doesn't interfere with anyone who actually has a /tmp/fifo.

@tgross35
Copy link
Contributor

tgross35 commented Apr 8, 2025

@rustbot author for the failing test and review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 8, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 8, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix Operating system: Unix-like S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants