Openssl build issue


#1

Hi Rust,

I have been having an issue since coming back to do some rusty things and getting version 1.3. I tried deleting my cached crates and cleaning the solution, but I am not sure what to do next. My dependencies are iron and router.

C:\Git\Git\RustEC2Test>cargo build
Compiling openssl-sys v0.6.6
failed to run custom build command for openssl-sys v0.6.6
Process didn’t exit successfully: C:\Git\Git\RustEC2Test\target\debug\build\ope nssl-sys-33c3e25c3677ea5c\build-script-build (exit code: 101)
— stdout
cargo:rustc-link-lib=dylib=ssl32
cargo:rustc-link-lib=dylib=eay32
TARGET = Some(“x86_64-pc-windows-gnu”)
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: “gcc” “-O0” “-ffunction-sections” “-fdata-sections” “-g” “-m64” “-o” “C
:\Git\Git\RustEC2Test\target\debug\build\openssl-sys-33c3e25c3677ea5c\ou
t\src\openssl_shim.o” “-c” “src/openssl_shim.c”

failed to execute command: The system cannot find the file specified.
(os error 2)
Is gcc not installed? (see https://github.com/alexcrichton/gcc-rs#compile-time
-requirements for help)


#2

it seems to me that you did either not install mingw or that openssl-sys cannot find the gcc that was installed by mingw.

The error message even hints that you might not have gcc installed.

You can find details on how to install the requirements here: https://github.com/sfackler/rust-openssl#windows


#3

I have mingw installed and this ran fine before I bumped up to v1.3 of the compiler. I was on 1.1. Are there any other details I could provide that might help? I would really like to continue working on this project!


#4

Funny that you should have a similar problem to mine with just a few hours between our stumbling on them even though they’re probably not related.


#5

does running “gcc” from the command prompt work?


#6

mingw command prompt works. Also If I start a new project without any crate dependencies I can build that without any issue. It seems to be related to iron/hyper crates. I installed 1.3 on a fresh VM and pulled the code down and it also ran fine. On my main development machine(s) however it has not worked since I moved to 1.3 from 1.1. I am not using nightlies.

Once added I cannot build even a hello world app anymore. Always fails at that “Compiling openssl-sys v0.6.6
failed to run custom build command for openssl-sys v0.6.6” part.


#7

gcc works? or the command prompt?

are you running cargo from the mingw command prompt?


#8

I just did a fresh install myself. Try running the following commands from your MSYS Mingw64_shell. It should work once they’ve all completed.

$ pacman -Sy pacman-mirrors

$ pacman -S mingw-w64-x86_64-toolchain

$ pacman -S base-devel

#9

by working I just mean I can ./helloworld.c and get it make an exe that prints hello world. Real exciting stuff. Sorry I have been working in an IDE that manages everything for so long I have forgotten how to communicate.

I use the rust shell to build/run rust with cargo. I had not tried doing it from mingw…I will see if that does anything.


#10

Still seeing:

Compiling openssl-sys v0.6.6
failed to run custom build command for openssl-sys v0.6.6
Process didn’t exit successfully: C:\Git\Git\RustEC2Test\target\debug\build\ope nssl-sys-33c3e25c3677ea5c\build-script-build (exit code: 101)
— stdout
cargo:rustc-link-lib=dylib=ssl32
cargo:rustc-link-lib=dylib=eay32
TARGET = Some(“x86_64-pc-windows-gnu”)
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: “gcc” “-O0” “-ffunction-sections” “-fdata-sections” “-g” “-m64” “-o” “C
:\Git\Git\RustEC2Test\target\debug\build\openssl-sys-33c3e25c3677ea5c\ou
t\src\openssl_shim.o” “-c” “src/openssl_shim.c”

I will try uninstalling 1.3 running those again and re-installing…and deleting .cargo in my user directory.


#11

can you show us the what you get if you type in this? gcc -v


#12

buncho junko:

me MINGW64 ~
$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/…/lib/gcc/x86_64-w64-mingw32/5.2.0/lt o-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: …/gcc-5.2.0/configure --prefix=/mingw64 --with-local-prefix=/m ingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_6 4-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/includ e --libexecdir=/mingw64/lib --with-gxx-include-dir=/mingw64/include/c++/5.2.0 – enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto ,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable -libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-v ersion-specific-runtime-libs --disable-isl-version-check --enable-lto --enable-l ibgomp --disable-multilib --enable-checking=release --disable-rpath --disable-wi n32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv – with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 – with-isl=/mingw64 --with-pkgversion=‘Rev4, Built by MSYS2 project’ --with-bugurl =http://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
gcc version 5.2.0 (Rev4, Built by MSYS2 project)


#13

The 32 bit versions do not find gcc…I recently installed code blocks and think this may be from that. If I remember setting up the first time there was a reason to install the 32 bit version of mingw not the 64 bit. Maybe this is my issue, but I am pretty sure I had built and run rusty apps using those cargo packages after installing code blocks. Maybe not however I will uninstall it, mingw, msys, and try to start over.