darkrenaissance / darkfi

Anonymous. Uncensored. Sovereign.

Home Page:https://dark.fi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compile error upon install

drelwa opened this issue · comments

commented

Hi there,
I've tried to install Darkfi, following the instructions given here.

My environment:

  • Linux box.

  • Distributor ID: Pop

  • Description: Pop!_OS 22.04 LTS

  • Release: 22.04

  • Codename: jammy

  • Rust toolchain: 1.67.1-x86_64-unknown-linux-gnu

Upon invoking make BINS=darkfid, the compilation fails with the following output..

My attempts at linking libraries failed. Any help would be appreciated.

I suppose rust, wasm toolchain and all package dependencies are installed.
Can you install libssl-dev or openssl and retry?
# apt install libssl-dev

commented

Indeed, rust, wasm toolchain and all package dependencies were installed, along with libssl-dev and openssl.
I cannot figure what would be the problem in my env (for now).

Also had compilation issues while trying to build branch v0.4.0 & also master

589 |             None
    |             ^^^^ not found in this scope

error[E0405]: cannot find trait `FnOnce` in this scope
   --> /Users/<usermame>/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:633:12
    |
633 |         F: FnOnce() -> T,
    |            ^^^^^^ not found in this scope

error[E0405]: cannot find trait `Default` in this scope
   --> /Users/<usermame>/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:661:12
    |
661 |         T: Default + ConditionallySelectable,
    |            ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `FnOnce` in this scope
   --> /Users/<usermame>/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:662:12
    |
662 |         F: FnOnce(T) -> U,
    |            ^^^^^^ not found in this scope

error[E0405]: cannot find trait `Default` in this scope
   --> /Users/<usermame>/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:684:12
    |
684 |         T: Default + ConditionallySelectable,
    |            ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `FnOnce` in this scope
   --> /Users/<usermame>/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:685:12
    |
685 |         F: FnOnce(T) -> CtOption<U>,
    |            ^^^^^^ not found in this scope

error[E0405]: cannot find trait `FnOnce` in this scope
   --> /Users/<usermame>/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:703:12
    |
703 |         F: FnOnce() -> CtOption<T>,
    |            ^^^^^^ not found in this scope

Some errors have detailed explanations: E0405, E0425, E0463.
error: could not compile `subtle` due to 19 previous errors
make[1]: *** [money_contract.wasm] Error 101
make: *** [contracts] Error 2

I would suggest cleanning up the repo make clean && rm Cargo.lock and retrying the compilation.
Just for sanity check you are running compilation commands using make from repo main folder right?

@aggstam thanks for your response. I ran make clean && rm Cargo.lock but still had the same issue.
Yes i am in the repo main, i first ran git checkout v0.4.0 the make darkfid drk as described in the docs.
Just to also point out i am using Apple M1 Pro. Don't know if this should pose an issue

@invent360 Better to stay on master, we have all the latest fixes there and will tag the new version after some other findings are fixed.
Did you install dependencies using sh contrib/dependency_setup.sh or manually?

@aggstam no i installed all manually, but just ran the contrib/dependency_setup.sh script on master branch and then retry make darkfid drk but still get the same error

rust version?

rustup 1.25.2 (17db695f1 2023-02-01)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.67.1 (d5a82bbd2 2023-02-07)`

cargo 1.67.1 (8ecd4f20a 2023-01-10)

Ok could you retry in a fresh repo just to elliminate any artifacts?(remove darkfi repo folder and git clone again)

just did, no luck
error[E0405]: cannot find trait Default` in this scope
--> /Users//.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:661:12
|
661 | T: Default + ConditionallySelectable,
| ^^^^^^^ not found in this scope

error[E0405]: cannot find trait FnOnce in this scope
--> /Users//.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:662:12
|
662 | F: FnOnce(T) -> U,
| ^^^^^^ not found in this scope

error[E0405]: cannot find trait Default in this scope
--> /Users//.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:684:12
|
684 | T: Default + ConditionallySelectable,
| ^^^^^^^ not found in this scope

error[E0405]: cannot find trait FnOnce in this scope
--> /Users//.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:685:12
|
685 | F: FnOnce(T) -> CtOption,
| ^^^^^^ not found in this scope

error[E0405]: cannot find trait FnOnce in this scope
--> /Users//.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:703:12
|
703 | F: FnOnce() -> CtOption,
| ^^^^^^ not found in this scope

Some errors have detailed explanations: E0405, E0425, E0463.
error: could not compile subtle due to 19 previous errors
make[1]: *** [money_contract.wasm] Error 101
make: *** [contracts] Error 2`

Interesting, any other error lines or its just that? Also wasm is istalled right(rustup show)?

just hat one

` darkfi git:(master) rustup show
Default host: aarch64-apple-darwin
rustup home: /Users/me/.rustup

installed toolchains

stable-aarch64-apple-darwin (default)
nightly-aarch64-apple-darwin

active toolchain

stable-aarch64-apple-darwin (default)
rustc 1.67.1 (d5a82bbd2 2023-02-07)`

I don't see wasm32 so better to install it: rustup toolchain install wasm32-unknown-unknown
After that retry compilation.

yep, that did the trick :)
i needed to add the toolchain
rustup target add wasm32-unknown-unknown && make clean && rm Cargo.lock
then make darkfid drk
thanks so much for the help. Really interesting project & i would love to know more and hopefully contribute

Nice!
Ok so @drelwa let me know how your setup is going.
One tip: vm should have enabled virtualization for the cpu

commented

Hey @aggstam,
I invoked make clean && rm Cargo.lock , to no avail, unfortunately.

rustup show returns:

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/anegg0/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
1.66.1-x86_64-unknown-linux-gnu
1.67.1-x86_64-unknown-linux-gnu (default)

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

1.67.1-x86_64-unknown-linux-gnu (default)
rustc 1.67.1 (d5a82bbd2 2023-02-07)

Would you recommend a path to verify if vm enabled CPU virtualization?

Thanks!

run lscpu and check at "Virtualization features" to check if enabled

@drelwa You shouldn't post all your lscpu info online....
Did some digging, your original error is connected to openssl, can you make sure that both the normal and the dev package are installed?

commented

@drelwa You shouldn't post all your lscpu info online....

I wasn't aware my lscpu info could be exploited, thanks for the warning.

Did some digging, your original error is connected to openssl, can you make sure that both the normal and the dev package are installed?

openssl was already installed on my system, not the dev package. It looks like openssl-dev comes in various flavors, so I installed all that I could find, but the compile fails with the same output.
Here are the libraries I installed:

  • libcurl4-openssl-dev
  • libghc-hsopenssl-dev
  • librust-cargo+openssl-dev
  • librust-openssl-dev
  • libsrt-openssl-dev

Some say that the dev version of openssl is actually called libssl-dev, so I installed it, but the outcome remains the same.

Ok in the weekend(when I find the time) I will spin up a pop vm to check it out and will record all the steps for the repo.

commented

Ok in the weekend(when I find the time) I will spin up a pop vm to check it out and will record all the steps for the repo.

I'm feeling embarassed, it's a lot of work for you (although I greatly appreciate your support).
How about I install another distro (that was on my todo list, anyway) and see what happens?
I'll let you know the outcome shortly.

Don't worry its nothing. Even if you install something else, I will still create a VM since I'm still curious to check weither is a distro issue or something we miss.

@drelwa Ok so I created a VM(Pop!_OS 22.04 LTS, 6.0.12, 4C, 4GB), everything works, this is my exact history:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
reboot
mkdir testing
cd testing/
git clone https://github.com/darkrenaissance/darkfi.git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustup toolchain install nightly
rustup target add wasm32-unknown-unknown
cd darkfi/
sh contrib/dependency_setup.sh
make darkfid
sudo apt-get install libssl-dev
make darkfid
./darkfid
make drk
./drk -h
sudo apt-get install libout123-0
./drk -h

So libssl-dev is enough for the repo, and libout123-0 is needed for drk.
I left node sync so I'm sure it works.
I believe some package misconfig happening in your system, having all of the openssl related packages.
Here what exists in my VM:

apt list --installed | grep ssl
 
libio-socket-ssl-perl/jammy,jammy,now 2.074-2 all [installed,automatic]
libnet-smtp-ssl-perl/jammy,jammy,now 1.04-1 all [installed,automatic]
libnet-ssleay-perl/jammy,now 1.92-1build2 amd64 [installed,automatic]
libssl-dev/jammy-security,jammy-updates,now 3.0.2-0ubuntu1.8 amd64 [installed]
libssl3/jammy-security,jammy-updates,now 3.0.2-0ubuntu1.8 amd64 [installed]
openssl/jammy-security,jammy-updates,now 3.0.2-0ubuntu1.8 amd64 [installed]
perl-openssl-defaults/jammy,now 5build2 amd64 [installed,automatic]
ssl-cert/jammy,jammy,now 1.1.2 all [installed,automatic]
commented

Thank you, @aggstam, I do appreciate the support!
I invoked each command to the T on my pop_os! box, with the same disappointing result.
On the other hand I also spun up a VM with pop_os and could compile without an issue.
I don't know what quirk hides in my system that prevents me from installing Darkfid, but I'll do a big clean up and if it fails again after that > reinstall!
Thanks again for being on top of it.

Nice, let me know how it goes!
I would remove all unessecary packages, do a fresh repo so gremlins have been removed.

commented

@aggstam: one last thank you note. I re-installed my box, the gremlins are gone. Darkfi's running.

Noice!
I'm closing the ticket now, feel free to reach for any further issues!