Actix-web: error: failed to run custom build command for `ring v0.12.1`

Created on 11 Jul 2018  路  14Comments  路  Source: actix/actix-web

It looks like there is an issue with 64-bit builds, I got the error while running under cargo in IntelliJ IDEA, I also get the same error runing cargo build under VS 2015 or VS2017 developer prompt.

This happens when I add the following in Cargo.toml:

actix-web = "0.6.14"

and then attempt to use it in my main.rs file.

running: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\lib.exe" "/OUT:"xxx\cso-sim\target\debug\build\ring-56b8dfbbbf099336\out\libring-test.a" "/nologo" "xxx\cso-sim\target\debug\build\ring-56b8dfbbbf099336\out\constant_time_test.obj"
xxxcso-simtargetdebugbuildring-56b8dfbbbf099336outgeneric.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
exit code: 1112
exit code: 0
cargo:rustc-link-lib=static=ring-test

A search of the web shows this issue showing up repeatedly, but there is no solution that works for me as far as I can find.

Thanks for any help,
-Dave

wontfix

Most helpful comment

I'm also had issues compiling this version of ring with MSVC, so you may need to disable session feature for now like that:

[dependencies.actix-web]
git = "https://github.com/actix/actix-web"
default-features = false
features = ["flate2-c", "brotli"]

The /Qspectre is just warning, i think something wrong with ring cod there itself, but I never investigated since alpha version is already working for me

All 14 comments

Running with cargo -vv build, I see the following:

', ....cargoregistrysrcgithub.com-1ecc6299db9ec823gcc-0.3.54srclib.rs:1670:5
note: Run with RUST_BACKTRACE=1 for a backtrace.warning: unused imports: env, fs
--> ....cargoregistrysrcgithub.com-1ecc6299db9ec823actix-0.5.8build.rs:2:11
|
2 | use std::{env, fs};
| ^^^ ^^
|

= note: #[warn(unused_imports)] on by default

error: failed to run custom build command for ring v0.12.1

Looks like the file needs the following:

#[cfg(unix)]
use std::{env, fs};

If someone would please commit that fix, I would appreciate it, I am new to github.com, so I am not comfortable making that change at this point.

I still get the following when I try to build my application, even though I fixed the build issue in gcc-0.3.54srclib.rs:1670:5, I wonder if my build of actix-0.5.8 doesn't get used when I try to build my app?

fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
exit code: 1112

It seems there is a separate build issue in actix-web that is more obscure than the issue that I found in actix.

@crusty-dave
The problem is that you use bad MSVC environment.

The error like:

xxx\cso-sim\target\debug\build\ring-56b8dfbbbf099336\out\generic.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

Happens when you compiled something with for one target bitness, but you use linker with different bitness target.
You need to make sure that your enviornment allows you to build and link C code

you can also disable session feature

you can also disable session feature

I have no idea what the above means or how to do it?

Also, is anyone going to add the #[cfg(unix)] to the following line in actix-0.5.8build.rs?

use std::{env, fs};

Also, if the 64-bit issue is an issue with my environment, is there a description of how to setup MSVC to work correctly with cargo somewhere?

@crusty-dave I'm not sure how exactly are you using Rust + MSVC, but most likely your Rust compiler is x64 while MSVC is x32.

Since you're using IntelliJ IDEA I cannot really advise how to set it up correctly there as I work from console on windows

I have the same issue if I just run cargo build from an MSVX x64 Native Tools Command Prompt for VS 2017.

ecp_nistz256.c
curve25519.c
c:usersdweaver.cargoregistrysrcgithub.com-1ecc6299db9ec823ring-0.12.1cryptolimbslimbs.inl(128) : error C2220: warning treated as error - no 'object' file generated
c:usersdweaver.cargoregistrysrcgithub.com-1ecc6299db9ec823ring-0.12.1cryptolimbslimbs.inl(128) : warning C5045: Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
c:usersdweaver.cargoregistrysrcgithub.com-1ecc6299db9ec823ring-0.12.1cryptolimbslimbs.inl(127) : note: index 'i' range checked by comparison on this line
c:usersdweaver.cargoregistrysrcgithub.com-1ecc6299db9ec823ring-0.12.1cryptolimbslimbs.inl(128) : note: feeds call on this line
limbs.c
c:usersdweaver.cargoregistrysrcgithub.com-1ecc6299db9ec823ring-0.12.1cryptoconstant_time_test.c(208) : error C2220: warning treated as error - no 'object' file generated

I believe that is the first instance of an error in the build process. So perhaps it is related to the /Qspectre switch?

I'm also had issues compiling this version of ring with MSVC, so you may need to disable session feature for now like that:

[dependencies.actix-web]
git = "https://github.com/actix/actix-web"
default-features = false
features = ["flate2-c", "brotli"]

The /Qspectre is just warning, i think something wrong with ring cod there itself, but I never investigated since alpha version is already working for me

DoumanAsh, that seems to have worked, thank you very much!

FYI: the following seems to work as well:

actix-web = { version="^0.6", features=["flate2-rust"], default-features = false }

Was this page helpful?
0 / 5 - 0 ratings