image-rs / imageproc

Image processing operations
MIT License
755 stars 148 forks source link

Compiling with feature "display-window" hangs for a long time before erroring if CMake is not installed #454

Closed cyqsimon closed 6 months ago

cyqsimon commented 3 years ago

Description

Compiling with flags --features display-window requires dependency sdl2-sys(build) which requires CMake, but this requirement is not documented. cargo hangs for a long time before producing a useful error message if CMake is not present.

Environment

Intel i7-10710U; Windows 10 20H2 Pro x64; rust-1.48

Steps to reproduce

  1. Make sure CMake is not installed.
  2. Clear directory imageproc/target.
  3. Run cargo run --release --features display-window --example display_image.

Expected behaviour

Example compiles and runs.

Actual behaviour

cargo hangs for a very long time (~8 minutes in my case) when compiling sdl2-sys(build), during which CPU utilisation sits at around zero. Then it errors and exits with the following message:

thread 'main' panicked at '
  failed to execute command: The system cannot find the file specified. (os error 2)
  is `cmake` not installed?

  build script failed, must exit now'

Given that cargo will hang for a long time before producing an error if CMake is not installed, it may be helpful to check for it in our build script. Additionally, CMake requirement should be documented because we should not expect the user to already have it installed.

theotherphil commented 6 months ago

I've just tried this on my machine and without cmake installed the build fails in a couple of seconds.

Given that the error message appears quickly for me and is pretty clear that cmake is needed I'm going to close this issue.

cyqsimon commented 6 months ago

I've just tried this on my machine and without cmake installed the build fails in a couple of seconds.

Given that the error message appears quickly for me and is pretty clear that cmake is needed I'm going to close this issue.

Yeah I mean it's been 4 years so it's very likely at some point this has been fixed/optimised in cargo.

It was also kind of a noob mistake on my part to begin with so yeah I don't have a problem with closing this.