Skip to content

Build fails on Windows 10 #11

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

Closed
markusl opened this issue Oct 28, 2016 · 33 comments
Closed

Build fails on Windows 10 #11

markusl opened this issue Oct 28, 2016 · 33 comments

Comments

@markusl
Copy link

markusl commented Oct 28, 2016

I'm trying to compile rust-curl as part of my binary on a build machine which runs Windows 10. The build fails with following error logs. Any tips to get it working? Rust version 1.12 MSVC 64 bit.

[08:45:38][Step 1/1] error: failed to run custom build command for libz-sys v1.0.6
[08:45:38][Step 1/1] process didn't exit successfully: C:\BuildAgent-01\work\dac4b43613e8c67e\target\release\build\libz-sys-abc54d15a9de5c22\build-script-build (exit code: 101)
[08:45:38][Step 1/1] --- stdout
[08:45:38][Step 1/1] running: "nmake.exe" "/nologo" "/f" "C:\Windows\system32\config\systemprofile.cargo\registry\src\github.1485827954.workers.dev-1ecc6299db9ec823\libz-sys-1.0.6\src/zlib-1.2.8\win32/Makefile.msc" "zlib.lib"
[08:45:38][Step 1/1]
[08:45:38][Step 1/1] --- stderr
[08:45:38][Step 1/1] thread 'main' panicked at 'failed to run: The system cannot find the file specified. (os error 2)', C:\Windows\system32\config\systemprofile.cargo\registry\src\github.1485827954.workers.dev-1ecc6299db9ec823\libz-sys-1.0.6\build.rs:130
[08:45:38][Step 1/1] stack backtrace:
[08:45:38][Step 1/1] 0: 0x7ff7e81e290e - _<std..rand..ThreadRng as rand..Rng>::next_u64::h75a21f4cede609ad
[08:45:38][Step 1/1] 1: 0x7ff7e81e0de3 - std::rt::lang_start::h53bf99b0829cc03c
[08:45:38][Step 1/1] 2: 0x7ff7e81e17ed - std::panicking::rust_panic_with_hook::h4cbd7ca63ce1aee9
[08:45:38][Step 1/1] 3: 0x7ff7e81e1636 - std::panicking::begin_panic_fmt::hd0daa02942245d81
[08:45:38][Step 1/1] 4: 0x7ff7e81e1594 - std::panicking::begin_panic_fmt::hd0daa02942245d81
[08:45:38][Step 1/1] 5: 0x7ff7e81a9014 - __ImageBase
[08:45:38][Step 1/1] 6: 0x7ff7e81a3806 - __ImageBase
[08:45:38][Step 1/1] 7: 0x7ff7e81e4ad1 - _rust_maybe_catch_panic
[08:45:38][Step 1/1] 8: 0x7ff7e81e068a - std::rt::lang_start::h53bf99b0829cc03c
[08:45:38][Step 1/1] 9: 0x7ff7e81e9fb8 - __scrt_common_main_seh
[08:45:38][Step 1/1] at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253
[08:45:38][Step 1/1] 10: 0x7fff33418101 - BaseThreadInitThunk
[08:45:38][Step 1/1]
[08:45:38][Step 1/1] Process exited with code 101

@alexcrichton
Copy link
Member

Thanks for the report! I think this happened because the build script couldn't find nmake.exe. Normally that happens automatically through probing logic to find the VS installation, but it looks like that logic didn't work for you unfortunately! To get things running immediately you can run commands inside of the VS shell, but I'd also prefer to fix this at the source.

What does your installation of VS look like? e.g. is it relatively standard? If so, what version are you using?

@markusl
Copy link
Author

markusl commented Oct 28, 2016

I'll check this with another Windows 10 machine. The case here was a build service running as system account as can be seen from the path C:\Windows\system32\config\systemprofile.cargo Don't know if it makes difference. Should have normal VS2015 installation as the machine is used for other C++ builds as well.

@alexcrichton
Copy link
Member

Ah ok. In that case it's probably a failure of this logic to find the nmake.exe executable on your system. If you run a build manually (through a user) does it make a difference? That'd at least rule out the service-or-not cause perhaps.

Unfortunately though I'm not sure exactly why this would be happening...

@markusl
Copy link
Author

markusl commented Oct 31, 2016

It looks about the same when running as normal user in Win10:

r>cargo build
Compiling syn v0.9.2
Compiling libz-sys v1.0.6
Compiling time v0.1.35
Compiling syntex_errors v0.46.0
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for libz-sys v1.0.6
process didn't exit successfully: C:\prod\version-notifier\target\debug\build\libz-sys-abc54d15a9de5c22\build-script-build (exit code: 101)
--- stdout
running: "nmake.exe" "/nologo" "/f" "C:\Users<username>.cargo\registry\src\github.1485827954.workers.dev-1ecc6299db9ec823\libz-sys-1.0.6\src/zlib-1.2.8\win32/Makefile.msc" "zlib.lib"

--- stderr
thread 'main' panicked at 'failed to run: The system cannot find the file specified. (os error 2)', C:\Users.cargo\registry\src\github.1485827954.workers.dev-1ecc6299db9ec823\libz-sys-1.0.6\build.rs:130
stack backtrace:
0: 0x7ff65131495e - _<std..rand..ThreadRng as rand..Rng>::next_u64::h75a21f4cede609ad
1: 0x7ff651312e33 - std::rt::lang_start::h53bf99b0829cc03c
2: 0x7ff65131383d - std::panicking::rust_panic_with_hook::h4cbd7ca63ce1aee9
3: 0x7ff651313686 - std::panicking::begin_panic_fmt::hd0daa02942245d81
4: 0x7ff6513135e4 - std::panicking::begin_panic_fmt::hd0daa02942245d81
5: 0x7ff6512bd6cc - build_script_build::run
at C:\prod\version-notifier:8
6: 0x7ff6512bbe3f - build_script_build::build_msvc_zlib
at C:\Users.cargo\registry\src\github.1485827954.workers.dev-1ecc6299db9ec823\libz-sys-1.0.6\build.rs:104
7: 0x7ff6512b8359 - build_script_build::main
at C:\Users.cargo\registry\src\github.1485827954.workers.dev-1ecc6299db9ec823\libz-sys-1.0.6\build.rs:35
8: 0x7ff651316b21 - _rust_maybe_catch_panic
9: 0x7ff6513126da - std::rt::lang_start::h53bf99b0829cc03c
10: 0x7ff6512bd8d9 - main
11: 0x7ff65131bf98 - __scrt_common_main_seh
at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253
12: 0x7fff33418101 - BaseThreadInitThunk

@alexcrichton
Copy link
Member

Could you try checking out gcc-rs and poking around windows_registry.rs? It may be that some variable is off somewhere or something like that, but there's something in there returning None that shouldn't...

@markusl
Copy link
Author

markusl commented Nov 1, 2016

No luck either with GCC 5.3 from MinGW project and rust-1.12.1-x86_64-pc-windows-gnu

Edit: Now I see what you meant :)

Tested again that rust-1.12.1-i686-pc-windows-msvc works fine and rust-1.12.1-x86_64-pc-windows-msvc fails on Windows 10.

If I run "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall" and then cargo build again I get a different error:

r>cargo run
Compiling kernel32-sys v0.2.2
error: linking with link.exe failed: exit code: 1112 Compiling
curl-sys v0.2.3
|
= note: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib" "C:\prod\version-notifier\target\debug\build\kernel32-sys-d6afa5bd3d7cfaef\build_script_build.0.o" "/OUT:C:\prod\version-notifier\target\debug\build\kernel32-sys-d6afa5bd3d7cfaef\build_script_build.exe" "/OPT:REF,ICF" "/DEBUG" "/LIBPATH:C:\prod\version-notifier\target\debug\deps" "/LIBPATH:C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib" "C:\prod\version-notifier\target\debug\deps\libbuild-493a7b0628804707.rlib" "C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd-5c6cf767.rlib" "C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib\libpanic_unwind-5c6cf767.rlib" "C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib\libunwind-5c6cf767.rlib" "C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib\librand-5c6cf767.rlib" "C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib\libcollections-5c6cf767.rlib" "C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_unicode-5c6cf767.rlib" "C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib\liblibc-5c6cf767.rlib" "C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib\liballoc-5c6cf767.rlib" "C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib\liballoc_system-5c6cf767.rlib" "C:\Program Files\Rust stable MSVC 1.12\lib\rustlib\x86_64-pc-windows-msvc\lib\libcore-5c6cf767.rlib" "ws2_32.lib" "userenv.lib" "shell32.lib" "advapi32.lib" "msvcrt.lib" "compiler-rt.lib"
= note: msvcrt.lib(chkstk.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

@alexcrichton
Copy link
Member

Oh that error looks like the wrong vcvarsall script was run perhaps? You may have to run the one in either the x64 or amd64 directory, I forget what it's called...

@cramertj
Copy link
Member

I'm having this issue as well when trying to compile RLS on Windows 10:

C:\Users\crame\rustiness\rls (master)
λ cmd /V /C "set RUST_BACKTRACE=1 && cargo build"
   Compiling libz-sys v1.0.10
   Compiling rls-span v0.1.0 (https://github.com/nrc/rls-span#3c047e11)
   Compiling languageserver-types v0.6.1 (https://github.com/gluon-lang/languageserver-types#a8d3600f)
   Compiling syntex_errors v0.52.0
   Compiling time v0.1.35
   Compiling net2 v0.2.26
   Compiling clap v2.19.3
   Compiling thread_local v0.2.7
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `libz-sys v1.0.10`
process didn't exit successfully: `C:\Users\crame\rustiness\rls\target\debug\build\libz-sys-22a6c4aef7ad72ac\build-script-build` (exit code: 101)
--- stdout
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("i686-pc-windows-gnu")
debug=true opt-level=0
HOST = Some("i686-pc-windows-gnu")
TARGET = Some("i686-pc-windows-gnu")
TARGET = Some("i686-pc-windows-gnu")
HOST = Some("i686-pc-windows-gnu")
CC_i686-pc-windows-gnu = None
CC_i686_pc_windows_gnu = None
HOST_CC = None
CC = None
TARGET = Some("i686-pc-windows-gnu")
HOST = Some("i686-pc-windows-gnu")
CFLAGS_i686-pc-windows-gnu = None
CFLAGS_i686_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
running: "make" "-f" "win32/Makefile.gcc" "install" "prefix=C:\\Users\\crame\\rustiness\\rls\\target\\debug\\build\\libz-sys-6e9fd7293876c9ff\\out" "INCLUDE_PATH=C:\\Users\\crame\\rustiness\\rls\\target\\debug\\build\\libz-sys-6e9fd7293876c9ff\\out\\include" "LIBRARY_PATH=C:\\Users\\crame\\rustiness\\rls\\target\\debug\\build\\libz-sys-6e9fd7293876c9ff\\out\\lib" "BINARY_PATH=C:\\Users\\crame\\rustiness\\rls\\target\\debug\\build\\libz-sys-6e9fd7293876c9ff\\out\\bin"

--- stderr
thread 'main' panicked at 'failed to run: The system cannot find the file specified. (os error 2)', C:\Users\crame\.cargo\registry\src\github.1485827954.workers.dev-1ecc6299db9ec823\libz-sys-1.0.10\build.rs:186
stack backtrace:
   0:   0x4a5241 - <unknown>
   1:   0x4a6628 - <unknown>
   2: 0x77844ea1 - <unknown>
   3:   0x4af2ac - <unknown>
   4:   0x4150a9 - <unknown>
   5:   0x411d5c - <unknown>
   6:   0x4a6347 - <unknown>
   7:   0x41a9b2 - <unknown>
   8:   0x4013dd - <unknown>
   9: 0x771062c3 - <unknown>
  10: 0x77860608 - <unknown>

@cramertj
Copy link
Member

And compiling in MINGW gives a completely different error altogether!

crame@DESKTOP-TJ1P5BO MINGW64 /c/Users/crame/rustiness/rls
$ RUST_BACKTRACE=1 cargo build
   Compiling libz-sys v1.0.10
   Compiling time v0.1.35
   Compiling thread-id v2.0.0
   Compiling same-file v0.1.1
   Compiling fs2 v0.3.0
   Compiling serde_codegen v0.8.22
   Compiling term v0.4.4
   Compiling term_size v0.2.1
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `libz-sys v1.0.10`
process didn't exit successfully: `C:\Users\crame\rustiness\rls\target\debug\build\libz-sys-c20da5f29c41e515\build-script-build` (exit code: 101)
--- stdout
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("x86_64-pc-windows-gnu")
debug=true opt-level=0
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: "make" "-f" "win32/Makefile.gcc" "install" "prefix=C:\\Users\\crame\\rustiness\\rls\\target\\debug\\build\\libz-sys-e109627694e9981e\\out" "INCLUDE_PATH=C:\\Users\\crame\\rustiness\\rls\\target\\debug\\build\\libz-sys-e109627694e9981e\\out\\include" "LIBRARY_PATH=C:\\Users\\crame\\rustiness\\rls\\target\\debug\\build\\libz-sys-e109627694e9981e\\out\\lib" "BINARY_PATH=C:\\Users\\crame\\rustiness\\rls\\target\\debug\\build\\libz-sys-e109627694e9981e\\out\\bin"
gcc -shared -Wl,--out-implib,libz.dll.a  \
-o zlib1.dll win32/zlib.def adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o  zlibrc.o
win32/Makefile.gcc:96: recipe for target 'zlib1.dll' failed

--- stderr
Cannot export gzopen_w: symbol not defined
collect2: error: ld returned 1 exit status
make: *** [zlib1.dll] Error 1
thread 'main' panicked at 'failed to run successfully: exit code: 2', C:/msys64/home/crame/.multirust/toolchains/nightly/cargo\registry\src\github.1485827954.workers.dev-1ecc6299db9ec823\libz-sys-1.0.10\build.rs:189
stack backtrace:
   0:           0x4af9b7 - <unknown>
   1:           0x4af1e3 - <unknown>
   2:           0x4b0b4e - <unknown>
   3:           0x4b09f6 - <unknown>
   4:           0x4b0919 - <unknown>
   5:           0x41a599 - <unknown>
   6:           0x41537a - <unknown>
   7:           0x412478 - <unknown>
   8:           0x4b07d8 - <unknown>
   9:           0x4b9bd8 - <unknown>
  10:           0x4b12f3 - <unknown>
  11:           0x41a69a - <unknown>
  12:           0x4013b4 - <unknown>
  13:           0x4014e7 - <unknown>
  14:     0x7fff8de08363 - <unknown>

@hoqhuuep
Copy link

hoqhuuep commented Jan 18, 2017

I am also seeing this error compiling RLS on Windows 10.

EDIT3: The issue for me was that it could not find make.

After installing make, Cygwin, MinGW... then uninstalling all those and installing MSYS2 as documented here this is no longer an issue for me... though I have hit this one next: alexcrichton/curl-rust#92 (comment)

@alexcrichton
Copy link
Member

@cramertj as you found your original problem was not being able to find make, but I'm not so sure about your next problem.

Something like that should reproduce on AppVeyor, if at all, I would have though. (or for me locally). I'll take a look.

@alexcrichton
Copy link
Member

@cramertj I think I've fixed that issue in d73b64f, can you test that out?

@cramertj
Copy link
Member

cramertj commented Jan 18, 2017

@alexcrichton Yea, I realized I only had cmake in my path, not make. Still getting the second error.

Edit: posted this before I saw your second message. I'm checking.

@alexcrichton
Copy link
Member

@hoqhuuep did you install Rust through rustup or the official installers?

@cramertj
Copy link
Member

I'll check!

@cramertj
Copy link
Member

@alexcrichton That fixed it. Thanks!

@hoqhuuep
Copy link

@alexcrichton Through rustup. Here are my versions.

C:\Users\Daniel>cargo --version
cargo 0.17.0-nightly (a43403b 2017-01-17)

C:\Users\Daniel>rustup show
Default host: x86_64-pc-windows-gnu

nightly-x86_64-pc-windows-gnu (default)
rustc 1.16.0-nightly (4ce7accaa 2017-01-17)

I tried removing the executables from this directory but it did not make a difference:

...\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\bin

This was my attempt at "just delete the bundled linker that comes with Rust".

@alexcrichton
Copy link
Member

@hoqhuuep hm yes so the resolution (if you're getting the same error as this issue) is to remove the bundled linker, which you've found the right location for. Did the build not succeed after that was removed though? If not, could you gist the full error you're seeing?

@hoqhuuep
Copy link

hoqhuuep commented Jan 20, 2017

Absolutely, thanks a lot for taking a look!

https://gist.github.com/hoqhuuep/8226e0efb2cc678d3732ba0ea51c7005#file-rls-build-error-on-windows-10-L322-L328

That gist also includes versions, path, etc. at the start.

EDIT: I notice it's still trying to use the C RunTime (?) from the rust directory, is this expected?

C:\\Users\\Daniel\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\crt2.o

I tried removing this too, but then it just errors because it cannot find this file.

@alexcrichton
Copy link
Member

@hoqhuuep I think there's a bunch of vendored libraries that come with the rust-mingw component as well, could you try deleting them as well?

@hoqhuuep
Copy link

Huzzah! After much trial and error I now have the RLS extension working in VSCode 😃

Thanks so much for your pointers!

For anyone else having the same issue, here's what finally worked for me:

  • Move the 4 executables out of "C:\Users\Daniel.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\bin" (don't delete them, you'll need them later)
  • Move "libmingwex.a" and "libmsvcrt.a" out of "C:\Users\Daniel.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib"
  • Run "cargo build --release" from RLS source directory from MSYS2 (after installing these packages https://github.com/rust-lang/rust#mingw)
  • This successfully builds RLS, but for whatever reason it's now dynamically linked to everything rather than statically...
  • ...So, I copied all the DLLs from these 2 directories into a folder, then added that to my PATH:
    • C:\Users\Daniel.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib
    • C:\msys64\mingw64\bin
  • I'm sure this is not ideal, but it works 😉
  • Now RLS should run, you can test this by running "cargo run --release" from the RLS source directory from CMD (note, we build in MSYS2 then run in CMD)
  • If there's no errors (it doesn't print much when it's running) you can CTRL+C that to stop it
  • At this point you need to restore the executables and libraries you moved out in the first 2 steps, so that whatever rust project you're working on will build
  • Now try running the rls_vscode extension as per the official instructions (http://www.jonathanturner.org/2017/01/rls-alpha-release.html)
  • I got the "RLS analysis: done" but it was not working properly, after closing VSCode and running it again, it works! 😃

This feels pretty clunky, especially the dynamic linking part... But fortunately none of this should be a problem when they start distributing RLS as a binary from Beta.

@alexcrichton
Copy link
Member

@hoqhuuep what dll dependencies did you find were there? I know that the ones in rustlib/.../lib are expected (those are Rust libraries) but what's depended on in /mingw64/bin/...?

@hoqhuuep
Copy link

@alexcrichton it will not run without these 3 DLLs from /mingw64/bin

  • libstdc++-6.dll
  • libgcc_s_seh-1.dll
  • libwinpthread-1.dll

@alexcrichton
Copy link
Member

@hoqhuuep ah yeah that makes sense, those are all required by LLVM (in the compiler) which the rls links to.

Sounds like the issues here have been solved though! So I'm going to close tis.

@Pzixel
Copy link

Pzixel commented Jul 16, 2018

Have this issue on my machine as well.

MSVC toolchain:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional> cargo +nightly-x86_64-pc-windows-msvc install cargo-tree
    Updating registry `https://github.com/rust-lang/crates.io-index`
  Installing cargo-tree v0.19.0
   Compiling pkg-config v0.3.11
   Compiling cc v1.0.18
   Compiling vcpkg v0.2.4
   Compiling unicode-xid v0.0.4
   Compiling winapi v0.3.5
   Compiling libc v0.2.42
   Compiling winapi-build v0.1.1
   Compiling void v1.0.2
   Compiling matches v0.1.6
   Compiling unicode-xid v0.1.0
   Compiling quote v0.3.15
   Compiling serde v1.0.70
   Compiling ucd-util v0.1.1
error: linking with `C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.13.26128\bin\HostX86\x86\link.exe` failed: exit code: 1112
  |
  = note: ...
  = note: msvcrt.lib(chkstk.obj) : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'

GNU toolchain:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional>cargo +nightly-x86_64-pc-windows-gnu install cargo-tree
    Updating registry `https://github.com/rust-lang/crates.io-index`
  Installing cargo-tree v0.19.0
   Compiling winapi-x86_64-pc-windows-gnu v0.4.0
   Compiling cc v1.0.18
   Compiling pkg-config v0.3.11
   Compiling winapi v0.3.5
   ...
   Compiling quote v0.6.3
   Compiling libssh2-sys v0.2.8
   Compiling libgit2-sys v0.7.5
error: failed to run custom build command for `libz-sys v1.0.18`
process didn't exit successfully: `C:\Users\Alex\AppData\Local\Temp\cargo-installoHrANr\release\build\libz-sys-cf65074e7bf726ec\build-script-build` (exit code: 1)
--- stdout
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-pc-windows-gnu")
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
DEBUG = Some("false")
running: "make" "-f" "win32/Makefile.gcc" "install" "prefix=/C/Users/Alex/AppData/Local/Temp/cargo-installoHrANr/release/build/libz-sys-ace0f6baeffdcb04/out" "IMPLIB=" "INCLUDE_PATH=/C/Users/Alex/AppData/Local/Temp/cargo-installoHrANr/release/build/libz-sys-ace0f6baeffdcb04/out/include" "LIBRARY_PATH=/C/Users/Alex/AppData/Local/Temp/cargo-installoHrANr/release/build/libz-sys-ace0f6baeffdcb04/out/lib" "BINARY_PATH=/C/Users/Alex/AppData/Local/Temp/cargo-installoHrANr/release/build/libz-sys-ace0f6baeffdcb04/out/bin"


command did not execute successfully, got: exit code: 3221225781

cargo 1.28.0-nightly (e2348c2db 2018-06-07)

I do believe that it's libz-sys issue in both cases .

@alexcrichton
Copy link
Member

@Pzixel are you running from the VS tools prompt? If that's the case you'll want to make sure you're using the 64-bit prompt, not the x86 one

@Pzixel
Copy link

Pzixel commented Jul 16, 2018

@alexcrichton yep, x64 promt did the trick. thank you.

However, do you plan to make it run on GNU toolchain somewhere in a lifetime? :) I actually doesn't run msvc toolchain because gdb is not compatible with it, I only installed the whole toolchain just to make cargo-tree compile. It's not very convinient.

@alexcrichton
Copy link
Member

@Pzixel oh this crate should already be compatible with the GNU toolchain! We use it extensively in rustc which works with the GNU toolchain

@Pzixel
Copy link

Pzixel commented Jul 16, 2018

Well, as I have shown before it doesn't work well (see GNU toolchain section above). Maybe i'm doing something wrong? But I can't see what else can I do: I just typed a sinleline command and it failed.

I'm building opencv with cc crate on same machine so my gnu configuration should be ok to make it compile.

@alexcrichton
Copy link
Member

@Pzixel yeah something is going wrong there, it looks like make is segfaulting or something like that? Are you sure you're running the build from the MSYS/MinGW prompts?

@Pzixel
Copy link

Pzixel commented Jul 16, 2018

@alexcrichton I'm using git bash for such a purpose, so I'm pretty sure I do :)

image


3221225781 = 0xc0000135 = STATUS_DLL_NOT_FOUND. I'm not sure what DLL it talks about.

@alexcrichton
Copy link
Member

Alas :(

That still looks like isn't not an issue with this crate though but rather one with your environment. You may want to try executing make itself and get that working before trying the libz-sys build again

@HenkPoley
Copy link

Just since this is somehow the top result on Google for "STATUS_DLL_NOT_FOUND cargo build". How to trace and solve any random occurence:

Download SysInternals procexp64.exe (or just every tool). After startup immediately hit the looking glass 'Stop capture' button (Ctrl+E). And 'Clear' (Ctrl+X).

Set filters for:

  • 'Process name' is 'build-script-build.exe' (or whatever the mentioned process name was) [Add]
  • 'Result' is not 'SUCCESS' [Add]
  • 'Path' ends with '.dll' [Add] [OK]

Start capture again (Ctrl+E).

Run build cargo again. Google for the last listed DLL file.

For me that was VCRUNTIM140.dll, so I installed the VC++ 2015 redistributable.

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