# Error: failed to run custom build command for \`ring v0.14.6 ...\`

**URL:** <https://forum.scrt.network/t/error-failed-to-run-custom-build-command-for-ring-v0-14-6/1077>\
**Category:** Developer Help\
**Created:** [August 26, 2019, 9:36am UTC](https://forum.scrt.network/t/error-failed-to-run-custom-build-command-for-ring-v0-14-6/1077 "2019-08-26T09:36:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nioni](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/nioni/32/327_2.png) [@nioni](https://forum.scrt.network/u/nioni)\
**Post date:** [August 26, 2019, 9:36am UTC](https://forum.scrt.network/t/error-failed-to-run-custom-build-command-for-ring-v0-14-6/1077/1 "2019-08-26T09:36:29Z")

</div>

I believe the culprit is [here](https://github.com/nionis/enigma-secret-contract-identity/blob/master/secret_contracts/demonstration/Cargo.toml#L8).  
I am wondering whether somebody else had a similar issue.

> **terminal output**
>
> Compiling Secret Contract “demonstration”…  
> Compiling ring v0.14.6 ([https://github.com/elichai/ring.git?rev=sgx-0.14.6#1454e91f](https://github.com/elichai/ring.git?rev=sgx-0.14.6#1454e91f))  
> Compiling syn v1.0.5  
> Compiling syn v0.15.44  
> Compiling fixed-hash v0.2.5  
> error: failed to run custom build command for `ring v0.14.6 (https://github.com/elichai/ring.git?rev=sgx-0.14.6#1454e91f)`
> 
> Caused by:  
> process didn’t exit successfully: `/home/nioni/Documents/work/enigma-identity/secret_contracts/demonstration/target/release/build/ring-0d086a7a10b6132f/build-script-build` (exit code: 101)  
> — stdout  
> AMD\_ENTRYPOINT: vs/server/remoteExtensionHostProcess  
> CARGO: /home/nioni/.rustup/toolchains/nightly-2019-05-20-x86\_64-unknown-linux-gnu/bin/cargo  
> CARGO\_CFG\_DEBUG\_ASSERTIONS:  
> CARGO\_CFG\_PROC\_MACRO:  
> CARGO\_CFG\_TARGET\_ARCH: wasm32  
> CARGO\_CFG\_TARGET\_ENDIAN: little  
> CARGO\_CFG\_TARGET\_ENV:  
> CARGO\_CFG\_TARGET\_HAS\_ATOMIC: 16,32,64,8,cas,ptr  
> CARGO\_CFG\_TARGET\_OS: unknown  
> CARGO\_CFG\_TARGET\_POINTER\_WIDTH: 32  
> CARGO\_CFG\_TARGET\_VENDOR: unknown  
> CARGO\_FEATURE\_DEFAULT: 1  
> CARGO\_FEATURE\_DEV\_URANDOM\_FALLBACK: 1  
> CARGO\_FEATURE\_USE\_HEAP: 1  
> CARGO\_HOME: /home/nioni/.cargo  
> CARGO\_MAKEFLAGS: --jobserver-fds=3,4 -j --jobserver-auth=3,4 -j  
> CARGO\_MANIFEST\_DIR: /home/nioni/.cargo/git/checkouts/ring-8edb69512cc299ec/1454e91  
> CARGO\_MANIFEST\_LINKS: ring-asm  
> CARGO\_PKG\_AUTHORS: Brian Smith [brian@briansmith.org](mailto:brian@briansmith.org)  
> CARGO\_PKG\_DESCRIPTION: Safe, fast, small crypto using Rust.  
> CARGO\_PKG\_HOMEPAGE:  
> CARGO\_PKG\_NAME: ring  
> CARGO\_PKG\_REPOSITORY: [https://github.com/briansmith/ring](https://github.com/briansmith/ring)  
> CARGO\_PKG\_VERSION: 0.14.6  
> CARGO\_PKG\_VERSION\_MAJOR: 0  
> CARGO\_PKG\_VERSION\_MINOR: 14  
> CARGO\_PKG\_VERSION\_PATCH: 6  
> CARGO\_PKG\_VERSION\_PRE:  
> COLORTERM: truecolor  
> DBUS\_SESSION\_BUS\_ADDRESS: unix:path=/run/user/1000/bus  
> DEBUG: false  
> DOCKER\_HOST: 127.0.0.1:2375  
> HOME: /home/nioni  
> HOST: x86\_64-unknown-linux-gnu  
> LANG: en\_US.UTF-8  
> LC\_ADDRESS: el\_CY.UTF-8  
> LC\_IDENTIFICATION: el\_CY.UTF-8  
> LC\_MEASUREMENT: el\_CY.UTF-8  
> LC\_MONETARY: el\_CY.UTF-8  
> LC\_NAME: el\_CY.UTF-8  
> LC\_NUMERIC: el\_CY.UTF-8  
> LC\_PAPER: el\_CY.UTF-8  
> LC\_TELEPHONE: el\_CY.UTF-8  
> LC\_TIME: el\_CY.UTF-8  
> LD\_LIBRARY\_PATH: /home/nioni/Documents/work/enigma-identity/secret\_contracts/demonstration/target/release/deps:/home/nioni/.rustup/toolchains/nightly-2019-05-20-x86\_64-unknown-linux-gnu/lib:/home/nioni/.rustup/toolchains/nightly-2019-05-20-x86\_64-unknown-linux-gnu/lib  
> LESSCLOSE: /usr/bin/lesspipe %s %s  
> LESSOPEN: | /usr/bin/lesspipe %s  
> LOGNAME: nioni  
> LS\_COLORS: rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:_.tar=01;31:_.tgz=01;31:_.arc=01;31:_.arj=01;31:_.taz=01;31:_.lha=01;31:_.lz4=01;31:_.lzh=01;31:_.lzma=01;31:_.tlz=01;31:_.txz=01;31:_.tzo=01;31:_.t7z=01;31:_.zip=01;31:_.z=01;31:_.dz=01;31:_.gz=01;31:_.lrz=01;31:_.lz=01;31:_.lzo=01;31:_.xz=01;31:_.zst=01;31:_.tzst=01;31:_.bz2=01;31:_.bz=01;31:_.tbz=01;31:_.tbz2=01;31:_.tz=01;31:_.deb=01;31:_.rpm=01;31:_.jar=01;31:_.war=01;31:_.ear=01;31:_.sar=01;31:_.rar=01;31:_.alz=01;31:_.ace=01;31:_.zoo=01;31:_.cpio=01;31:_.7z=01;31:_.rz=01;31:_.cab=01;31:_.wim=01;31:_.swm=01;31:_.dwm=01;31:_.esd=01;31:_.jpg=01;35:_.jpeg=01;35:_.mjpg=01;35:_.mjpeg=01;35:_.gif=01;35:_.bmp=01;35:_.pbm=01;35:_.pgm=01;35:_.ppm=01;35:_.tga=01;35:_.xbm=01;35:_.xpm=01;35:_.tif=01;35:_.tiff=01;35:_.png=01;35:_.svg=01;35:_.svgz=01;35:_.mng=01;35:_.pcx=01;35:_.mov=01;35:_.mpg=01;35:_.mpeg=01;35:_.m2v=01;35:_.mkv=01;35:_.webm=01;35:_.ogm=01;35:_.mp4=01;35:_.m4v=01;35:_.mp4v=01;35:_.vob=01;35:_.qt=01;35:_.nuv=01;35:_.wmv=01;35:_.asf=01;35:_.rm=01;35:_.rmvb=01;35:_.flc=01;35:_.avi=01;35:_.fli=01;35:_.flv=01;35:_.gl=01;35:_.dl=01;35:_.xcf=01;35:_.xwd=01;35:_.yuv=01;35:_.cgm=01;35:_.emf=01;35:_.ogv=01;35:_.ogx=01;35:_.aac=00;36:_.au=00;36:_.flac=00;36:_.m4a=00;36:_.mid=00;36:_.midi=00;36:_.mka=00;36:_.mp3=00;36:_.mpc=00;36:_.ogg=00;36:_.ra=00;36:_.wav=00;36:_.oga=00;36:_.opus=00;36:_.spx=00;36:\*.xspf=00;36:  
> MAIL: /var/mail/nioni  
> NUM\_JOBS: 4  
> NVM\_BIN: /home/nioni/.nvm/versions/node/v11.15.0/bin  
> NVM\_CD\_FLAGS:  
> NVM\_DIR: /home/nioni/.nvm  
> OLDPWD: /home/nioni/Documents/work/enigma-identity/secret\_contracts/enigma-identity  
> OPT\_LEVEL: z  
> OUT\_DIR: /home/nioni/Documents/work/enigma-identity/secret\_contracts/demonstration/target/wasm32-unknown-unknown/release/build/ring-2232fcfaf7f4e023/out  
> PATH: /home/nioni/.cargo/bin:/home/nioni/.vscode-server/bin/f06011ac164ae4dc8e753a3fe7f9549844d15e35/bin:/home/nioni/.cargo/bin:/home/nioni/.nvm/versions/node/v11.15.0/bin:/home/nioni/.vscode-server/bin/f06011ac164ae4dc8e753a3fe7f9549844d15e35/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin  
> PIPE\_LOGGING: true  
> PROFILE: release  
> PWD: /home/nioni/Documents/work/enigma-identity  
> RUSTC: rustc  
> RUSTDOC: rustdoc  
> RUSTUP\_HOME: /home/nioni/.rustup  
> RUSTUP\_TOOLCHAIN: nightly-2019-05-20-x86\_64-unknown-linux-gnu  
> RUST\_RECURSION\_COUNT: 1  
> SHELL: /bin/bash  
> SHLVL: 1  
> SSH\_CLIENT: 172.17.137.177 51952 22  
> SSH\_CONNECTION: 172.17.137.177 51952 172.17.137.187 22  
> SSL\_CERT\_DIR: /usr/lib/ssl/certs  
> SSL\_CERT\_FILE: /usr/lib/ssl/certs/ca-certificates.crt  
> TARGET: wasm32-unknown-unknown  
> TERM: xterm-256color  
> TERM\_PROGRAM: vscode  
> TERM\_PROGRAM\_VERSION: 1.37.1  
> USER: nioni  
> VERBOSE\_LOGGING: true  
> VSCODE\_IPC\_HOOK\_CLI: /tmp/vscode-ipc-74174feb-f62a-4cb0-8ec7-fac08e076d47.sock  
> XDG\_DATA\_DIRS: /usr/local/share:/usr/share:/var/lib/snapd/desktop  
> XDG\_RUNTIME\_DIR: /run/user/1000  
> XDG\_SESSION\_CLASS: user  
> XDG\_SESSION\_ID: 4  
> XDG\_SESSION\_TYPE: tty  
> \_: /home/nioni/.nvm/versions/node/v11.15.0/bin/discovery
> 
> — stderr  
> thread ‘main’ panicked at ‘called `Option::unwrap()` on a `None` value’, src/libcore/option.rs:347:21  
> note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
> 
> warning: build failed, waiting for other jobs to finish…  
> error: build failed  
> Something went wrong compiling secret contract demonstration, aborting.  
> (node:26059) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, copyfile ‘/home/nioni/Documents/work/enigma-identity/secret\_contracts/demonstration/target/wasm32-unknown-unknown/release/contract.wasm’ -\> ‘/home/nioni/Documents/work/enigma-identity/build/secret\_contracts/demonstration.wasm’  
> at Object.copyFileSync (fs.js:1743:3)  
> at Object.module.exports.compile (/home/nioni/.nvm/versions/node/v11.15.0/lib/node\_modules/@enigmampc/discovery-cli/src/deps.js:139:8)  
> at processTicksAndRejections (internal/process/task\_queues.js:86:5)  
> (node:26059) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)  
> (node:26059) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

---

<div class="post-metadata">

**Author:** ![laura](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/laura/32/911_2.png) [@laura](https://forum.scrt.network/u/laura)\
**Post date:** [August 29, 2019, 12:25am UTC](https://forum.scrt.network/t/error-failed-to-run-custom-build-command-for-ring-v0-14-6/1077/2 "2019-08-29T00:25:03Z")

</div>

I’m seeing the same thing @nioni. I can’t figure it out :-P. I see how you’re trying to use the enigma-crypto interface in your demonstration code. Pretty cool. I’ll follow-up with the team tomorrow to see if we can resolve this!

---

<div class="post-metadata">

**Author:** ![laura](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/laura/32/911_2.png) [@laura](https://forum.scrt.network/u/laura)\
**Post date:** [September 7, 2019, 4:35pm UTC](https://forum.scrt.network/t/error-failed-to-run-custom-build-command-for-ring-v0-14-6/1077/3 "2019-09-07T16:35:37Z")

</div>

@nioni I was able to resolve the build error by making a modification to the enigma-crypto dependency in your `Cargo.toml` file. I used the example Enigma **encryption** _secret contract_ as a reference to try to fix your build error: [https://github.com/enigmampc/enigma-core/tree/develop/examples/eng\_wasm\_contracts/encryption](https://github.com/enigmampc/enigma-core/tree/develop/examples/eng_wasm_contracts/encryption)

```auto
enigma-crypto = { git = "https://github.com/enigmampc/enigma-core.git", default-features = false, features = ["asymmetric", "hash"] }

```

And in your `lib.rs` I used `eng_wasm::generate_key()` instead of `KeyPair::new()` to generate the random encryption key. Then used `KeyPair::from_slice(...)` to create the `KeyPair`.

The modified _demonstration_ _secret contract_ looks like this:

```auto
pub struct Contract;
impl ContractInterface for Contract {
  fn construct() -> () {
    write_state!(STATE => State {
      private_key: generate_key(),
      nonce: U256::from(0)
    });
  }

  fn get_public_key() -> String {
    let private_key = Self::get_state().private_key;
    let key_pair = KeyPair::from_slice(&private_key).unwrap();
    let public_key = key_pair.get_pubkey();

    return public_key.to_hex::<String>();
  }

  fn get_nonce() -> U256 {
    return Self::get_state().nonce;
  }
}

```

I wasn’t able to get it to build using `KeyPair::new()` like you had because that’s only available for SGX environments.

---

<div class="post-metadata">

**Author:** ![nioni](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/nioni/32/327_2.png) [@nioni](https://forum.scrt.network/u/nioni)\
**Post date:** [September 7, 2019, 5:06pm UTC](https://forum.scrt.network/t/error-failed-to-run-custom-build-command-for-ring-v0-14-6/1077/4 "2019-09-07T17:06:43Z")

</div>

Thank you for helping out again!, my bad for not following the example.  
I got a little bit confused because on the docs.rs for `eng_wasm` I couldn’t find `generate_key`, and I thought it was something still in development.

---

<div class="post-metadata">

**Author:** ![laura](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/laura/32/911_2.png) [@laura](https://forum.scrt.network/u/laura)\
**Post date:** [September 7, 2019, 5:19pm UTC](https://forum.scrt.network/t/error-failed-to-run-custom-build-command-for-ring-v0-14-6/1077/5 "2019-09-07T17:19:43Z")

</div>

No problem! Glad to help 😃

---

<div class="post-metadata">

**Author:** ![arookie](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/arookie/32/845_2.png) [@arookie](https://forum.scrt.network/u/arookie)\
**Post date:** [September 9, 2019, 6:39am UTC](https://forum.scrt.network/t/error-failed-to-run-custom-build-command-for-ring-v0-14-6/1077/6 "2019-09-09T06:39:18Z")

</div>

hi @nioni the docs maybe built failed but i can find the source [here](https://docs.rs/crate/eng-wasm/0.1.4/source/src/crypto_wasm.rs)

hi @ainsley the `eng_wasm` ver 0.1.4 built failed already. Can you guys take a look?

 ![Screenshot_1](https://canada1.discourse-cdn.com/flex035/uploads/enigma1/original/1X/60b09a51c766c97f172837b0e32fdaa6dec45349.png)

---

<div class="post-metadata">

**Author:** ![ainsley](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/ainsley/32/73_2.png) [@ainsley](https://forum.scrt.network/u/ainsley)\
**Post date:** [September 16, 2019, 7:49pm UTC](https://forum.scrt.network/t/error-failed-to-run-custom-build-command-for-ring-v0-14-6/1077/7 "2019-09-16T19:49:16Z")

</div>

Just checking in on this-- is this issue still open, or were you able to resolve @nioni ?

---

<div class="post-metadata">

**Author:** ![nioni](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/nioni/32/327_2.png) [@nioni](https://forum.scrt.network/u/nioni)\
**Post date:** [September 17, 2019, 12:41pm UTC](https://forum.scrt.network/t/error-failed-to-run-custom-build-command-for-ring-v0-14-6/1077/8 "2019-09-17T12:41:14Z")

</div>

Yes! thank you @laura 🙂

I’ve had to make some small changes to [cargo.toml](https://github.com/nionis/enigma-secret-contract-identity/commit/9d41766e44bad5b6193b466372c17f333c7145c3#diff-dece97216e3beeb22350834f6824d3af).

Versions have to be exactly 0.1.4 hence the `= 0.1.4` or else `generate_key()` is not available.
