elastic-rs / elastic

An Elasticsearch REST API client for Rust
Apache License 2.0
253 stars 40 forks source link

process didn't exit successfully: `/home/XXX/target/debug/build/openssl-c583a0438d8de871/build-script-build` (exit code: 101) #376

Closed GopherJ closed 4 years ago

GopherJ commented 5 years ago
error: failed to run custom build command for `openssl v0.9.24`
process didn't exit successfully: `/home/X/target/debug/build/openssl-c583a0438d8de871/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /home/X/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/openssl-0.9.24/build.rs:16:14
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

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

VERSION: ~0.20.0

jatsrt commented 5 years ago

Depending on what platform you are on, and if you are cross compiling, you need to make sure openssl is available to you. See https://docs.rs/openssl/0.10.24/openssl/

Alternative, you can remove the need for openssl in your Cargo.toml elastic = { version = "0.21.0-pre.5", default_features = false, features = ["rustls-tls"] }

GopherJ commented 5 years ago

hello @jatsrt, thanks for your reply, this problem occurs on 0.20.10 and Ubuntu19.04, I think it's because the version of OpenSSL on my PC is too new...

It works fine with the latest version of elastic-rs, but it seems since 0.21.x, elastic-rs can only work with elasticsearch@7. It's not compatible with elasticsearch@5 anymore, in our company, we would like to rewrite our elastic microservice in rust, but we are using elasticsearch@5.

Is there a solution to use elasticsearch@5 with elastic-rs, thanks in advance for your help.

GopherJ commented 5 years ago

@jatsrt Could you help me on this~? I get stuck here for a long time:)

ColonelThirtyTwo commented 5 years ago

Same issue. Can't build this v0.20 on Arch Linux cuz OpenSSL is too new. Git master builds at the time of this comment though.

mwilliammyers commented 5 years ago

We might be able to backport the rusttls-tls feature, but I think we are a little apprehensive about supporting multiple versions of Elasticsearch...

As a workaround, you might want to do one of the following:

mwilliammyers commented 4 years ago

@GopherJ Does that work for you?

GopherJ commented 4 years ago

@jatsrt this feature doesn't seem to exist in the version 0.20.10.

GopherJ commented 4 years ago

@mwilliammyers I think the workaround is emk/rust-musl-builder but it'll be good if the version 0.20.10 uses rustls by default or as feature.