rust-crypto icon indicating copy to clipboard operation
rust-crypto copied to clipboard

Building on MinGW32 fails

Open alvaro-cuesta opened this issue 9 years ago • 12 comments

error: failed to run custom build command for `rust-crypto v0.2.36`
Process didn't exit successfully: `C:\Users\kaoD\rustocin\target\debug\build\rust-crypto-0caf103d2b9a229d\build-script-build` (exit code: 101)
--- stdout
TARGET = Some("i686-pc-windows-gnu")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("i686-pc-windows-gnu")
debug=true opt-level=0
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: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-m32" "-o" "C:\\Users\\kaoD\\rustocin\\target\\debug\\build\\rust-crypto-0caf103d2b9a229d\\out\\src\\util_helpers.o" "-c" "src/util_helpers.c"


failed to execute command: El sistema no puede encontrar el archivo especificado. (os error 2)
Is `cc` not installed? (see https://github.com/alexcrichton/gcc-rs#compile-time-requirements for help)

According to the link in the error message gcc-rs should be using gcc under my system. This hardcoded "cc" in build.rs seems to be the problem.

Setting envvar CC=gcc fixes it, but AFAICT it probably should use the default gcc-rs strategy for that else branch.

alvaro-cuesta avatar May 28 '16 13:05 alvaro-cuesta

This is not so much a bug as a missing dependency. I was experiencing the same problem but a little searching around the web pointed me towards installing this:

http://win-builds.org/doku.php/download_and_installation_from_windows

Also ensure the 'bin' directory residing within the installation path is present in your PATH - as usual - and away you go. You'll find 'cc.exe' within the bin directory.

PhilKershaw avatar Jun 01 '16 11:06 PhilKershaw

I'm suffering from this error too.Thanks for the tip:"Setting envvar CC=gcc fixes it."@alvaro-cuesta.

zoumi avatar Jul 30 '16 14:07 zoumi

I think gcc should be use as default also.

jcbritobr avatar Sep 14 '16 01:09 jcbritobr

How do I set the envvar CC=gcc under Windows 7/8.1/10???

nano3k0a avatar Oct 14 '16 16:10 nano3k0a

http://www.computerhope.com/issues/ch000549.htm @Trodis

zoumi avatar Oct 15 '16 00:10 zoumi

Yep, just hit this problem myself on Windows 10. I'll set the env var for now, is there a proper fix coming for this?

rdrsss avatar Oct 20 '16 04:10 rdrsss

Setting envvar 'CC=gcc' fixes it,

@alvaro-cuesta What does it means? How can I do it too?

hk-51 avatar Nov 01 '17 10:11 hk-51

I ran across this problem in appveyor, where CC doesn't seem to be available with TARGET=x86_64-pc-windows-gnu. I found the solution in the appveyor.yml of this project:

environment:
  matrix:
    - TARGET: nightly-x86_64-pc-windows-msvc
    - TARGET: nightly-x86_64-pc-windows-gnu
      MSYS_BITS: 64
  [...]
install:
[...]
- if defined MSYS_BITS set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH%

In thise file, every mingw build has MSYS_BITS defined which adds the mingw bin folder to the PATH prior to starting the build. This fixes the mingw build without breaking the -msvc builds.

kpcyrd avatar Nov 18 '17 03:11 kpcyrd

how do you set cc=gcc ? what does it mean. I have installed migwin. nothing resolved after.

image

steelx avatar Aug 02 '20 17:08 steelx

@steelx https://rustsec.org/advisories/RUSTSEC-2016-0005.html

newpavlov avatar Aug 02 '20 18:08 newpavlov

@steelx https://rustsec.org/advisories/RUSTSEC-2016-0005.html

I'm using openssl. And internally it uses this it seems

steelx avatar Aug 03 '20 01:08 steelx

No, OpenSSL does not use rust-crypto, neither the other way around. If you have issues with OpenSSL bindings try asking in respective repositories, e.g. in https://github.com/sfackler/rust-openssl.

newpavlov avatar Aug 03 '20 01:08 newpavlov