rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.79k stars 2.42k forks source link

Cargo build failure : recipe for target 'cargo-x86_64-pc-windows-gnu' failed #852

Closed 1sp closed 10 years ago

1sp commented 10 years ago

rustc : 0.13.0-nightly (e4ead7b03 2014-11-12 12:21:57 +0000) Cargo : rev e6ec71a

Steps:

  1. ./configure --enable-nightly && make

Output: touch target/snapshot/bin/cargo.exe "/usr/local/bin/rustc" -v rustc 0.13.0-nightly (e4ead7b03 2014-11-12 12:21:57 +0000) target/snapshot/bin/cargo.exe build --target x86_64-pc-windows-gnu Unable to update https://github.com/alexcrichton/curl-rust?ref=build-cmd#c7a6c512

To learn more, run the command again with --verbose. Makefile:77: recipe for target 'cargo-x86_64-pc-windows-gnu' failed make: *\ [cargo-x86_64-pc-windows-gnu] Error 101

Addition info: Running command "cargo build --target x86_64-pc-windows-gnu --release --verbose" gives following error -

Unable to update https://github.com/alexcrichton/curl-rust?ref=build-cmd#c7a6c512

Caused by: failed to update submodules

Caused by: [4] Reference 'refs/heads/master' not found

alexcrichton commented 10 years ago

Hm this looks suspicious. Could you try removing $HOME/.cargo/git and retry? This may be a corrupt git database or checkout location, but we should in theory handle this sort of case regardless.

1sp commented 10 years ago

I removed $HOME/.cargo/git and run make again. The error reported above vanished but unfortunately other (probably more messy) errors appeared.

Cargo rev : 3e578c969e67c2c07277e5ff6ceddaab2ac4295f

$ make
"/usr/local/bin/rustc" -v
rustc 0.13.0-nightly (7ea23e562 2014-11-12 10:27:01 +0000)
target/snapshot/bin/cargo.exe build --target x86_64-pc-windows-gnu
   Compiling curl-sys v0.0.1 (https://github.com/alexcrichton/curl-rust?ref=build-cmd#c7a6c512)
   Compiling libgit2-sys v0.0.1 (https://github.com/alexcrichton/git2-rs#847a4902)
Build failed, waiting for other jobs to finish...
Failed to run custom build command for `curl-sys v0.0.1 (https://github.com/alexcrichton/curl-rust?ref=build-cmd#c7a6c512)`
Process didn't exit successfully: `C:\msys64\home\sudhir\cargo\target\build\curl-sys-0e9770c6308bcf40\build-script-build.exe` (status=101)
--- stdout
running: cmake '-G' 'Unix Makefiles' 'C:\msys64\home\sudhir\.cargo\git\checkouts\curl-rust-fad39707c1101a04\build-cmd\curl-sys\curl' '-DBUILD_CURL_EXE=OFF' '-DBUILD_CURL_TESTS=OFF' '-DCURL_STATICLIB=ON' '-DCURL_DISABLE_FTP=ON' '-DCURL_DISABLE_LDAP=ON' '-DCURL_DISABLE_TELNET=ON' '-DCURL_DISABLE_DICT=ON' '-DCURL_DISABLE_TFTP=ON' '-DCURL_DISABLE_RTSP=ON' '-DCURL_DISABLE_LDAPS=ON' '-DCURL_DISABLE_POP3=ON' '-DCURL_DISABLE_POP3=ON' '-DCURL_DISABLE_IMAP=ON' '-DCURL_DISABLE_SMTP=ON' '-DCURL_DISABLE_GOPHER=ON' '-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -m64 -fPIC' '-DCMAKE_BUILD_TYPE=RelWithDebInfo' '-DCMAKE_INSTALL_PREFIX=C:\msys64\home\sudhir\cargo\target\x86_64-pc-windows-gnu\build\curl-sys-0e9770c6308bcf40\out'

--- stderr
task '<main>' panicked at 'assertion failed: cmd.stdout(InheritFd(1)).stderr(InheritFd(2)).status().unwrap().success()', build.rs:92

Makefile:77: recipe for target 'cargo-x86_64-pc-windows-gnu' failed
make: *** [cargo-x86_64-pc-windows-gnu] Error 101
alexcrichton commented 10 years ago

Do you have cmake installed?

1sp commented 10 years ago

Yes, and the problem was cmake itself as it was failing due to missing dependencies. I used a prebuilt cmake and the error was gone. Thank you !

MeRahulAhire commented 2 years ago

Hi, I'm on a windows PC I want to know how do I compile for Linux and MacOS?