jeaye / ncurses-rs

A low-level ncurses wrapper for Rust
Other
685 stars 99 forks source link

Build on OS Windows fails with an "cannot delete" error #198

Closed Vest closed 3 years ago

Vest commented 3 years ago

Hello everyone,

I was trying to build the latest version of the library on my Windows machine (Cygwin), and after I met all dependencies, I have faced an error:

thread 'main' panicked at 'cannot delete C:\work\ncurses-rs\target\debug\build\ncurses-614b448966de1353\out\chtype_size: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', build.rs:111:32
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src/panicking.rs:495:5
     1: core::panicking::panic_fmt
               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\core\src/panicking.rs:92:14
     2: core::option::expect_none_failed
               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\core\src/option.rs:1268:5
     3: core::result::Result<T,E>::expect
               at .\C:\Users\user\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib/rustlib/src/rust\library\core\src/result.rs:933:23
     4: build_script_build::check_chtype_size
               at .\C:\work\ncurses-rs/build.rs:111:5
     5: build_script_build::main
               at .\C:\work\ncurses-rs/build.rs:59:5
     6: core::ops::function::FnOnce::call_once
               at .\C:\Users\user\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib/rustlib/src/rust\library\core\src\ops/function.rs:227:5

I am preparing a pull request with a fix.

The issue occurs, because instead of ...\out\chtype_size, the build script should delete ...\out\chtype_size.exe

jeaye commented 3 years ago

This is resolved as v5.100.0.