sfackler / rust-openssl

OpenSSL bindings for Rust
1.4k stars 752 forks source link

cargo installation not recognising vcpkg on windows #1458

Closed gzbakku closed 3 years ago

gzbakku commented 3 years ago

i have rust, cargo, vcpkg installed

vcpkg installation

-cloned git -run bootstrap-vcpkg.bat

vcpkg is accessible from cli

open ssl installation

-run vcpkg install openssl-windows:x64-windows -run vcpkg install openssl:x64-windows-static -run vcpkg integrate install

vcpkg environment vars

VCPKGRS_DYNAMIC=1 VCPKG_ROOT=vcpkg_dir_path

cargo toml file

[dependencies] gobject = { path = "../gobject" } tokio = { version = "1.5.0", features = ["full"] } tokio-io-timeout = "1.1.1" openssl = "0.10.33"

cargo build result

cargo build with openssl not even recognizing vcpkg exists i dont know what to do

Compiling winapi-x86_64-pc-windows-gnu v0.4.0 Compiling winapi v0.3.9 Compiling autocfg v1.0.1 Compiling cfg-if v1.0.0 Compiling proc-macro2 v1.0.26 Compiling libc v0.2.93 Compiling unicode-xid v0.2.1 Compiling syn v1.0.69 Compiling log v0.4.14 Compiling cc v1.0.67 Compiling ntapi v0.3.6 Compiling pkg-config v0.3.19 Compiling smallvec v1.6.1 Compiling scopeguard v1.1.0 Compiling memchr v2.3.4 Compiling bitflags v1.2.1 Compiling once_cell v1.7.2 Compiling pin-project-lite v0.2.6 Compiling openssl v0.10.33 Compiling bytes v1.0.1 Compiling foreign-types-shared v0.1.1 Compiling md5 v0.7.0 Compiling byteorder v1.4.3 Compiling instant v0.1.9 Compiling tokio v1.5.0 Compiling lock_api v0.4.3 Compiling foreign-types v0.3.2 Compiling gobject v0.1.0 (D:\workstation\expo\rust\gzbdb\gobject) Compiling openssl-sys v0.9.61 Compiling quote v1.0.9 Compiling num_cpus v1.13.0 error: failed to run custom build command foropenssl-sys v0.9.61`

Caused by: process didn't exit successfully: D:\workstation\expo\rust\gzbdb\target\debug\build\openssl-sys-328835132990cb61\build-script-main (exit code: 101) --- stdout cargo:rustc-cfg=const_fn cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_LIB_DIR X86_64_PC_WINDOWS_GNU_OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=OPENSSL_LIB_DIR OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_INCLUDE_DIR X86_64_PC_WINDOWS_GNU_OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_DIR X86_64_PC_WINDOWS_GNU_OPENSSL_DIR unset cargo:rerun-if-env-changed=OPENSSL_DIR OPENSSL_DIR unset cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=OPENSSL_STATIC cargo:rerun-if-env-changed=OPENSSL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR run pkg_config fail: "Failed to run \"pkg-config\" \"--libs\" \"--cflags\" \"openssl\": The system cannot find the file specified. (os error 2)"

--- stderr thread 'main' panicked at '

Could not find directory of OpenSSL installation, and this -sys crate cannot proceed without this knowledge. If OpenSSL is installed and this crate had trouble finding it, you can set the OPENSSL_DIR environment variable for the compilation process.

Make sure you also have the development packages of openssl installed. For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

If you're in a situation where you think the directory should be found automatically, please open a bug at https://github.com/sfackler/rust-openssl and include information about your system as well as this message.

$HOST = x86_64-pc-windows-gnu $TARGET = x86_64-pc-windows-gnu openssl-sys = 0.9.61

It looks like you're compiling for MinGW but you may not have either OpenSSL or pkg-config installed. You can install these two dependencies with:

pacman -S openssl-devel pkg-config

and try building this crate again.

', C:\Users\tejas.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-sys-0.9.61\build\find_normal.rs:174:5 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: build failed `

sfackler commented 3 years ago

vcpkg is only supported on the MSVC Windows targets: https://docs.rs/vcpkg/0.2.12/vcpkg/enum.Error.html#variant.NotMSVC

gzbakku commented 3 years ago

how do i fix this i have tried everything do i install openssl or vcpkg via msvc or what??

sfackler commented 3 years ago

You can use the msvc target in Rust (x86_64-pc-windows-msvc), or install OpenSSL via some other means in a way that's compatible with mingw.

sfackler commented 3 years ago

Or enable the vendored cargo feature to have a vendored copy of OpenSSL built for you.

gzbakku commented 3 years ago

i tried literally all the options on windows none of them are working mingw with msys2, vendered, vcpkg(still not able to get this working) i tried adding target in cargo.toml like this nothing works

[target.x86_64-pc-windows-msvc.dependencies] openssl = "0.10.33"

can you please find a working method to build on windows

ill provide all details needed i just cant figure this one out anyhow i tied everything

sfackler commented 3 years ago

That says to only depend on openssl when building for x86_64-pc-windows-msvc.

In what way could you not get vendored working?

gzbakku commented 3 years ago

i installed mingw perl make via chocolatey with the same system environment variables put in

openssl = { version = "0.10", features = ["vendored"] }

in cargo toml and get the following error

Compiling winapi-x86_64-pc-windows-gnu v0.4.0 Compiling winapi v0.3.9 Compiling autocfg v1.0.1 Compiling cfg-if v1.0.0 Compiling proc-macro2 v1.0.26 Compiling libc v0.2.93 Compiling unicode-xid v0.2.1 Compiling cc v1.0.67 Compiling log v0.4.14 Compiling syn v1.0.69 Compiling pkg-config v0.3.19 Compiling ntapi v0.3.6 Compiling scopeguard v1.1.0 Compiling smallvec v1.6.1 Compiling memchr v2.3.4 Compiling bitflags v1.2.1 Compiling once_cell v1.7.2 Compiling pin-project-lite v0.2.6 Compiling bytes v1.0.1 Compiling openssl v0.10.33 Compiling foreign-types-shared v0.1.1 Compiling byteorder v1.4.3 Compiling md5 v0.7.0 Compiling instant v0.1.9 Compiling tokio v1.5.0 Compiling lock_api v0.4.3 Compiling openssl-src v111.15.0+1.1.1k Compiling foreign-types v0.3.2 Compiling gobject v0.1.0 (D:\workstation\expo\rust\gzbdb\gobject) Compiling num_cpus v1.13.0 Compiling openssl-sys v0.9.61 Compiling quote v1.0.9 error: failed to run custom build command foropenssl-sys v0.9.61`

Caused by: process didn't exit successfully: D:\workstation\expo\rust\gzbdb\target\debug\build\openssl-sys-d180fd2df8d9b33b\build-script-main (exit code: 101) --- stdout cargo:rustc-cfg=const_fn cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_NO_VENDOR X86_64_PC_WINDOWS_GNU_OPENSSL_NO_VENDOR unset cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR OPENSSL_NO_VENDOR unset CC_x86_64-pc-windows-gnu = None CC_x86_64_pc_windows_gnu = None HOST_CC = None CC = None CFLAGS_x86_64-pc-windows-gnu = None CFLAGS_x86_64_pc_windows_gnu = None HOST_CFLAGS = None CFLAGS = None CRATE_CC_NO_DEFAULTS = None DEBUG = Some("true") CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") running "perl" "./Configure" "--prefix=/D/workstation/expo/rust/gzbdb/target/debug/build/openssl-sys-683edcc6cbafba72/out/openssl-build/install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "mingw64" "-O2" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64" "-Wa,-mbig-obj"

--- stderr thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', C:\Users\tejas.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.15.0+1.1.1k\src\lib.rs:469:39 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: build failed `

gzbakku commented 3 years ago

i installed mingw perl make via chocolatey with the same system environment variables put in

openssl = { version = "0.10", features = ["vendored"] }

in cargo toml and get the following error

Compiling winapi-x86_64-pc-windows-gnu v0.4.0 Compiling winapi v0.3.9 Compiling autocfg v1.0.1 Compiling cfg-if v1.0.0 Compiling proc-macro2 v1.0.26 Compiling libc v0.2.93 Compiling unicode-xid v0.2.1 Compiling cc v1.0.67 Compiling log v0.4.14 Compiling syn v1.0.69 Compiling pkg-config v0.3.19 Compiling ntapi v0.3.6 Compiling scopeguard v1.1.0 Compiling smallvec v1.6.1 Compiling memchr v2.3.4 Compiling bitflags v1.2.1 Compiling once_cell v1.7.2 Compiling pin-project-lite v0.2.6 Compiling bytes v1.0.1 Compiling openssl v0.10.33 Compiling foreign-types-shared v0.1.1 Compiling byteorder v1.4.3 Compiling md5 v0.7.0 Compiling instant v0.1.9 Compiling tokio v1.5.0 Compiling lock_api v0.4.3 Compiling openssl-src v111.15.0+1.1.1k Compiling foreign-types v0.3.2 Compiling gobject v0.1.0 (D:\workstation\expo\rust\gzbdb\gobject) Compiling num_cpus v1.13.0 Compiling openssl-sys v0.9.61 Compiling quote v1.0.9 error: failed to run custom build command foropenssl-sys v0.9.61`

Caused by: process didn't exit successfully: D:\workstation\expo\rust\gzbdb\target\debug\build\openssl-sys-d180fd2df8d9b33b\build-script-main (exit code: 101) --- stdout cargo:rustc-cfg=const_fn cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_NO_VENDOR X86_64_PC_WINDOWS_GNU_OPENSSL_NO_VENDOR unset cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR OPENSSL_NO_VENDOR unset CC_x86_64-pc-windows-gnu = None CC_x86_64_pc_windows_gnu = None HOST_CC = None CC = None CFLAGS_x86_64-pc-windows-gnu = None CFLAGS_x86_64_pc_windows_gnu = None HOST_CFLAGS = None CFLAGS = None CRATE_CC_NO_DEFAULTS = None DEBUG = Some("true") CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") running "perl" "./Configure" "--prefix=/D/workstation/expo/rust/gzbdb/target/debug/build/openssl-sys-683edcc6cbafba72/out/openssl-build/install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "mingw64" "-O2" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64" "-Wa,-mbig-obj"

--- stderr thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', C:\Users\tejas.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.15.0+1.1.1k\src\lib.rs:469:39 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: build failed `

this is without mingw sorry i am reinstalling mingw and will post its error too

sfackler commented 3 years ago

Install perl.

gzbakku commented 3 years ago

Install perl.

now i have installed mingw and perl(strawberry) and i get this error

Compiling winapi-x86_64-pc-windows-gnu v0.4.0 Compiling winapi v0.3.9 Compiling autocfg v1.0.1 Compiling cfg-if v1.0.0 Compiling libc v0.2.93 error: linking withx86_64-w64-mingw32-gcc` failed: exit code: 1 | = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-m64" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\rsbegin.o" "-L" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.0.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.1.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.10.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.11.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.12.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.13.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.14.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.15.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.2.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.3.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.4.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.5.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.6.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.7.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.8.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.build_script_build.2r9jktcj-cgu.9.rcgu.o" "-o" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.exe" "D:\workstation\expo\rust\gzbdb\target\debug\build\libc-a4aecf1404105116\build_script_build-a4aecf1404105116.4516q7qa9wo89tlm.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "D:\workstation\expo\rust\gzbdb\target\debug\deps" "-L" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib" "-Wl,--start-group" "-Wl,-Bstatic" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libstd-8394c9398cbadee5.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libpanic_unwind-886e4f572a6d227c.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libobject-17cf826d0f7d2ed3.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libaddr2line-0dad5a98c26b9739.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libgimli-dfab679e0565d217.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_demangle-9f6866b4336a1d1c.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libhashbrown-81ade66b9e4c9cd5.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_std_workspace_alloc-4149a301273ebf0c.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libunwind-738a3de7ad0cd3a3.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libcfg_if-06d418ce9254f841.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\liblibc-7c3291a8d67347b3.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\liballoc-9f2b7229edc9025e.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_std_workspace_core-4ae0cac901a4e3c1.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libcore-9e39cfd0b85a4b6e.rlib" "-Wl,--end-group" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libcompiler_builtins-de70f57e5c136950.rlib" "-Wl,-Bdynamic" "-ladvapi32" "-lws2_32" "-luserenv" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\rsend.o" = note: c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_eh collect2.exe: error: ld returned 1 exit status

error: linking with x86_64-w64-mingw32-gcc failed: exit code: 1 | = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-m64" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\rsbegin.o" "-L" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.0.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.1.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.10.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.11.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.12.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.13.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.14.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.15.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.2.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.3.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.4.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.5.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.6.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.7.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.8.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.build_script_build.d37nv6y6-cgu.9.rcgu.o" "-o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.exe" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-x86_64-pc-windows-gnu-62a1eb56e014856f\build_script_build-62a1eb56e014856f.4b2qgyy9xymnw0fg.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "D:\workstation\expo\rust\gzbdb\target\debug\deps" "-L" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib" "-Wl,--start-group" "-Wl,-Bstatic" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libstd-8394c9398cbadee5.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libpanic_unwind-886e4f572a6d227c.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libobject-17cf826d0f7d2ed3.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libaddr2line-0dad5a98c26b9739.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libgimli-dfab679e0565d217.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_demangle-9f6866b4336a1d1c.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libhashbrown-81ade66b9e4c9cd5.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_std_workspace_alloc-4149a301273ebf0c.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libunwind-738a3de7ad0cd3a3.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libcfg_if-06d418ce9254f841.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\liblibc-7c3291a8d67347b3.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\liballoc-9f2b7229edc9025e.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_std_workspace_core-4ae0cac901a4e3c1.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libcore-9e39cfd0b85a4b6e.rlib" "-Wl,--end-group" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libcompiler_builtins-de70f57e5c136950.rlib" "-Wl,-Bdynamic" "-ladvapi32" "-lws2_32" "-luserenv" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\rsend.o" = note: c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_eh collect2.exe: error: ld returned 1 exit status

error: aborting due to previous error

error: aborting due to previous error

error: could not compile libc

To learn more, run the command again with --verbose. warning: build failed, waiting for other jobs to finish... error: linking with x86_64-w64-mingw32-gcc failed: exit code: 1 | = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-m64" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\rsbegin.o" "-L" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.0.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.1.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.10.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.11.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.12.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.13.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.14.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.15.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.2.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.3.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.4.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.5.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.6.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.7.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.8.rcgu.o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.build_script_build.e94k62xe-cgu.9.rcgu.o" "-o" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.exe" "D:\workstation\expo\rust\gzbdb\target\debug\build\winapi-8fc48382f1c0e540\build_script_build-8fc48382f1c0e540.4guj2qix1y89738.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "D:\workstation\expo\rust\gzbdb\target\debug\deps" "-L" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib" "-Wl,--start-group" "-Wl,-Bstatic" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libstd-8394c9398cbadee5.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libpanic_unwind-886e4f572a6d227c.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libobject-17cf826d0f7d2ed3.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libaddr2line-0dad5a98c26b9739.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libgimli-dfab679e0565d217.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_demangle-9f6866b4336a1d1c.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libhashbrown-81ade66b9e4c9cd5.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_std_workspace_alloc-4149a301273ebf0c.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libunwind-738a3de7ad0cd3a3.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libcfg_if-06d418ce9254f841.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\liblibc-7c3291a8d67347b3.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\liballoc-9f2b7229edc9025e.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_std_workspace_core-4ae0cac901a4e3c1.rlib" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libcore-9e39cfd0b85a4b6e.rlib" "-Wl,--end-group" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\libcompiler_builtins-de70f57e5c136950.rlib" "-Wl,-Bdynamic" "-ladvapi32" "-lws2_32" "-luserenv" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "C:\ProgramData\chocolatey\lib\rust\tools\lib\rustlib\x86_64-pc-windows-gnu\lib\rsend.o" = note: c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_eh collect2.exe: error: ld returned 1 exit status

error: aborting due to previous error

error: build failed `

gzbakku commented 3 years ago

without mingw and only with perl installed i get this error

Compiling winapi-x86_64-pc-windows-gnu v0.4.0 Compiling winapi v0.3.9 Compiling proc-macro2 v1.0.26 Compiling libc v0.2.93 Compiling cc v1.0.67 Compiling unicode-xid v0.2.1 Compiling log v0.4.14 Compiling syn v1.0.69 Compiling pkg-config v0.3.19 Compiling ntapi v0.3.6 Compiling scopeguard v1.1.0 Compiling smallvec v1.6.1 Compiling memchr v2.3.4 Compiling once_cell v1.7.2 Compiling bitflags v1.2.1 Compiling pin-project-lite v0.2.6 Compiling foreign-types-shared v0.1.1 Compiling bytes v1.0.1 Compiling openssl v0.10.33 Compiling byteorder v1.4.3 Compiling md5 v0.7.0 Compiling instant v0.1.9 Compiling tokio v1.5.0 Compiling openssl-src v111.15.0+1.1.1k Compiling lock_api v0.4.3 Compiling foreign-types v0.3.2 Compiling gobject v0.1.0 (D:\workstation\expo\rust\gzbdb\gobject) Compiling num_cpus v1.13.0 Compiling openssl-sys v0.9.61 Compiling quote v1.0.9 error: failed to run custom build command foropenssl-sys v0.9.61`

Caused by: process didn't exit successfully: D:\workstation\expo\rust\gzbdb\target\debug\build\openssl-sys-d180fd2df8d9b33b\build-script-main (exit code: 101) --- stdout cargo:rustc-cfg=const_fn cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_NO_VENDOR X86_64_PC_WINDOWS_GNU_OPENSSL_NO_VENDOR unset cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR OPENSSL_NO_VENDOR unset CC_x86_64-pc-windows-gnu = None CC_x86_64_pc_windows_gnu = None HOST_CC = None CC = None CFLAGS_x86_64-pc-windows-gnu = None CFLAGS_x86_64_pc_windows_gnu = None HOST_CFLAGS = None CFLAGS = None CRATE_CC_NO_DEFAULTS = None DEBUG = Some("true") CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") running "perl" "./Configure" "--prefix=/D/workstation/expo/rust/gzbdb/target/debug/build/openssl-sys-683edcc6cbafba72/out/openssl-build/install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "mingw64" "-O2" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64" "-Wa,-mbig-obj" Configuring OpenSSL version 1.1.1k (0x101010bfL) for mingw64 Using os-specific seed configuration

--- stderr


This perl implementation doesn't produce Unix like paths (with forward slash directory separators). Please use an implementation that matches your building platform.

This Perl version: 5.32.1 for MSWin32-x64-multi-thread


thread 'main' panicked at '

Error configuring OpenSSL build: Command: "perl" "./Configure" "--prefix=/D/workstation/expo/rust/gzbdb/target/debug/build/openssl-sys-683edcc6cbafba72/out/openssl-build/install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "mingw64" "-O2" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64" "-Wa,-mbig-obj" Exit status: exit code: 255

  ', C:\Users\tejas\.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.15.0+1.1.1k\src\lib.rs:471:13

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: build failed `

gzbakku commented 3 years ago

i am on windows os and i am pretty sure my default tools chain is windows msvc so shouldn't it just use vcpkg by default

gzbakku commented 3 years ago

i figured it out thanks previously i installed rust with chocolatey on windows it defaulted to gnu tool chain for some reason, now i used rustup to reinstall all of the rust all over again now it seems to be working your work is awesome.