input-output-hk / jormungandr

privacy voting blockchain node
https://input-output-hk.github.io/jormungandr/
Apache License 2.0
364 stars 132 forks source link

Failed compiling from source on NixOS #1026

Closed stakeada closed 5 years ago

stakeada commented 5 years ago

Describe the bug

The problem occurs when trying to compile the source code with the following command:

cargo install --path jormungandr --verbose

The compilation fails with the following error:

  Installing jormungandr v0.7.0-rc1 (/srv/jormungandr/jormungandr)
    Updating crates.io index
       Fresh semver-parser v0.7.0
       Fresh unicode-xid v0.2.0
       Fresh cc v1.0.46
       Fresh unicode-xid v0.1.0
       Fresh cfg-if v0.1.10
       Fresh lazy_static v1.4.0
       Fresh nodrop v0.1.14
       Fresh rustc-demangle v0.1.16
       Fresh smallvec v0.6.10
       Fresh either v1.5.3
       Fresh scopeguard v1.0.0
       Fresh ppv-lite86 v0.2.6
       Fresh autocfg v0.1.7
       Fresh rand_core v0.4.2
       Fresh fnv v1.0.6
       Fresh byte-tools v0.3.1
       Fresh slab v0.4.2
       Fresh matches v0.1.8
       Fresh futures v0.1.29
       Fresh encoding_index_tests v0.1.4
       Fresh subtle v2.2.1
       Fresh pkg-config v0.3.16
       Fresh version_check v0.1.5
       Fresh byte-tools v0.2.0
       Fresh arc-swap v0.4.3
       Fresh remove_dir_all v0.5.2
       Fresh fake-simd v0.1.2
       Fresh stable_deref_trait v1.1.1
       Fresh opaque-debug v0.2.3
       Fresh fixedbitset v0.1.9
       Fresh arrayref v0.3.5
       Fresh unicode-segmentation v1.3.0
       Fresh percent-encoding v1.0.1
       Fresh itoa v0.4.4
       Fresh foreign-types-shared v0.1.1
       Fresh scopeguard v0.3.3
       Fresh quick-error v1.2.2
       Fresh multimap v0.4.0
       Fresh cryptoxide v0.1.2
       Fresh linked-hash-map v0.5.2
       Fresh bech32 v0.6.0
       Fresh try-lock v0.2.2
       Fresh hex v0.3.2
       Fresh base-x v0.2.6
       Fresh sha1 v0.5.0
       Fresh typed-bytes v0.1.0 (/srv/jormungandr/chain-deps/typed-bytes)
       Fresh unicode-width v0.1.6
       Fresh openssl-probe v0.1.2
       Fresh cbor_event v2.1.3
       Fresh regex-syntax v0.6.12
       Fresh platforms v0.2.1
       Fresh integer-encoding v1.0.7
       Fresh ansi_term v0.11.0
       Fresh void v1.0.2
       Fresh chain-time v0.1.0 (/srv/jormungandr/chain-deps/chain-time)
       Fresh custom_error v1.7.1
       Fresh strsim v0.8.0
       Fresh strum v0.15.0
       Fresh imhamt v0.1.0 (/srv/jormungandr/chain-deps/imhamt)
       Fresh vec_map v0.8.1
       Fresh mime v0.3.14
       Fresh dtoa v0.4.4
       Fresh take_mut v0.2.2
       Fresh lazycell v1.2.1
       Fresh hex v0.4.0
       Fresh sha1 v0.6.0
       Fresh language-tags v0.2.2
       Fresh bech32 v0.7.1
       Fresh semver v0.9.0
       Fresh chain-core v0.1.0 (/srv/jormungandr/chain-deps/chain-core)
       Fresh crossbeam-utils v0.6.6
       Fresh thread_local v0.3.6
       Fresh unicode-normalization v0.1.8
       Fresh itertools v0.8.0
       Fresh lock_api v0.3.1
       Fresh c2-chacha v0.2.3
       Fresh rand_core v0.3.1
       Fresh rand_jitter v0.1.4
       Fresh block-padding v0.1.4
       Fresh unicode-bidi v0.3.4
       Fresh tokio-sync v0.1.7
       Fresh tower-service v0.2.0
       Fresh tower-service v0.1.0
       Fresh encoding-index-japanese v1.20141219.5
       Fresh encoding-index-simpchinese v1.20141219.5
       Fresh encoding-index-korean v1.20141219.5
       Fresh encoding-index-tradchinese v1.20141219.5
       Fresh encoding-index-singlebyte v1.20141219.5
       Fresh owning_ref v0.4.0
       Fresh petgraph v0.4.13
       Fresh block-buffer v0.3.3
       Fresh heck v0.3.1
       Fresh foreign-types v0.3.2
       Fresh humantime v1.3.0
       Fresh ed25519-bip32 v0.1.4
       Fresh lru-cache v0.1.2
       Fresh yaml-rust v0.4.3
       Fresh multibase v0.6.0
       Fresh textwrap v0.11.0
       Fresh versionisator v1.0.2
       Fresh proc-macro2 v1.0.6
       Fresh rustc_version v0.2.3
       Fresh libc v0.2.65
       Fresh typenum v1.11.2
       Fresh proc-macro2 v0.4.30
       Fresh byteorder v1.3.2
       Fresh arrayvec v0.4.12
       Fresh chain-storage v0.1.0 (/srv/jormungandr/chain-deps/chain-storage)
       Fresh tokio-executor v0.1.8
       Fresh crossbeam-queue v0.1.2
       Fresh crossbeam-channel v0.3.9
       Fresh log v0.4.8
       Fresh rand_isaac v0.1.1
       Fresh rand_xorshift v0.1.1
       Fresh rand_hc v0.1.0
       Fresh idna v0.1.5
       Fresh tower-layer v0.1.0
       Fresh encoding v0.2.33
       Fresh crunchy v0.2.2
       Fresh memchr v2.2.1
       Fresh lock_api v0.1.5
       Fresh bitflags v1.2.1
       Fresh httparse v1.3.4
       Fresh cardano-legacy-address v0.1.1 (/srv/jormungandr/chain-deps/cardano-legacy-address)
       Fresh ryu v1.0.2
       Fresh slog v2.5.2
       Fresh quote v1.0.2
       Fresh iovec v0.1.4
       Fresh getrandom v0.1.12
       Fresh net2 v0.2.33
       Fresh num_cpus v1.10.1
       Fresh rand_os v0.1.3
       Fresh rand v0.5.6
       Fresh signal-hook-registry v1.1.1
       Fresh hostname v0.1.5
       Fresh socket2 v0.3.11
       Fresh time v0.1.42
       Fresh unix_socket v0.5.0
       Fresh dirs v1.0.5
       Fresh atty v0.2.13
       Fresh backtrace-sys v0.1.32
       Fresh clear_on_drop v0.2.3
       Fresh generic-array v0.12.3
       Fresh generic-array v0.9.0
       Fresh quote v0.6.13
       Fresh base64 v0.10.1
       Fresh tokio-timer v0.2.11
       Fresh tokio-current-thread v0.1.6
       Fresh want v0.2.0
       Fresh log v0.3.9
       Fresh rand_chacha v0.1.1
       Fresh rand_pcg v0.1.2
       Fresh num-traits v0.2.8
       Fresh tower-util v0.1.0
       Fresh url v1.7.2
       Fresh openssl-sys v0.9.52
       Fresh libsqlite3-sys v0.11.1
       Fresh tiny-keccak v1.5.0
       Fresh unicase v2.5.1
       Fresh nom v4.2.3
       Fresh aho-corasick v0.7.6
       Fresh nix v0.14.1
       Fresh slog-scope v4.2.0
       Fresh slog-async v2.3.0
       Fresh syn v1.0.5
       Fresh bytes v0.4.12
       Fresh rand_core v0.5.1
       Fresh mio v0.6.19
       Fresh futures-cpupool v0.1.8
       Fresh threadpool v1.7.1
       Fresh signal-hook v0.1.10
       Fresh resolv-conf v0.6.2
       Fresh term v0.5.2
       Fresh clap v2.33.0
       Fresh backtrace v0.3.40
       Fresh digest v0.8.1
       Fresh block-buffer v0.7.3
       Fresh digest v0.7.6
       Fresh syn v0.15.44
       Fresh syslog v3.3.0
       Fresh rand v0.6.5
       Fresh num-integer v0.1.41
       Fresh cookie v0.11.1
       Fresh openssl v0.10.25
       Fresh rusqlite v0.16.0
       Fresh regex v1.3.1
       Fresh synstructure v0.12.1
       Fresh serde_derive v1.0.101
       Fresh v_escape_derive v0.5.6
       Fresh thiserror-impl v1.0.3
       Fresh memoffset v0.5.1
       Fresh parking_lot_core v0.6.2
       Fresh tokio-io v0.1.12
       Fresh http v0.1.19
       Fresh string v0.2.1
       Fresh tokio-buf v0.1.1
       Fresh network-core v0.1.0-dev (/srv/jormungandr/chain-deps/network-core)
       Fresh rand_chacha v0.2.1
       Fresh mio-uds v0.6.7
       Fresh error-chain v0.12.1
       Fresh sha2 v0.8.0
       Fresh sha2 v0.7.1
       Fresh actix_derive v0.3.2
       Fresh strum_macros v0.15.0
       Fresh structopt-derive v0.2.18
       Fresh slog-syslog v0.12.0
       Fresh parking_lot_core v0.4.0
       Fresh uuid v0.7.4
       Fresh native-tls v0.2.3
       Fresh juniper_codegen v0.13.2
       Fresh derive_more v0.15.0
       Fresh failure_derive v0.1.6
       Fresh serde v1.0.101
       Fresh v_escape v0.7.4
       Fresh thiserror v1.0.3
       Fresh crossbeam-epoch v0.7.2
       Fresh parking_lot v0.9.0
       Fresh tokio-codec v0.1.1
       Fresh tower-request-modifier v0.1.0
       Fresh http-body v0.1.0
       Fresh rand v0.7.2
       Fresh multihash v0.8.0
       Fresh structopt v0.2.18
       Fresh parking_lot v0.7.1
       Fresh tokio-tls v0.2.1
       Fresh mime_guess v2.0.1
       Fresh failure v0.1.6
       Fresh indexmap v1.3.0
       Fresh chrono v0.4.9
       Fresh serde_json v1.0.41
       Fresh serde_urlencoded v0.5.5
       Fresh bincode v1.2.0
       Fresh serde_yaml v0.8.11
       Fresh v_htmlescape v0.4.5
       Fresh crossbeam-deque v0.7.1
       Fresh tokio-reactor v0.1.10
       Fresh scheduled-thread-pool v0.2.2
       Fresh actix-threadpool v0.1.2
       Fresh tempfile v3.1.0
       Fresh curve25519-dalek v1.2.3
       Fresh cid v0.3.1
       Fresh which v2.0.1
       Fresh prost-derive v0.5.0
       Fresh codegen v0.1.1
       Fresh h2 v0.1.26
       Fresh slog-term v2.4.1
       Fresh juniper v0.13.1
       Fresh slog-json v2.3.0
       Fresh tokio-threadpool v0.1.16
       Fresh crossbeam v0.7.2
       Fresh tokio-uds v0.2.5
       Fresh tokio-udp v0.1.5
       Fresh tokio-tcp v0.1.3
       Fresh tokio-signal v0.2.7
       Fresh r2d2 v0.8.6
       Fresh ed25519-dalek v1.0.0-pre.2
       Fresh multiaddr v0.3.1
       Fresh prost v0.5.0
       Fresh tokio-fs v0.1.6
       Fresh slog-stdlog v4.0.0
       Fresh trust-dns-proto v0.6.3
       Fresh http-connection v0.1.0
       Fresh trust-dns-proto v0.5.0
       Fresh r2d2_sqlite v0.8.0
       Fresh chain-crypto v0.1.0 (/srv/jormungandr/chain-deps/chain-crypto)
       Fresh poldercast v0.8.3
       Fresh prost-types v0.5.0
       Fresh tower-grpc v0.1.1
       Fresh tokio v0.1.22
       Fresh tower-http-util v0.1.0
       Fresh chain-storage-sqlite v0.1.0 (/srv/jormungandr/chain-deps/chain-storage-sqlite)
       Fresh chain-addr v0.1.0 (/srv/jormungandr/chain-deps/chain-addr)
       Fresh prost-build v0.5.0
       Fresh trust-dns-resolver v0.10.3
       Fresh hyper v0.12.35
       Fresh tk-listen v0.2.1
       Fresh chain-impl-mockchain v0.1.0 (/srv/jormungandr/chain-deps/chain-impl-mockchain)
       Fresh tower-grpc-build v0.1.0
       Fresh actix v0.7.9
       Fresh tower-hyper v0.1.1
   Compiling jormungandr-lib v0.7.0-rc1 (/srv/jormungandr/jormungandr-lib)
     Running `rustc --edition=2018 --crate-name jormungandr_lib jormungandr-lib/src/lib.rs --color never --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=20aae6d735d17342 -C extra-filename=-20aae6d735d17342 --out-dir /srv/jormungandr/target/release/deps -L dependency=/srv/jormungandr/target/release/deps --extern bech32=/srv/jormungandr/target/release/deps/libbech32-3107ea4469959b00.rmeta --extern cardano_legacy_address=/srv/jormungandr/target/release/deps/libcardano_legacy_address-e3c3ecb69a8d923d.rmeta --extern chain_addr=/srv/jormungandr/target/release/deps/libchain_addr-fc273171958a2578.rmeta --extern chain_core=/srv/jormungandr/target/release/deps/libchain_core-dec3bf8333d1635d.rmeta --extern chain_crypto=/srv/jormungandr/target/release/deps/libchain_crypto-44d09273e3c63a39.rmeta --extern chain_impl_mockchain=/srv/jormungandr/target/release/deps/libchain_impl_mockchain-b6992f583bcb2513.rmeta --extern chrono=/srv/jormungandr/target/release/deps/libchrono-002ea073c58c25c0.rmeta --extern custom_error=/srv/jormungandr/target/release/deps/libcustom_error-4e518208be359dbb.rmeta --extern humantime=/srv/jormungandr/target/release/deps/libhumantime-0af14b766e98b054.rmeta --extern rand_chacha=/srv/jormungandr/target/release/deps/librand_chacha-c0fbb97ae98dc589.rmeta --extern rand_core=/srv/jormungandr/target/release/deps/librand_core-f8f71c8f5dd7d818.rmeta --extern serde=/srv/jormungandr/target/release/deps/libserde-c507cac2dd564e4d.rmeta -L native=/srv/jormungandr/target/release/build/clear_on_drop-08ff4c6870927054/out -L native=/srv/jormungandr/target/release/build/backtrace-sys-cf07384d63c50288/out`
error[E0432]: unresolved imports `chain_impl_mockchain::fragment::ContentsBuilder`, `chain_impl_mockchain::header`
  --> jormungandr-lib/src/interfaces/block0_configuration/mod.rs:22:16
   |
22 |     fragment::{ContentsBuilder, Fragment},
   |                ^^^^^^^^^^^^^^^ no `ContentsBuilder` in `fragment`
23 |     header::{BlockDate, BlockVersion, Header},
   |     ^^^^^^ could not find `header` in `chain_impl_mockchain`

error[E0423]: expected function, found module `block::builder`
  --> jormungandr-lib/src/interfaces/block0_configuration/mod.rs:77:9
   |
77 |         block::builder(BlockVersion::Genesis, content, |hdr| {
   |         ^^^^^^^^^^^^^^ not a function

error[E0603]: module `builder` is private
  --> jormungandr-lib/src/interfaces/block0_configuration/mod.rs:77:16
   |
77 |         block::builder(BlockVersion::Genesis, content, |hdr| {
   |                ^^^^^^^

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0423, E0432, E0603.
For more information about an error, try `rustc --explain E0423`.
error: failed to compile `jormungandr v0.7.0-rc1 (/srv/jormungandr/jormungandr)`, intermediate artifacts can be found at `/srv/jormungandr/target`

Caused by:
  Could not compile `jormungandr-lib`.

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name jormungandr_lib jormungandr-lib/src/lib.rs --color never --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=20aae6d735d17342 -C extra-filename=-20aae6d735d17342 --out-dir /srv/jormungandr/target/release/deps -L dependency=/srv/jormungandr/target/release/deps --extern bech32=/srv/jormungandr/target/release/deps/libbech32-3107ea4469959b00.rmeta --extern cardano_legacy_address=/srv/jormungandr/target/release/deps/libcardano_legacy_address-e3c3ecb69a8d923d.rmeta --extern chain_addr=/srv/jormungandr/target/release/deps/libchain_addr-fc273171958a2578.rmeta --extern chain_core=/srv/jormungandr/target/release/deps/libchain_core-dec3bf8333d1635d.rmeta --extern chain_crypto=/srv/jormungandr/target/release/deps/libchain_crypto-44d09273e3c63a39.rmeta --extern chain_impl_mockchain=/srv/jormungandr/target/release/deps/libchain_impl_mockchain-b6992f583bcb2513.rmeta --extern chrono=/srv/jormungandr/target/release/deps/libchrono-002ea073c58c25c0.rmeta --extern custom_error=/srv/jormungandr/target/release/deps/libcustom_error-4e518208be359dbb.rmeta --extern humantime=/srv/jormungandr/target/release/deps/libhumantime-0af14b766e98b054.rmeta --extern rand_chacha=/srv/jormungandr/target/release/deps/librand_chacha-c0fbb97ae98dc589.rmeta --extern rand_core=/srv/jormungandr/target/release/deps/librand_core-f8f71c8f5dd7d818.rmeta --extern serde=/srv/jormungandr/target/release/deps/libserde-c507cac2dd564e4d.rmeta -L native=/srv/jormungandr/target/release/build/clear_on_drop-08ff4c6870927054/out -L native=/srv/jormungandr/target/release/build/backtrace-sys-cf07384d63c50288/out` (exit code: 1)

To Reproduce

Steps to reproduce the behavior:

  1. Clone the https://github.com/input-output-hk/jormungandr repository

git clone --recurse-submodules https://github.com/input-output-hk/jormungandr cd jormungandr

  1. Enter the repository directory:

cd jormungandr

  1. Checkout the latest tag:

git checkout tags/v0.7.0-rc1

  1. Enter nix-shell, which takes shell.nix into account:

nix-shell

  1. Compile jormungandr:

cargo install --path jormungandr --verbose

Expected behavior The code should compile without any issues.

stakeada commented 5 years ago

Note that the https://github.com/input-output-hk/jormungandr-nix works and compiles jormungandr, but is not up-to-date (latest version is jormungandr 0.5.6+lock). I want to compile https://github.com/input-output-hk/jormungandr repository directly, since it provides the most up-to-date fixes.

NicolasDP commented 5 years ago

You don't need nix to compile the sources.

You checked out to the tag without updating the submodule.

git checkout v0.7.0-rc1
git submodule update --init
cargo install ...
NicolasDP commented 5 years ago

If you want https://github.com/input-output-hk/jormungandr-nix to support the latest version of jormungandr, you should make your query there.

stakeada commented 5 years ago

Works, thank you, this ticket can be closed!