Stebalien / tempfile

Temporary file library for rust
http://stebalien.com/projects/tempfile-rs
Apache License 2.0
1.2k stars 120 forks source link

Build failure on Haiku #246

Closed asomers closed 1 year ago

asomers commented 1 year ago

Tempfile 3.7.0 fails to build on Haiku:

> cargo check -Z build-std --target x86_64-unknown-haiku
    Checking tempfile v3.7.0 (/usr/home/somers/src/rust/tempfile)
error[E0432]: unresolved import `rustix::fs::CWD`
  --> src/file/imp/unix.rs:17:55
   |
17 | use rustix::fs::{linkat, renameat, unlinkat, AtFlags, CWD};
   |                                                       ^^^ no `CWD` in `fs`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `tempfile` (lib) due to previous error

v3.6.0 worked just fine. The problem seems to be that Rustix 0.38.0 removed CWD. See https://github.com/bytecodealliance/rustix/commit/23af8a8c4ca37f6fdf602a26a67d3e32a1f64e80#diff-9f7a9943fff7afdd02920889c8f84454a8968e2f8015fd1ae06742255f82fe85 . I suggest removing the persist method on Haiku. That should be sufficient to get compilation working again.

Stebalien commented 1 year ago

That commit looks like it's adding support for CWD.

Stebalien commented 1 year ago

Ah. They moved the line that disabled it.

sunfishcode commented 1 year ago

Yeah; Haiku's AT_FDCWD is -1, which can't currently be stored in a BorrowedFd.

I submitted https://github.com/Stebalien/tempfile/pull/247 as a possible fix here.

Stebalien commented 1 year ago

fixed by #247

Stebalien commented 1 year ago

(3.7.1 has been released)