safe_client_libs compilation problem - rust-openssl


#1

Hello. I wanted to compile a 32-bit version of client libs. I installed an i386 Debian Sid from mini.iso with packages: openssh, cargo (so rust as dependency), git, curl, make, libssl-dev, pkg-config.

Then:
git clone --depth 1 https://github.com/maidsafe/safe_client_libs.git
cd safe_client_libs/safe_app
cargo build --release --features "use-mock-routing" --target=i686-unknown-linux-gnu

And I get an error:

maciek@debsid32:~/safe_client_libs/safe_app$ cargo build --release --features "use-mock-routing" --target=i686-unknown-linux-gnu
   Compiling openssl v0.9.24
   Compiling num-traits v0.1.43
error: failed to run custom build command for `openssl v0.9.24`
process didn't exit successfully: `/home/maciek/safe_client_libs/target/release/build/openssl-74e276710c5b53dd/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /home/maciek/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.9.24/build.rs:16:14
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed

Is there a workaround? Seems like it’s an old version of openssl crate code and it cannot detect a 1.1.1 version of openssl: https://packages.debian.org/sid/libssl-dev


#2

Downgrading to openssl versions from Debian stretch or even jessie-backports does not work.


#3

I think 32bit is not supported anymore.


#4

I’ve managed to compile a 32-bit version in February. Maybe we are not that far from that?


#5

Are you sure the problem is related to a processor architecture?


#6

@loziniak, I just know that x86 was removed as being Tier-1 platform supported by us, I honestly don’t know if it’s still possible to build it for that architecture or not, perhaps @marcin or @nbaksalyar can give more details


#7

This looks like a recognized problem in the openssl crate.

Luckily some users there have reported workarounds. Can you give them a try @loziniak?


#8

Before I saw this topic I made an issue about this, but in the crust repository (https://github.com/maidsafe/crust/issues/1012). I encountered it while trying to build the crust test on a Raspberry Pi.

I solved it by the mentioned workaround:


#9

Currently I’ve tried downloading rust_sodium sources, replacing reqwest version with newer one (to bump openssl-sys version to fixed one) in rust_sodium-sys/Cargo.toml and play with patching Cargo.toml files in safe_authenticator, safe_app and safe_core to use downloaded sources instead of crates from crates.io. I also don’t know rust and cargo at all, so all it was just a blind trials with no success. Perhaps now it’s time for workarounds from your links, thanks!

(some notes below)

crates dependencies (from Cargo.lock):
openssl-sys <- openssl <- native-tls <- reqwest                <- rust_sodium-sys <- rust_sodium <- safe_authenticator
												    safe_core
												    self_encryption
												    crust
												    routing
												    safe_app
					tokio-tls <- hyper-tls					    
						     reqwest
					hyper-tls <- reqwest
					

Cargo.toml:

[patch.crates-io]
rust_sodium = { path = '/home/maciek/rust_sodium', version = "~0.10.0" }

[dependencies.rust_sodium]
path = '/home/maciek/rust_sodium'
version = "~0.10.0"

[patch.'https://github.com/maidsafe/rust_sodium']
rust_sodium = { path = '/home/maciek/rust_sodium', version = "~0.10.0" }

#10

Good luck. Ping me if you need help with anything!


#11

I used a workaround from the rust-openssl #994 issue. I use this command to start compilation:

OPENSSL_LIB_DIR="/usr/lib/i386-linux-gnu" OPENSSL_INCLUDE_DIR="/usr/include/openssl" cargo build --release --features "use-mock-routing" --target=i686-unknown-linux-gnu

At first, I noticed Compiling openssl v0.9.24 message that filled me with hope, but after some time, I saw that message second time, this time with errors not related to a libssl version, but to a source code:


It’s probably my fault, but I don’t know what I’m doing wrong.


#12

OPENSSL_LIB_DIR="/usr/lib/i386-linux-gnu" doesn’t seem right? I think it should point to an existing directory containing the openssl library. No idea whether that’s causing the issue you’re seeing though.

OPENSSL_INCLUDE_DIR="/usr/include/openssl" should also be OPENSSL_INCLUDE_DIR="/usr/include/openssl-1.0" I think. (Check if they exist.)


#13

@bzee, this is based on Debian packages filelists: libssl1.0-dev and libssl1.0.2


#14

Ah, I see. :+1:

I wonder: where is the libssl.so (soft?) link located? I think the OPENSSL_LIB_DIR should refer to the directory that contains that soft link. Seems to be correct on second look.


#15

@loziniak Can you please try this workaround, if you haven’t already?

If that doesn’t work, you can open an issue for rust-openssl, as it looks to be a problem with their source code.

Good luck, I hope these issues get resolved!


#16

One more thing @loziniak, can you try running cargo clean and compiling fresh? It might solve your error… 0.9.24 compiles fine for me :confused:


#17

Woah, success! cargo clean and OPENSSL_LIB_DIR wokaround did the job. I don’t know why the second compilation pass has started the last time… Thank you all!


#18

Awesome! :partying_face: