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

cannot build on windows xattr not available #3

Open
dbojan opened this issue Aug 1, 2023 · 5 comments
Open

cannot build on windows xattr not available #3

dbojan opened this issue Aug 1, 2023 · 5 comments

Comments

@dbojan
Copy link

dbojan commented Aug 1, 2023

Hi.
I tried to build emuman on windows, cause I like the idea of someone finally using hardlinks instead of having multiple copies of the same file.

I got error "could not find 'unix' in 'os'" when it came to xattr.
Apparently there is no xattr tool for windows.
Any chance to work around this, or having windows binary built some other way?

Thanks.

@tuffy
Copy link
Owner

tuffy commented Aug 3, 2023

I've pushed out a version which should at least work on Windows by detecting whether the xattr library is working (via its SUPPORTED_PLATFORM constant) and avoid using it if not - though naturally it won't be able to run as fast since we can't cache file hash info anywhere else in the file.

Hard link detection on Windows will need some nightly compiler features and should work, but I don't currently have a Windows machine to test it on to be sure.

@dbojan
Copy link
Author

dbojan commented Aug 3, 2023

I:>cargo install emuman
Updating crates.io index
Installing emuman v2.9.4
Updating crates.io index
Compiling windows_x86_64_gnu v0.48.0
Compiling cfg-if v1.0.0
Compiling proc-macro2 v1.0.66
Compiling autocfg v1.1.0
Compiling unicode-ident v1.0.11
Compiling typenum v1.16.0
Compiling version_check v0.9.4
Compiling generic-array v0.14.7
Compiling windows-targets v0.48.1
Compiling windows-sys v0.48.0
Compiling jobserver v0.1.26
Compiling quote v1.0.32
Compiling syn v2.0.28
Compiling winapi-x86_64-pc-windows-gnu v0.4.0
Compiling scopeguard v1.2.0
Compiling cc v1.0.81
Compiling libc v0.2.147
Compiling winapi v0.3.9
Compiling pkg-config v0.3.27
Compiling crossbeam-utils v0.8.16
Compiling crypto-common v0.1.6
Compiling memoffset v0.9.0
Compiling lock_api v0.4.10
Compiling serde v1.0.180
Compiling parking_lot_core v0.9.8
Compiling serde_derive v1.0.180
Compiling crossbeam-epoch v0.9.15
Compiling subtle v2.5.0
Compiling smallvec v1.11.0
Compiling zstd-sys v2.0.8+zstd.1.5.5
Compiling block-buffer v0.10.4
Compiling windows_x86_64_gnu v0.42.2
Compiling digest v0.10.7
Compiling tinyvec_macros v0.1.1
Compiling rayon-core v1.11.0
Compiling cpufeatures v0.2.9
Compiling crc32fast v1.3.2
Compiling crossbeam-deque v0.8.3
Compiling tinyvec v1.6.0
Compiling parking_lot v0.12.1
Compiling crossterm_winapi v0.9.1
Compiling crossbeam-channel v0.5.8
Compiling bzip2-sys v0.1.11+1.0.8
Compiling heck v0.4.1
Compiling unicode-width v0.1.10
Compiling zstd-safe v5.0.2+zstd.1.5.2
Compiling syn v1.0.109
Compiling anstyle v1.0.1
Compiling bitflags v1.3.2
Compiling adler v1.0.2
Compiling hashbrown v0.14.0
Compiling rustversion v1.0.14
Compiling num_cpus v1.16.0
Compiling utf8parse v0.2.1
Compiling anstyle-parse v0.2.1
Compiling miniz_oxide v0.7.1
Compiling anstyle-wincon v1.0.1
Compiling unicode-normalization v0.1.22
Compiling windows-targets v0.42.2
Compiling is-terminal v0.4.9
Compiling anstyle-query v1.0.0
Compiling inout v0.1.3
Compiling memchr v2.5.0
Compiling native-tls v0.2.11
Compiling base64ct v1.6.0
Compiling colorchoice v1.0.0
Compiling either v1.9.0
Compiling thiserror v1.0.44
Compiling percent-encoding v2.3.0
Compiling portable-atomic v1.4.2
Compiling unicode-bidi v0.3.13
Compiling lazy_static v1.4.0
Compiling rand_core v0.6.4
Compiling equivalent v1.0.1
Compiling indexmap v2.0.0
Compiling password-hash v0.4.2
Compiling idna v0.4.0
Compiling form_urlencoded v1.2.0
Compiling rayon v1.7.0
Compiling anstream v0.3.2
Compiling cipher v0.4.4
Compiling windows-sys v0.45.0
Compiling flate2 v1.0.26
Compiling serde_spanned v0.6.3
Compiling toml_datetime v0.6.3
Compiling sha2 v0.10.7
Compiling hmac v0.12.1
Compiling schannel v0.1.22
Compiling winapi-util v0.1.5
Compiling thiserror-impl v1.0.44
Compiling byteorder v1.4.3
Compiling unicode-segmentation v1.10.1
Compiling encode_unicode v0.3.6
Compiling deranged v0.3.7
Compiling clap_lex v0.5.0
Compiling ciborium-io v0.2.1
Compiling half v1.8.2
Compiling time-core v0.1.1
Compiling option-ext v0.2.0
Compiling fnv v1.0.7
Compiling winnow v0.5.3
Compiling itoa v1.0.9
Compiling bytes v1.4.0
Compiling once_cell v1.18.0
Compiling strsim v0.10.0
Compiling time v0.3.25
Compiling http v0.2.9
Compiling clap_builder v4.3.19
Compiling toml_edit v0.19.14
Compiling ciborium-ll v0.2.1
Compiling dirs-sys v0.4.1
Compiling console v0.15.7
Compiling newline-converter v0.2.2
Compiling strum_macros v0.24.3
Compiling same-file v1.0.6
Compiling pbkdf2 v0.11.0
Compiling aes v0.8.3
Compiling url v2.4.0
Compiling crossterm v0.25.0
Compiling crossterm v0.26.1
Compiling clap_derive v4.3.12
Compiling sha1 v0.10.5
Compiling constant_time_eq v0.1.5
Compiling dyn-clone v1.0.12
Compiling strum v0.24.1
Compiling number_prefix v0.4.0
Compiling log v0.4.19
Compiling clap v4.3.19
Compiling indicatif v0.17.6
Compiling attohttpc v0.25.0
Compiling comfy-table v6.2.0
Compiling inquire v0.6.2
Compiling quick-xml v0.26.0
Compiling walkdir v2.3.3
Compiling directories v5.0.1
Compiling toml v0.7.6
Compiling ciborium v0.2.1
Compiling dashmap v5.5.0
Compiling fxhash v0.2.1
Compiling terminal_size v0.2.6
Compiling filesize v0.2.0
Compiling xattr v1.0.1
error[E0433]: failed to resolve: could not find unix in os
--> C:\Users\bojan.cargo\registry\src\index.crates.io-6f17d22bba15001f\xattr-1.0.1\src\util.rs:4:14
|
4 | use std::os::unix::ffi::OsStrExt;
| ^^^^ could not find unix in os

error[E0433]: failed to resolve: could not find unix in os
--> C:\Users\bojan.cargo\registry\src\index.crates.io-6f17d22bba15001f\xattr-1.0.1\src\lib.rs:36:14
|
36 | use std::os::unix::io::AsRawFd;
| ^^^^ could not find unix in os

error[E0433]: failed to resolve: could not find unix in os
--> C:\Users\bojan.cargo\registry\src\index.crates.io-6f17d22bba15001f\xattr-1.0.1\src\sys\unsupported.rs:3:14
|
3 | use std::os::unix::io::RawFd;
| ^^^^ could not find unix in os

For more information about this error, try rustc --explain E0433.
error: could not compile xattr (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile emuman v2.9.4, intermediate artifacts can be found at C:\Users\bojan\AppData\Local\Temp\cargo-installilDd3B

@dbojan
Copy link
Author

dbojan commented Aug 3, 2023

Thanks.
It tries to install emuman v2.9.4, but ...

@tuffy
Copy link
Owner

tuffy commented Aug 8, 2023

Sorry to take so long to respond. I've pushed out a 2.9.5 version which should avoid pulling in the xattr dependency altogether on Windows platforms. Hopefully that will build more successfully.

@dbojan
Copy link
Author

dbojan commented Aug 9, 2023

Thank you, much appreciated.
There are still some errors:

error[E0658]: use of unstable library feature 'windows_by_handle'
--> C:\Users\bojan.cargo\registry\src\index.crates.io-6f17d22bba15001f\emuman-2.9.5\src\game.rs:1204:20
|
1204 | dev: m.volume_serial_number().unwrap().into(),
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #63010 rust-lang/rust#63010 for more information

error[E0658]: use of unstable library feature 'windows_by_handle'
--> C:\Users\bojan.cargo\registry\src\index.crates.io-6f17d22bba15001f\emuman-2.9.5\src\game.rs:1205:20
|
1205 | ino: m.file_index().unwrap(),
| ^^^^^^^^^^
|
= note: see issue #63010 rust-lang/rust#63010 for more information

error[E0599]: no method named ino found for reference &walkdir::DirEntry in the current scope
--> C:\Users\bojan.cargo\registry\src\index.crates.io-6f17d22bba15001f\emuman-2.9.5\src\game.rs:1916:39
|
1916 | seen.insert(e.ino())
| ^^^ method not found in &DirEntry

Some errors have detailed explanations: E0599, E0658.
For more information about an error, try rustc --explain E0599.
error: could not compile emuman (bin "emuman") due to 3 previous errors
error: failed to compile emuman v2.9.5, intermediate artifacts can be found at C:\Users\bojan\AppData\Local\Temp\cargo-installnfVHYr

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