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

Fail to build on Windows: The system cannot find the file specified #71

Closed
betovsky opened this issue May 20, 2015 · 5 comments
Closed

Comments

@betovsky
Copy link

After adding to Cargo.toml the curl dependency. On building:

   Compiling curl-sys v0.1.22
failed to run custom build command for `curl-sys v0.1.22`
Process didn't exit successfully: `D:\Code\projects\badgerGP\target\debug\build\curl-sys-dd89af55ea8cd7e5\build-script-build` (exit code: 101)
--- stdout
running: "sh" "-c" "/c/Users/MB/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/curl-sys-0.1.22/curl/configure --with-winssl --enable-static=yes --enable-shared=no --enable-optimize --prefix=D:/Code/projects/badgerGP/target/debug/build/curl-sys-dd89af55ea8cd7e5/out --without-librtmp --without-libidn --without-libssh2 --without-nghttp2 --disable-ldap --disable-ldaps --disable-ftp --disable-rtsp --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-manual"

--- stderr
thread '<main>' panicked at 'cmd.status() return the error The system cannot find the file specified.
 (os error 2)', C:\Users\MB\.cargo\registry\src\gh.neting.cc-1ecc6299db9ec823\curl-sys-0.1.22\build.rs:128
@Zebedee68
Copy link

Same problem with me on Win10 32bit, see here: http://stackoverflow.com/questions/32487166/cargo-build-error-file-missing

Anyone?

@phil-n
Copy link

phil-n commented Sep 21, 2015

I have the same problem with windows 10 64bit, moving the project to C:\ as suggested in the SO thread didn't help in my case.

@FlorianScheyer
Copy link

I got the same error, windows 8.1 64bit, still looking for a fix also tried moving the project to C:\ but it didn't work.

@Seeker14491
Copy link

I'm getting this error while trying to install cargo-edit. I'm on Windows 7 64-bit.

   Compiling curl-sys v0.1.26
failed to run custom build command for `curl-sys v0.1.26`
Process didn't exit successfully: `C:\Users\Seeker\Desktop\cargo-edit\target\rel
ease\build\curl-sys-f4d12d0ac911a4c8\build-script-build` (exit code: 101)
--- stdout
Couldn't find libcurl from pkgconfig ("failed to run `\"pkg-config\" \"--libs\"
\"--cflags\" \"libcurl\"`: The system cannot find the file specified. (os error
2)"), compiling it from source...
cargo:rustc-link-search=C:\Users\Seeker\Desktop\cargo-edit\target\release\build\
curl-sys-f4d12d0ac911a4c8\out/lib
cargo:rustc-link-lib=static=curl
cargo:root=C:\Users\Seeker\Desktop\cargo-edit\target\release\build\curl-sys-f4d1
2d0ac911a4c8\out
cargo:include=C:\Users\Seeker\Desktop\cargo-edit\target\release\build\curl-sys-f
4d12d0ac911a4c8\out/include
cargo:rustc-flags=-l ws2_32
OPT_LEVEL = Some("3")
PROFILE = Some("release")
TARGET = Some("x86_64-pc-windows-gnu")
debug=false opt-level=3
HOST = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
running: "sh" "/c/Users/Seeker/.cargo/registry/src/gh.neting.cc-0a35038f75765ae4/c
url-sys-0.1.26/curl/configure" "--with-winssl" "--enable-static=yes" "--enable-s
hared=no" "--enable-optimize" "--prefix=C:\\Users\\Seeker\\Desktop\\cargo-edit\\
target\\release\\build\\curl-sys-f4d12d0ac911a4c8\\out" "--without-librtmp" "--w
ithout-libidn" "--without-libssh2" "--without-nghttp2" "--disable-ldap" "--disab
le-ldaps" "--disable-ftp" "--disable-rtsp" "--disable-dict" "--disable-telnet" "
--disable-tftp" "--disable-pop3" "--disable-imap" "--disable-smtp" "--disable-go
pher" "--disable-manual"

--- stderr
thread '<main>' panicked at 'cmd.status() return the error The system cannot fin
d the file specified. (os error 2)', C:\Users\Seeker\.cargo\registry\src\github.
com-0a35038f75765ae4\curl-sys-0.1.26\build.rs:130

@alexcrichton
Copy link
Owner

This indicates that "sh" isn't an executable in PATH, which probably means that you're not running inside an MSYS2 shell. Some possible fixes are:

  • Compiles can happen from an MSYS2 shell instead of another.
  • "sh" can be added to PATH manually
  • The MSVC-targeting compilers could be used instead of the MinGW ones

In general though there could be some better error messages here.

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

6 participants