Closed TheNeikos closed 6 years ago
This is possibly a nasty OpenSSL link error related to diesel
's Postgres support.
diesel
needs a very specific setup, as described here. Note that this may not always work with the latest version of pq-sys
! You need to use a version of pq-sys
with @golddranks's fixes applied. This is because upstream pq-sys
didn't support cross-compilation the last time I checked.
I've added the lines to my Cargo.toml
but I still get the ASN1_STRING_length
error.
Have you got a specific diesel version that you know works, or a mix of transitive dependencies?
I have just noticed that your diesel example has a Cargo.lock, so I'm trying those now.
My Cargo.toml looks like this right now:
[dependencies]
bcrypt = "0.1.5"
dotenv = "0.9.0"
error-chain = "0.11.0"
maud_lints = "0.17.0"
r2d2 = "0.8.1"
r2d2-diesel = "1.0.0-beta1"
rocket = "0.3.3"
rocket_codegen = "0.3.3"
openssl-sys = "0.9"
[dependencies.diesel]
features = ["postgres"]
version = "1.0.0-beta1"
[dependencies.diesel_infer_schema]
features = ["postgres"]
version = "1.0.0-beta1"
But I think that a transitive dependency is not compatible? I am not sure.
I don't see the following anywhere:
[patch.crates-io]
# This is needed to handle cross-compilation of libpq.
pq-sys = { git = 'https://github.com/golddranks/pq-sys' }
Please read the link I sent you, and then try my example project, which should be compiled and checked before every release.
Hm, I'm sorry I left out a few portions of it :sweat_smile: while pasting it here. I did have it at the bottom. I will try to investigate if maybe another crate tries to link to openssl.
This example code compiles and links successfully with diesel
, and I use code based on the PostgreSQL version in production systems.
I am using nightly, is that maybe a problem?
@TheNeikos At the very least, you'd need to try FROM ekidd/rust-musl-builder:nightly
to have any chance of that working. Instead, you're manually running:
RUN rustup default nightly-2017-12-20 && rustup target add x86_64-unknown-linux-musl
...which means that you might be overriding some of the configuration I did to get everything working. It's certainly not a supported way to use the image at all.
You could try modifying https://github.com/emk/rust-musl-builder/blob/master/Dockerfile locally to set TOOLCHAIN=nightly-2017-12-20
and then re-run ./test-image
to see if it works.
You could try modifying https://github.com/emk/rust-musl-builder/blob/master/Dockerfile locally to set TOOLCHAIN=nightly-2017-12-20 and then re-run ./test-image to see if it works. I tried that, it solved the
ASN1_STRING_length
error while compilinglibinfer_schema_macros
Now I am getting the SSL_*
errors, while also using the patched pq-sys
. So I guess this is not meant to be right now.
Thanks for your pointers though and happy holidays :christmas_tree:
I'm not sure if there's anything else I can do to help you here, but if so, please feel free to reopen the issue.
First of all, thanks for creating this!
I have tried to build my cargo binary with your docker image, it is sadly slightly out of date. (I need at least 2017-12-20 due to codegen deps) However I was able to fix that in my Dockerfile. However, then I get this error:
Do you know what would fix this?
My Dockerfile:
This seems different from the
pg-sys
problem you mention in the Readme.