initc3 / HoneyBadgerMPC

Robust MPC-based confidentiality layer for blockchains
GNU General Public License v3.0
131 stars 64 forks source link

[rust/python] Building pairing lib fails #400

Closed sbellem closed 4 years ago

sbellem commented 4 years ago

pip install pairing/ currently fails. See below for the error output. The current quickest solution is to "pin" the nightly build to a recent working version such as nightly-2019-11-15. But it would be useful to figure out a better solution for the near future.

Some observations

It may be useful to try to stay up-to-date with pyo3 as they are fixing issues arising from changes to rust (e.g.: https://github.com/PyO3/pyo3/pull/615).

https://github.com/initc3/HoneyBadgerMPC/blob/350bfb1cf49491b5d9e40cc5c3140468fa699d68/pairing/Cargo.toml#L25-L26

Error ouput

   error[E0277]: the trait bound `(): err::PyErrArguments` is not satisfied
       --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/pyo3-0.4.1/src/err.rs:521:64
        |                                       
    521 |                 PyErr::from_value::<$pyexc>(PyErrValue::ToArgs(Box::new(err)))
        |                                                                ^^^^^^^^^^^^^ the trait `err::PyErrArguments` is not implemented for `()`
    ...
    590 | impl_to_pyerr!(std::string::ParseError, exc::ValueError);
        | --------------------------------------------------------- in this macro invocation
        |
        = note: required for the cast to the object type `dyn err::PyErrArguments`

    error: aborting due to previous error

    For more information about this error, try `rustc --explain E0277`.
    error: could not compile `pyo3`.

    Caused by:
      process didn't exit successfully: `rustc --crate-name pyo3 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/pyo3-0.4.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib -$
emit=dep-info,metadata,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="extension-module"' --cfg 'feature="python3"' -C metadata=b089b812af986789 -C extra-filename=-b089b812af986789 --out-dir /tmp/p$
p-req-build-yo95jaug/target/release/deps -L dependency=/tmp/pip-req-build-yo95jaug/target/release/deps --extern libc=/tmp/pip-req-build-yo95jaug/target/release/deps/liblibc-ece9f5f930b9fd9d.rmeta --extern mashup$
/tmp/pip-req-build-yo95jaug/target/release/deps/libmashup-48758ebfb5c58490.rmeta --extern num_traits=/tmp/pip-req-build-yo95jaug/target/release/deps/libnum_traits-b0dd93ee395f6cf5.rmeta --extern pyo3cls=/tmp/pip$
req-build-yo95jaug/target/release/deps/libpyo3cls-6df868f4459d33ee.so --extern spin=/tmp/pip-req-build-yo95jaug/target/release/deps/libspin-d13fc50bbaccbbf3.rmeta --cap-lints allow --cfg Py_3_5 --cfg Py_3_6 --cf$
 Py_3_7 --cfg Py_3 --cfg 'py_sys_config="WITH_THREAD"'` (exit code: 1)
    warning: build failed, waiting for other jobs to finish...
    error: build failed
    error: cargo failed with code: 101

TODO

sbellem commented 4 years ago

Closing as PR #401 pins down rust to a nightly build that works and issue #404 will be used to work on upgrading to a more recent version of PyO3.