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

Build failure on Haiku #246

Closed
asomers opened this issue Aug 6, 2023 · 5 comments
Closed

Build failure on Haiku #246

asomers opened this issue Aug 6, 2023 · 5 comments

Comments

@asomers
Copy link
Contributor

asomers commented Aug 6, 2023

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 bytecodealliance/rustix@23af8a8#diff-9f7a9943fff7afdd02920889c8f84454a8968e2f8015fd1ae06742255f82fe85 .
I suggest removing the persist method on Haiku. That should be sufficient to get compilation working again.

asomers added a commit to asomers/nix that referenced this issue Aug 6, 2023
By restricting tempfile to 3.6.0 or lower.

Stebalien/tempfile#246
@Stebalien
Copy link
Owner

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

@Stebalien
Copy link
Owner

Ah. They moved the line that disabled it.

@sunfishcode
Copy link
Contributor

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

I submitted #247 as a possible fix here.

Stebalien added a commit that referenced this issue Aug 6, 2023
As far as I can tell, `*at` syscalls are equivalent to their
counterparts when they're called relative to the current working
directory, so this shouldn't matter. We only _need_ the `*at` syscall
for `renameat2` to pass some flags.

fixes #246
@Stebalien
Copy link
Owner

fixed by #247

@Stebalien
Copy link
Owner

(3.7.1 has been released)

asomers added a commit to asomers/nix that referenced this issue Aug 6, 2023
bors bot added a commit to nix-rust/nix that referenced this issue Aug 6, 2023
2019: Fix aio_suspend in non-trivial cases r=asomers a=asomers

aio_suspend would probably fail with EFAULT if the first operation in the list wasn't complete, due to an invalid pointer cast.

Also, deprecate lio_listio, which has the same problem, and others besides.

Fixes #1980

2087: Fix Haiku build by updating tempfile to 3.7.1 r=asomers a=asomers

Stebalien/tempfile#246

Co-authored-by: Alan Somers <asomers@gmail.com>
asomers added a commit to nix-rust/nix that referenced this issue Aug 27, 2023
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 a pull request may close this issue.

3 participants