Skip to content
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

Building on MinGW32 fails #369

Open
alvaro-cuesta opened this issue May 28, 2016 · 12 comments
Open

Building on MinGW32 fails #369

alvaro-cuesta opened this issue May 28, 2016 · 12 comments

Comments

@alvaro-cuesta
Copy link

alvaro-cuesta commented May 28, 2016

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.

@PhilKershaw
Copy link

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.

@zoumi
Copy link

zoumi commented Jul 30, 2016

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

@jcbritobr
Copy link

I think gcc should be use as default also.

@nano3k0a
Copy link

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

@zoumi
Copy link

zoumi commented Oct 15, 2016

@rdrsss
Copy link

rdrsss commented Oct 20, 2016

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?

@hk-51
Copy link

hk-51 commented Nov 1, 2017

Setting envvar 'CC=gcc' fixes it,

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

@kpcyrd
Copy link

kpcyrd commented Nov 18, 2017

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.

@steelx
Copy link

steelx commented Aug 2, 2020

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

image

@newpavlov
Copy link

@steelx
Copy link

steelx commented Aug 3, 2020

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

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

@newpavlov
Copy link

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.

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

10 participants