watchexec/cargo-watch

Failed to compile on Windows

lomirus opened this issue · 1 comments

  • rustc: rustc 1.79.0 (129f3b996 2024-06-10)
  • system: Windows 11 x64
Log
$ cargo install cargo-watch
    Updating crates.io index
  Installing cargo-watch v8.5.2
    Updating crates.io index
     Locking 228 packages to latest compatible versions
      Adding aho-corasick v0.7.20 (latest: v1.1.3)
      Adding bitflags v1.3.2 (latest: v2.5.0)
      Adding bstr v0.2.17 (latest: v1.9.1)
      Adding cargo_metadata v0.17.0 (latest: v0.18.1)
      Adding cfg-if v0.1.10 (latest: v1.0.0)
      Adding cfg_aliases v0.1.1 (latest: v0.2.1)
      Adding clap v2.34.0 (latest: v4.5.7)
      Adding clearscreen v1.0.11 (latest: v3.0.0)
      Adding command-group v1.0.8 (latest: v5.0.1)
      Adding darling v0.12.4 (latest: v0.20.9)
      Adding darling_core v0.12.4 (latest: v0.20.9)
      Adding darling_macro v0.12.4 (latest: v0.20.9)
      Adding derive_builder v0.10.2 (latest: v0.20.0)
      Adding derive_builder_core v0.10.2 (latest: v0.20.0)
      Adding derive_builder_macro v0.10.2 (latest: v0.20.0)
      Adding dirs v4.0.0 (latest: v5.0.1)
      Adding dirs-sys v0.3.7 (latest: v0.4.1)
      Adding fsevent v0.4.0 (latest: v2.1.2)
      Adding fsevent-sys v2.0.1 (latest: v4.1.0)
      Adding generic-array v0.14.7 (latest: v1.0.0)
      Adding globset v0.4.6 (latest: v0.4.14)
      Adding hermit-abi v0.1.19 (latest: v0.4.0)
      Adding inotify v0.7.1 (latest: v0.10.2)
      Adding linux-raw-sys v0.4.14 (latest: v0.6.4)
      Adding malloc_buf v0.0.6 (latest: v1.0.0)
      Adding memoffset v0.6.5 (latest: v0.9.1)
      Adding mio v0.6.23 (latest: v1.0.0)
      Adding miow v0.2.2 (latest: v0.6.0)
      Adding nix v0.22.3 (latest: v0.29.0)
      Adding nix v0.24.3 (latest: v0.29.0)
      Adding nix v0.28.0 (latest: v0.29.0)
      Adding nom v5.1.3 (latest: v7.1.3)
      Adding notify v4.0.17 (latest: v6.1.1)
      Adding quick-xml v0.31.0 (latest: v0.32.0)
      Adding redox_syscall v0.4.1 (latest: v0.5.2)
      Adding siphasher v0.3.11 (latest: v1.0.1)
      Adding stderrlog v0.5.4 (latest: v0.6.0)
      Adding strsim v0.8.0 (latest: v0.11.1)
      Adding strsim v0.10.0 (latest: v0.11.1)
      Adding syn v1.0.109 (latest: v2.0.66)
      Adding tauri-winrt-notification v0.2.1 (latest: v0.5.0)
      Adding termcolor v1.1.3 (latest: v1.4.1)
      Adding terminfo v0.7.5 (latest: v0.9.0)
      Adding textwrap v0.11.0 (latest: v0.16.1)
      Adding toml_edit v0.21.1 (latest: v0.22.14)
      Adding wasi v0.11.0+wasi-snapshot-preview1 (latest: v0.13.1+wasi-0.2.0)
      Adding watchexec v1.17.2 (latest: v4.1.0)
      Adding which v4.4.2 (latest: v6.0.1)
      Adding winapi v0.2.8 (latest: v0.3.9)
      Adding windows v0.56.0 (latest: v0.57.0)
      Adding windows-core v0.52.0 (latest: v0.57.0)
      Adding windows-core v0.56.0 (latest: v0.57.0)
      Adding windows-implement v0.56.0 (latest: v0.57.0)
      Adding windows-interface v0.56.0 (latest: v0.57.0)
      Adding winnow v0.5.40 (latest: v0.6.13)
   Compiling proc-macro2 v1.0.85
   Compiling unicode-ident v1.0.12
   Compiling windows_x86_64_msvc v0.52.5
   Compiling memchr v2.7.4
   Compiling winapi v0.3.9
   Compiling syn v1.0.109
   Compiling siphasher v0.3.11
   Compiling rand_core v0.6.4
   Compiling ident_case v1.0.1
   Compiling strsim v0.10.0
   Compiling fnv v1.0.7
   Compiling serde v1.0.203
   Compiling version_check v0.9.4                                                                                                                                     
   Compiling once_cell v1.19.0
   Compiling cfg-if v1.0.0
   Compiling phf_shared v0.11.2
   Compiling rand v0.8.5
   Compiling rustix v0.38.34                                                                                                                                          
   Compiling autocfg v1.3.0                                                                                                                                           
   Compiling thiserror v1.0.61                                                                                                                                        
   Compiling libc v0.2.155                                                                                                                                            
   Compiling windows-targets v0.52.5
   Compiling nom v5.1.3
   Compiling windows-sys v0.52.0
   Compiling windows-result v0.1.2                                                                                                                                    
   Compiling aho-corasick v1.1.3                                                                                                                                      
   Compiling regex-syntax v0.8.4                                                                                                                                      
   Compiling num-traits v0.2.19                                                                                                                                       
   Compiling phf_generator v0.11.2                                                                                                                                    
   Compiling bitflags v2.5.0                                                                                                                                          
   Compiling phf v0.11.2                                                                                                                                              
   Compiling phf_codegen v0.11.2                                                                                                                                      
   Compiling log v0.4.21
   Compiling terminfo v0.7.5                                                                                                                                          
   Compiling quote v1.0.36                                                                                                                                            
   Compiling either v1.12.0                                                                                                                                           
   Compiling camino v1.1.7
   Compiling serde_json v1.0.117                                                                                                                                      
   Compiling syn v2.0.66                                                                                                                                              
   Compiling bitflags v1.3.2                                                                                                                                          
   Compiling semver v1.0.23                                                                                                                                           
   Compiling bstr v0.2.17                                                                                                                                             
   Compiling quick-xml v0.31.0                                                                                                                                        
   Compiling aho-corasick v0.7.20                                                                                                                                     
   Compiling windows-version v0.1.1                                                                                                                                   
   Compiling ryu v1.0.18
   Compiling regex-automata v0.4.7                                                                                                                                    
   Compiling unicode-width v0.1.13                                                                                                                                    
   Compiling itoa v1.0.11                                                                                                                                             
   Compiling textwrap v0.11.0
   Compiling chrono v0.4.38                                                                                                                                           
   Compiling thread_local v1.1.8                                                                                                                                      
   Compiling strsim v0.8.0                                                                                                                                            
   Compiling vec_map v0.8.2
   Compiling lazy_static v1.4.0                                                                                                                                       
   Compiling glob v0.3.1                                                                                                                                              
   Compiling dotenvy v0.15.7
   Compiling winapi-util v0.1.8                                                                                                                                       
   Compiling errno v0.3.9                                                                                                                                             
   Compiling dirs-sys v0.3.7
   Compiling same-file v1.0.6                                                                                                                                         
   Compiling dirs v4.0.0
   Compiling home v0.5.9                                                                                                                                              
   Compiling walkdir v2.5.0                                                                                                                                           
   Compiling atty v0.2.14                                                                                                                                             
   Compiling filetime v0.2.23
   Compiling command-group v1.0.8
   Compiling which v4.4.2
   Compiling notify v4.0.17                                                                                                                                           
   Compiling termcolor v1.1.3                                                                                                                                         
   Compiling clap v2.34.0
error[E0308]: mismatched types                                                                                                                                        
   --> C:\Users\28154\.cargo\registry\src\index.crates.io-6f17d22bba15001f\notify-4.0.17\src\windows.rs:276:29
    |
276 |         overlapped.hEvent = request_p;
    |         -----------------   ^^^^^^^^^ expected `winapi::ctypes::c_void`, found `libc::c_void`
    |         |
    |         expected due to the type of this binding
    |
    = note: `libc::c_void` and `winapi::ctypes::c_void` have similar names, but are actually distinct types
note: `libc::c_void` is defined in crate `core`
   --> C:\Users\28154\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\ffi\mod.rs:183:1
    |
183 | pub enum c_void {
    | ^^^^^^^^^^^^^^^
note: `winapi::ctypes::c_void` is defined in crate `winapi`
   --> C:\Users\28154\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winapi-0.3.9\src\lib.rs:38:5
    |
38  |     pub enum c_void {}
    |     ^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> C:\Users\28154\.cargo\registry\src\index.crates.io-6f17d22bba15001f\notify-4.0.17\src\windows.rs:282:13
     |
280  |         let ret = winbase::ReadDirectoryChangesW(
     |                   ------------------------------ arguments to this function are incorrect
281  |             handle,
282  |             req_buf,
     |             ^^^^^^^ expected `winapi::ctypes::c_void`, found `libc::c_void`
     |
     = note: `libc::c_void` and `winapi::ctypes::c_void` have similar names, but are actually distinct types
note: `libc::c_void` is defined in crate `core`
    --> C:\Users\28154\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\ffi\mod.rs:183:1
     |
183  | pub enum c_void {
     | ^^^^^^^^^^^^^^^
note: `winapi::ctypes::c_void` is defined in crate `winapi`
    --> C:\Users\28154\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winapi-0.3.9\src\lib.rs:38:5
     |
38   |     pub enum c_void {}
     |     ^^^^^^^^^^^^^^^
note: function defined here
    --> C:\Users\28154\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winapi-0.3.9\src\um\winbase.rs:2072:12
     |
2072 |     pub fn ReadDirectoryChangesW(
     |            ^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0308`.                                                                                                   
error: could not compile `notify` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-watch v8.5.2`, intermediate artifacts can be found at `C:\Users\28154\AppData\Local\Temp\cargo-installrFFJnu`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

from the readme:

$ cargo install cargo-watch --locked