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

Incompatible with musl #11

Open
pcarrier opened this issue May 16, 2023 · 2 comments
Open

Incompatible with musl #11

pcarrier opened this issue May 16, 2023 · 2 comments

Comments

@pcarrier
Copy link

error[E0308]: mismatched types
   --> /home/runner/.cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/reflink-0.1.3/src/sys/unix.rs:21:39
    |
21  |         libc::ioctl(dest.as_raw_fd(), IOCTL_FICLONE, src.as_raw_fd())
    |         -----------                   ^^^^^^^^^^^^^ expected `i32`, found `u64`
    |         |
    |         arguments to this function are incorrect
    |
note: function defined here
   --> /home/runner/.cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/libc-0.2.144/src/unix/linux_like/linux/musl/mod.rs:739:12
    |
739 |     pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
    |            ^^^^^
help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit
    |
21  |         libc::ioctl(dest.as_raw_fd(), IOCTL_FICLONE.try_into().unwrap(), src.as_raw_fd())
    |                                                    ++++++++++++++++++++

For more information about this error, try `rustc --explain E0308`.
error: could not compile `reflink` due to previous error
@pcarrier pcarrier changed the title Incompatible with musl Incompatible with musl aarch64 May 16, 2023
@pcarrier pcarrier changed the title Incompatible with musl aarch64 Incompatible with musl May 16, 2023
@pcarrier
Copy link
Author

Can be tested on Debian-based systems with:

$ sudo apt-get install musl-tools
$ rustup toolchain install --force-non-host stable-x86_64-unknown-linux-musl
$ rustup target add x86_64-unknown-linux-musl
$ cargo build --release --target x86_64-unknown-linux-musl

@bczhc
Copy link

bczhc commented Jun 10, 2023

This already has a fix (#5), but it hasn't been included in a released crate. Can you try with a specified git revision, like bczhc/rust@e9df2ba?

kozalosev pushed a commit to kozalosev/LocPlaceBot that referenced this issue Aug 18, 2023
Another possible solution: nicokoch/reflink#11

However, requests are cached for only several seconds,
because of absence the appropriate headers in the response. So, in-memory storage is enough. Especially,
inside a container without a mounted volume.
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.

2 participants