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

Unable to build #163

Closed
FudiHub opened this issue Feb 14, 2021 · 10 comments · Fixed by #166
Closed

Unable to build #163

FudiHub opened this issue Feb 14, 2021 · 10 comments · Fixed by #166

Comments

@FudiHub
Copy link

FudiHub commented Feb 14, 2021

Hi

I get several errors building.

error: aborting due to 43 previous errors

Some errors have detailed explanations: E0034, E0308.
For more information about an error, try `rustc --explain E0034`.
error: could not compile `bitvec`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

VSC also shows me
could not compile 'ff' in Cargo.toml

What am I doing wrong or is there a known issue right now?

@notdanilo
Copy link
Contributor

notdanilo commented Feb 15, 2021

Hi @FudiHub! Can you provide us a fully detailed log?

What's your OS and what command are you using to build it?

I just ran cargo build --release on a clean copy of the repository and it compiled fine on Ubuntu.

@FudiHub
Copy link
Author

FudiHub commented Feb 15, 2021

Hi @notdanilo

What's your OS and what command are you using to build it?

I am on MacOS 11.2.1. I built with cargo build or cargo build --release. I tried on Ubuntu 20.04 as well.

This is the complete output:
full_log.txt

Thanks for your help

@notdanilo
Copy link
Contributor

Hi @FudiHub, I was able to replicate the issue.

I am already working on it. And I will also add macOS, Ubuntu, and Windows environments in our CI checks so it will never happen again.

Thanks for reporting it!

@FudiHub
Copy link
Author

FudiHub commented Feb 16, 2021

Hi @notdanilo

thats great news. Thanks. Maybe you are so kind to look into this issue as well? nash-io/openlimits-python#6
I have similar issues with nash-io/openlimits-python

Thanks!!

@notdanilo notdanilo linked a pull request Feb 17, 2021 that will close this issue
@notdanilo
Copy link
Contributor

I just tracked it down to ferrilab/bitvec#105, which is really bad because we have 3 dependency layers above bitvec (elliptic-cursve -> ecdsa -> k256).

funty v1.2.0
└── bitvec v0.18.4
    ├── elliptic-curve v0.6.6
    │   ├── ecdsa v0.8.5
    │   │   ├── k256 v0.5.10
    │   │   │   ├── nash-mpc v1.2.0
    │   │   │   │   └── nash-protocol v0.1.24
    │   │   │   │       ├── nash-native-client v0.1.18
    │   │   │   │       │   └── openlimits v0.1.9-alpha.0 (/home/notdanilo/dev/nash-io/openlimits)

@Bi0max
Copy link

Bi0max commented Feb 19, 2021

I just tracked it down to bitvecto-rs/bitvec#105, which is really bad because we have 3 dependency layers above bitvec (elliptic-cursve -> ecdsa -> k256).

funty v1.2.0
└── bitvec v0.18.4
    ├── elliptic-curve v0.6.6
    │   ├── ecdsa v0.8.5
    │   │   ├── k256 v0.5.10
    │   │   │   ├── nash-mpc v1.2.0
    │   │   │   │   └── nash-protocol v0.1.24
    │   │   │   │       ├── nash-native-client v0.1.18
    │   │   │   │       │   └── openlimits v0.1.9-alpha.0 (/home/notdanilo/dev/nash-io/openlimits)

Hi, I have completely same error, when I try to compile openlimits-python version. Commented in the relevant issue for openlimits-python: nash-io/openlimits-python#6 (comment)

I tried to use a workaround from the issue, which you mentioned:

Version 1.1.0 of funty works fine, so as a temporary workaround, add funty = "=1.1.0" to your Cargo.toml

But then another compilation error comes up (this has to do with Windows 10 it seems, cause the problem is exe file):

error: linking with `link.exe` failed: exit code: 1181
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.rust_bigint.1r2rcqiy-cgu.0.rcgu.o" "D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.rust_bigint.1r2rcqiy-cgu.1.rcgu.o" "D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.rust_bigint.1r2rcqiy-cgu.2.rcgu.o" "D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.rust_bigint.1r2rcqiy-cgu.3.rcgu.o" "D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.rust_bigint.1r2rcqiy-cgu.4.rcgu.o" "D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.rust_bigint.1r2rcqiy-cgu.5.rcgu.o" "D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.rust_bigint.1r2rcqiy-cgu.6.rcgu.o" "D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.rust_bigint.1r2rcqiy-cgu.7.rcgu.o" "D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.rust_bigint.1r2rcqiy-cgu.8.rcgu.o" "D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.rust_bigint.1r2rcqiy-cgu.9.rcgu.o" "/OUT:D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.dll" "/DEF:C:\\Users\\Maksim\\AppData\\Local\\Temp\\rustcZx9RWJ\\lib.def" "D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.6mbwwervjv7egvn.rcgu.o" "/OPT:REF,ICF" "/DLL" "/IMPLIB:D:\\projects\\openlimits-python\\target\\release\\deps\\rust_bigint-65779a50273e1b45.dll.lib" "/DEBUG" "/NATVIS:C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis" "/LIBPATH:D:\\projects\\openlimits-python\\target\\release\\deps" "/LIBPATH:C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "D:\\projects\\openlimits-python\\target\\release\\deps\\libgmp-8b2b84ab5bc172b6.rlib" "D:\\projects\\openlimits-python\\target\\release\\deps\\libserde_json-8af80e3b2b49719e.rlib" "D:\\projects\\openlimits-python\\target\\release\\deps\\libryu-7da1ebb8cb9af05d.rlib" "D:\\projects\\openlimits-python\\target\\release\\deps\\libitoa-fad439af08f0b7f1.rlib" "D:\\projects\\openlimits-python\\target\\release\\deps\\libnum_traits-cc43d31f871a8803.rlib" "D:\\projects\\openlimits-python\\target\\release\\deps\\liblibc-6c727d59dafdc48e.rlib" "D:\\projects\\openlimits-python\\target\\release\\deps\\libgetrandom-3373fb1627761087.rlib" "D:\\projects\\openlimits-python\\target\\release\\deps\\libcfg_if-bf3560479882f214.rlib" "D:\\projects\\openlimits-python\\target\\release\\deps\\libserde-1099beba1cb6bc59.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-0087fff1d6c84113.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-e9a9adcb7b282f86.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-c17bc77d789f8359.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-1f739c53c46039b3.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-b12f9afb50af9e82.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-4813d8391ae0f1e1.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-a6dfd598b03abbd4.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-8e04de9ca6363561.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-05126e82a7fe403c.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-7f3e1ef8417012fa.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-df80c014103f27c5.rlib" "C:\\Users\\Maksim\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-f404d34c325d6d79.rlib" "gmp.lib" "gmp.lib" "gmp.lib" "gmp.lib" "gmp.lib" "bcrypt.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
  = note: LINK : fatal error LNK1181: cannot open input file 'gmp.lib'



error: aborting due to previous error


error: could not compile `rust-bigint`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
💥 maturin failed
  Caused by: Failed to build a native library through cargo
  Caused by: Cargo build finished with "exit code: 101": `cargo rustc --message-format json --manifest-path Cargo.toml --release --lib --`

@notdanilo
Copy link
Contributor

@Bi0max hi! The fix for the funty issue is being delivered soon. Regarding the missing gmp.lib file, I just faced it myself when setting up the automated checks for Windows. Please check these links:

ZenGo-X/kms-secp256k1#25
https://github.com/vhnatyk/gmp-release

I will add proper documentation describing this pre-req.

@khigia
Copy link

khigia commented Feb 21, 2021

Hi, sorry, I missed the previous comment ... created #168 to avoid issue with funty.

@Bi0max
Copy link

Bi0max commented Feb 24, 2021

@Bi0max hi! The fix for the funty issue is being delivered soon. Regarding the missing gmp.lib file, I just faced it myself when setting up the automated checks for Windows. Please check these links:

ZenGo-X/kms-secp256k1#25
https://github.com/vhnatyk/gmp-release

I will add proper documentation describing this pre-req.

@notdanilo, thank you for the hint. I managed to install 32-bit version of GMP from the link you provided.
But now I get another compilation error (both on Windows 10 and in Linux Container rust:latest):

 maturin build --release
   Compiling pyo3 v0.12.4
   Compiling proc-macro2 v1.0.24
   Compiling typenum v1.12.0
   Compiling winapi v0.3.9
   Compiling libc v0.2.86
   Compiling memchr v2.3.4
   Compiling tokio v1.2.0
   Compiling crossbeam-utils v0.8.2
   Compiling memoffset v0.6.1
   Compiling miniz_oxide v0.4.3
   Compiling indexmap v1.6.1
   Compiling num-integer v0.1.44
   Compiling log v0.4.14
   Compiling getrandom v0.1.16
   Compiling proc-macro-hack v0.5.19
   Compiling radium v0.4.1
   Compiling ryu v1.0.5
   Compiling num-bigint v0.2.6
   Compiling getrandom v0.2.2
   Compiling proc-macro-nested v0.1.7
   Compiling unicode-normalization v0.1.17
   Compiling http-body v0.4.0
   Compiling kernel32-sys v0.2.2
   Compiling ws2_32-sys v0.2.1
   Compiling httparse v1.3.5
   Compiling rayon v1.5.0
   Compiling pkcs8 v0.3.3
   Compiling doc-comment v0.3.3
   Compiling encoding_rs v0.8.28
   Compiling num-traits v0.2.14
   Compiling num_cpus v1.13.0
   Compiling aho-corasick v0.7.15
   Compiling combine v3.8.1
   Compiling rand_core v0.5.1
   Compiling want v0.3.0
   Compiling quote v1.0.9
   Compiling bitvec v0.18.4
   Compiling generic-array v0.14.4
   Compiling generic-array v0.12.3
   Compiling rand_core v0.6.2
   Compiling rand_chacha v0.2.2
   Compiling idna v0.2.2
   Compiling regex v1.4.3
   Compiling syn v1.0.60
   Compiling paste-impl v0.1.18
   Compiling digest v0.8.1
   Compiling block-buffer v0.7.3
   Compiling backtrace v0.3.56
   Compiling digest v0.9.0
   Compiling block-buffer v0.9.0
   Compiling crypto-mac v0.9.1
   Compiling crypto-mac v0.10.0
   Compiling crypto-mac v0.8.0
   Compiling rand_chacha v0.3.0
   Compiling rand v0.7.3
   Compiling crossbeam-epoch v0.9.2
   Compiling crossbeam-channel v0.5.0
   Compiling url v2.2.1
   Compiling sha2 v0.8.2
   Compiling Inflector v0.11.4
   Compiling paste v0.1.18
   Compiling ff v0.8.0
   Compiling signature v1.2.2
   Compiling sha2 v0.9.3
   Compiling sha-1 v0.9.4
   Compiling ripemd160 v0.9.1
   Compiling sha3 v0.9.1
   Compiling hmac v0.9.0
   Compiling hmac v0.10.1
   Compiling hmac v0.8.1
   Compiling rand v0.8.3
   Compiling crossbeam-deque v0.8.0
   Compiling bs58 v0.3.1
   Compiling socket2 v0.3.19
   Compiling parking_lot_core v0.8.3
   Compiling ntapi v0.3.6
   Compiling schannel v0.1.19
   Compiling time v0.1.43
   Compiling net2 v0.2.37
   Compiling winreg v0.7.0
   Compiling group v0.8.0
   Compiling rayon-core v1.9.0
   Compiling synstructure v0.12.4
   Compiling pyo3-derive-backend v0.12.4
   Compiling miow v0.3.6
   Compiling parking_lot v0.11.1
   Compiling native-tls v0.2.7
   Compiling elliptic-curve v0.6.6
   Compiling elliptic-curve v0.8.5
   Compiling miow v0.2.2
   Compiling mio v0.7.9
   Compiling tungstenite v0.12.0
   Compiling ecdsa v0.8.5
   Compiling ecdsa v0.10.2
   Compiling mio v0.6.23
   Compiling p256 v0.5.2
   Compiling k256 v0.5.10
   Compiling k256 v0.7.2
   Compiling mio-named-pipes v0.1.7
   Compiling serde_derive v1.0.123
   Compiling tokio-macros v1.1.0
   Compiling futures-macro v0.3.13
   Compiling tracing-attributes v0.1.13
   Compiling pin-project-internal v1.0.5
   Compiling failure_derive v0.1.8
   Compiling thiserror-impl v1.0.24
   Compiling ghost v0.1.2
   Compiling indoc-impl v0.3.6
   Compiling ctor v0.1.19
   Compiling async-trait v0.1.42
   Compiling async-recursion v0.3.2
   Compiling inventory-impl v0.1.10
   Compiling derive_more v0.99.11
   Compiling tokio-macros v0.2.6
   Compiling pyo3cls v0.12.4
   Compiling futures-util v0.3.13
   Compiling failure v0.1.8
   Compiling indoc v0.3.6
   Compiling tracing v0.1.25
   Compiling inventory v0.1.10
   Compiling thiserror v1.0.24
   Compiling pin-project v1.0.5
   Compiling graphql-parser v0.2.3
   Compiling tokio v0.2.25
   Compiling tracing-futures v0.2.5
   Compiling serde v1.0.123
   Compiling futures-executor v0.3.13
   Compiling futures v0.3.13
   Compiling tokio-util v0.6.3
   Compiling tokio-native-tls v0.3.0
   Compiling tokio-stream v0.1.3
   Compiling tokio-tungstenite v0.13.0
   Compiling h2 v0.3.0
   Compiling serde_json v1.0.62
   Compiling chrono v0.4.19
   Compiling serde_urlencoded v0.7.0
   Compiling bigdecimal v0.1.2
   Compiling serde_urlencoded v0.6.1
   Compiling rust_decimal v1.10.3
   Compiling graphql-introspection-query v0.1.0
   Compiling rust-gmp-serde v0.5.0
   Compiling graphql_client_codegen v0.9.0
   Compiling rust-bigint v1.1.0
   Compiling paillier-common v0.1.1
   Compiling nash-mpc v1.2.0
   Compiling hyper v0.14.4
   Compiling graphql_query_derive v0.9.0
   Compiling graphql_client v0.9.0
   Compiling nash-protocol v0.1.26
   Compiling hyper-tls v0.5.0
   Compiling reqwest v0.11.1
   Compiling nash-native-client v0.1.21
   Compiling openlimits v0.1.10
   Compiling openlimits-python v0.1.0 (D:\projects\openlimits-python)
warning: unused import: `tokio::sync::mpsc::UnboundedSender`
 --> src\lib.rs:3:5
  |
3 | use tokio::sync::mpsc::UnboundedSender;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default


warning: unused import: `tokio::sync::Mutex`
 --> src\lib.rs:4:5
  |
4 | use tokio::sync::Mutex;
  |     ^^^^^^^^^^^^^^^^^^


warning: unused import: `std::sync::Arc`
 --> src\lib.rs:5:5
  |
5 | use std::sync::Arc;
  |     ^^^^^^^^^^^^^^


warning: unused imports: `Either`, `select`
  --> src\lib.rs:38:28
   |
38 | use futures_util::future::{select, Either, Future};
   |                            ^^^^^^  ^^^^^^


error[E0308]: mismatched types
   --> src\lib.rs:129:54
    |
129 |         let ws_client: OpenLimitsWs<AnyWsExchange> = runtime.block_on(ws_client_future);
    |                        ---------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `OpenLimitsWs`, found enum `Result`
    |                        |
    |                        expected due to this
    |
    = note: expected struct `OpenLimitsWs<AnyWsExchange>`
                 found enum `Result<OpenLimitsWs<_>, OpenLimitsError>`


error[E0308]: mismatched types
   --> src\lib.rs:133:13
    |
133 |             client,
    |             ^^^^^^ expected enum `AnyExchange`, found enum `Result`
    |
    = note: expected enum `AnyExchange`
               found enum `Result<_, OpenLimitsError>`


error[E0063]: missing field `order_status` in initializer of `GetOrderHistoryRequest`
   --> src\lib.rs:243:19
    |
243 |         let req = GetOrderHistoryRequest {
    |                   ^^^^^^^^^^^^^^^^^^^^^^ missing `order_status`


warning: unused import: `tokio::stream::StreamExt`
 --> src\lib.rs:2:5
  |
2 | use tokio::stream::StreamExt;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^


warning: unused import: `Exchange`
 --> src\lib.rs:7:65
  |
7 |     exchange::{OpenLimits, ExchangeAccount, ExchangeMarketData, Exchange},
  |                                                                 ^^^^^^^^


warning: unused import: `ExchangeWs`
 --> src\lib.rs:8:33
  |
8 |     exchange_ws::{OpenLimitsWs, ExchangeWs},
  |                                 ^^^^^^^^^^


error: aborting due to 3 previous errors; 7 warnings emitted


Some errors have detailed explanations: E0063, E0308.

For more information about an error, try `rustc --explain E0063`.

error: could not compile `openlimits-python`

To learn more, run the command again with --verbose.
💥 maturin failed
  Caused by: Failed to build a native library through cargo
  Caused by: Cargo build finished with "exit code: 101": `cargo rustc --message-format json --manifest-path Cargo.toml --release --lib --`

@notdanilo
Copy link
Contributor

@Bi0max the plan is to fix this issue today. Let's follow this up here: nash-io/openlimits-python#6

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

Successfully merging a pull request may close this issue.

4 participants