Typenum build failure

Hi, I encountered a typenum build failure when building mobilecoind under release (cargo build --release). It appears to be a problem with MacBook Pro Mid-2012, as I get the same problem building on MacOS Mojave and Ubuntu 20.04 on two separate machines (both are MacPro mid-2012). Unfortunately I am not a Rust developer and do not know how to create a minimum example of the failure.

Here is the output:

koe@koe-comp:~/Documents/Crypto Apps/mobilecoin-1.0.1$ cargo build --release
warning: Patch `dialoguer v0.6.2 (https://github.com/mitsuhiko/dialoguer?rev=a0c6c1e#a0c6c1e0)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
   Compiling libloading v0.5.2
   Compiling ring v0.16.13
   Compiling clear_on_drop v0.2.4
   Compiling mbedtls v0.5.1 (https://github.com/mobilecoinofficial/rust-mbedtls.git?tag=mc-0.3#8cac1fd1)
   Compiling typenum v1.12.0
   Compiling mc-sgx-panic-edl v1.0.0 (/home/koe/Documents/Crypto Apps/mobilecoin-1.0.1/sgx/panic-edl)
   Compiling mc-sgx-slog-edl v1.0.0 (/home/koe/Documents/Crypto Apps/mobilecoin-1.0.1/sgx/slog-edl)
   Compiling mc-sgx-debug-edl v1.0.0 (/home/koe/Documents/Crypto Apps/mobilecoin-1.0.1/sgx/debug-edl)
error: failed to run custom build command for `typenum v1.12.0`

Caused by:
  process didn't exit successfully: `/home/koe/Documents/Crypto Apps/mobilecoin-1.0.1/target/release/build/typenum-a39b42f73832d3b0/build-script-main` (signal: 4, SIGILL: illegal instruction)
--- stdout
cargo:rustc-env=TYPENUM_BUILD_CONSTS=/home/koe/Documents/Crypto Apps/mobilecoin-1.0.1/target/release/build/typenum-05bb0498988d0983/out/consts.rs

warning: build failed, waiting for other jobs to finish...
error: build failed

Note: I cut out a lot of the Compiling ... lines.

I encountered different errors while compiling without --release, but will leave them out for now unless requested, as they do not appear related.

My questions:

  • Is it a problem with my hardware?
  • Can I solve it?

UPDATE: I cloned the typenum repo and ran cargo build and also cargo build --release. Both succeeded.

MobileCoin's .cargo/config has this setting:

rustflags = ["-D", "warnings", "-C", "target-cpu=skylake"]

Removing the reference to skylake fixed my problem:

rustflags = ["-D", "warnings"]
1 Like