Svetlitski / fcp

A significantly faster alternative to the classic Unix cp(1) command, copying large files and directories in a fraction of the time.
BSD 3-Clause "New" or "Revised" License
767 stars 19 forks source link

windows build fails with `cargo install fcp` #33

Closed kyoobey closed 2 years ago

kyoobey commented 2 years ago
error ```rust ❯ cargo install fcp Updating crates.io index Installing fcp v0.2.1 Compiling autocfg v1.1.0 Compiling crossbeam-utils v0.8.8 Compiling cfg-if v1.0.0 Compiling lazy_static v1.4.0 Compiling rayon-core v1.9.2 Compiling scopeguard v1.1.0 Compiling libc v0.2.123 Compiling num_cpus v1.13.1 Compiling bitflags v1.3.2 Compiling either v1.6.1 Compiling memoffset v0.6.5 Compiling crossbeam-epoch v0.9.8 Compiling rayon v1.5.2 Compiling crossbeam-channel v0.5.4 Compiling nix v0.22.3 Compiling crossbeam-deque v0.8.1 Compiling fcp v0.2.1 error[E0433]: failed to resolve: could not find `unix` in `os` --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\lib.rs:9:14 | 9 | use std::os::unix::fs::{MetadataExt, PermissionsExt}; | ^^^^ could not find `unix` in `os` error[E0433]: failed to resolve: could not find `sys` in `nix` --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:6:10 | 6 | use nix::sys::stat::Mode; | ^^^ could not find `sys` in `nix` error[E0432]: unresolved import `nix::unistd` --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:7:5 | 7 | use nix::unistd; | ^^^^^^^^^^^ no `unistd` in the root error[E0433]: failed to resolve: could not find `unix` in `os` --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:10:14 | 10 | use std::os::unix::fs::{self as unix, DirBuilderExt, FileTypeExt, OpenOptionsExt, PermissionsExt}; | ^^^^ could not find `unix` in `os` error[E0432]: unresolved import `std::os::unix` --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:10:14 | 10 | use std::os::unix::fs::{self as unix, DirBuilderExt, FileTypeExt, OpenOptionsExt, PermissionsExt}; | ^^^^ could not find `unix` in `os` error[E0433]: failed to resolve: use of undeclared type `Mode` --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:79:16 | 79 | let mode = Mode::from_bits_truncate(permissions.mode().try_into()?); | ^^^^ use of undeclared type `Mode` error[E0599]: no method named `mode` found for struct `DirBuilder` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:61:10 | 61 | .mode(mode) | ^^^^ method not found in `DirBuilder` error[E0599]: no method named `mode` found for struct `OpenOptions` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:69:10 | 69 | .mode(mode) | ^^^^ method not found in `OpenOptions` error[E0599]: no method named `mode` found for struct `Permissions` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:79:53 | 79 | let mode = Mode::from_bits_truncate(permissions.mode().try_into()?); | ^^^^ method not found in `Permissions` error[E0599]: no method named `is_fifo` found for struct `std::fs::FileType` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:102:29 | 102 | } else if file_type.is_fifo() { | ^^^^^^^ help: there is an associated function with a similar name: `is_file` error[E0599]: no method named `is_socket` found for struct `std::fs::FileType` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:104:29 | 104 | } else if file_type.is_socket() { | ^^^^^^^^^ method not found in `std::fs::FileType` error[E0599]: no method named `is_char_device` found for struct `std::fs::FileType` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:106:29 | 106 | } else if file_type.is_char_device() { | ^^^^^^^^^^^^^^ method not found in `std::fs::FileType` error[E0599]: no method named `is_block_device` found for struct `std::fs::FileType` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\filesystem.rs:108:29 | 108 | } else if file_type.is_block_device() { | ^^^^^^^^^^^^^^^ method not found in `std::fs::FileType` error[E0599]: no method named `mode` found for struct `Permissions` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\lib.rs:48:72 | 48 | let mut dest = fs::create(dest, metadata.permissions().mode())?; | ^^^^ method not found in `Permissions` error[E0599]: no method named `mode` found for struct `Permissions` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\lib.rs:62:70 | 62 | fs::create_dir(dest, fs::symlink_metadata(source)?.permissions().mode())?; | ^^^^ method not found in `Permissions` error[E0599]: no method named `ino` found for struct `Metadata` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\lib.rs:102:64 | 102 | .map(|ancestor| fs::metadata(ancestor).map(|meta| meta.ino())); | ^^^ method not found in `Metadata` error[E0599]: no method named `ino` found for struct `Metadata` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\lib.rs:108:68 | 108 | .map(|source| fs::symlink_metadata(source).map(|meta| meta.ino())) | ^^^ method not found in `Metadata` error[E0599]: no method named `ino` found for struct `Metadata` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\lib.rs:201:46 | 201 | (_, Ok(metadata)) if source_metadata.ino() == metadata.ino() => fatal(format!( | ^^^ method not found in `Metadata` error[E0599]: no method named `ino` found for struct `Metadata` in the current scope --> C:\Users\hitus\.cargo\registry\src\github.com-1ecc6299db9ec823\fcp-0.2.1\src\lib.rs:201:64 | 201 | (_, Ok(metadata)) if source_metadata.ino() == metadata.ino() => fatal(format!( | ^^^ method not found in `Metadata` Some errors have detailed explanations: E0432, E0433, E0599. For more information about an error, try `rustc --explain E0432`. error: could not compile `fcp` due to 19 previous errors warning: build failed, waiting for other jobs to finish... error: failed to compile `fcp v0.2.1`, intermediate artifacts can be found at `C:\Users\hitus\AppData\Local\Temp\cargo-installK8TlaQ` Caused by: build failed ```
Svetlitski commented 2 years ago

This is expected behavior. Windows is not supported and never will be.