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

Compilation error on Apple Silicon Mac #42

Closed
poetaman opened this issue Feb 8, 2021 · 4 comments
Closed

Compilation error on Apple Silicon Mac #42

poetaman opened this issue Feb 8, 2021 · 4 comments

Comments

@poetaman
Copy link

poetaman commented Feb 8, 2021

>> cargo install fcat --verbos
.
.
.
     Running `rustc --crate-name fcat /Users/reportaman/.cargo/registry/src/github.com-1ecc6299db9ec823/fcat-0.1.0/src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=170953d2de8e5e5f -C extra-filename=-170953d2de8e5e5f --out-dir /var/folders/40/g1hxt47j5sn3wg34689bfpnr0000gn/T/cargo-installhV87a2/release/deps -L dependency=/var/folders/40/g1hxt47j5sn3wg34689bfpnr0000gn/T/cargo-installhV87a2/release/deps --extern nix=/var/folders/40/g1hxt47j5sn3wg34689bfpnr0000gn/T/cargo-installhV87a2/release/deps/libnix-e97ee1ac4be0467d.rlib --cap-lints allow`
error[E0432]: unresolved imports `nix::fcntl::splice`, `nix::fcntl::SpliceFFlags`
 --> /Users/reportaman/.cargo/registry/src/github.com-1ecc6299db9ec823/fcat-0.1.0/src/main.rs:8:18
  |
8 | use nix::fcntl::{splice, SpliceFFlags};
  |                  ^^^^^^  ^^^^^^^^^^^^ no `SpliceFFlags` in `fcntl`
  |                  |
  |                  no `splice` in `fcntl`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: failed to compile `fcat v0.1.0`, intermediate artifacts can be found at `/var/folders/40/g1hxt47j5sn3wg34689bfpnr0000gn/T/cargo-installhV87a2`

Caused by:
  could not compile `fcat`

System info:

>> neofetch
                    'c.          reportaman@Mac-mini.local 
                 ,xNMM.          ------------------------------ 
               .OMMMMo           OS: macOS 11.2 20D64 arm64 
               OMMM0,            Host: Macmini9,1 
     .;loddo:' loolloddol;.      Kernel: 20.3.0 
   cKMMMMMMMMMMNWMMMMMMMMMM0:     
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.     
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.8 
;MMMMMMMMMMMMMMMMMMMMMMMM:        
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua 
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Quartz Compositor 
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    WM Theme: Blue (Dark) 
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal: Apple_Terminal 
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   
    kMMMMMMMMMMMMMMMMMMMMMMd     CPU: Apple M1 
     ;KMMMMMMMWXXWMMMMMMMk.      GPU: Apple M1 
       .cooc,.    .,coo:.         

@mre
Copy link
Owner

mre commented Feb 8, 2021

Ah that crate is only working on Linux because it requires the splice syscall.

@poetaman
Copy link
Author

poetaman commented Feb 8, 2021

@mre Ah ok, any plans to support macOS?

@mre
Copy link
Owner

mre commented Feb 8, 2021

Well, macOS provides copyfile, which seems to support COPYFILE_CLONE which will attempt to use the
APFS clone capabilities for fast copies.
mono/mono#9038
This is already supported by Rust when calling std::fs::copy. See this PR.
We could add a conditional compilation for Mac and Windows and just call std::fs:copy, which will do the right thing under the hood I guess.
It should be quite straightforward if anyone wants to give it a shot.

@mre
Copy link
Owner

mre commented Jul 18, 2022

Thinking about this again, it's probably not worth using fcat on anything other than Linux, though; it will not be faster than a normal copy on those OSes. :/ Closing this, but thanks a lot for trying fcat and for reporting the issue.

@mre mre closed this as completed Jul 18, 2022
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

No branches or pull requests

2 participants