Closed emk closed 6 years ago
Still have this issue. Did not try the 1.20 though.
See the README for rust-musl-builder for instructions on making diesel work. We have example container that get built as part of the test suite, and they support diesel.
@emk I have read the readme thousands times in hope of finding anything what could help.
@vityafx Did you look at the ./test-image
script and the examples/
directory? There's an actual, working diesel
example that might give you some hints.
This is useless example for me and for the problem which is described in the first post here. The problem is not with the diesel
crate but with the diesel-cli
, diesel_codegen
, diesel_migrations
, diesel_infer_schema
and so on. diesel
works, yes, but not the other crates of it.
If you're building inside a Docker container, you might want to avoid diesel_infer_schema
and use the CLI tool outside the container to generate the code you need (then commit it). In general, trying to connect to the database at build time under Docker is pretty painful and it's very hard to do without leaking database credentials into the Docker images you create.
In general, if there's a way to handle a use-case by running diesel-cli
outside the container and checking in the generated code, I would strongly encourage people to do that.
But if there are diesel_codegen
which aren't supported by diesel-cli
, well, how hard would it be to modify the examples/using-diesel
code to use diesel_codegen
, and to submit the updated example as a (broken) PR? That would at least give us something concrete to look at.
In general, there are no easy for fixes for statically-linking C libraries like this. Somebody has to be prepared to put in real debugging time and actually figure out how to make it work. :-(
Does this work with rust 1.3x? Noticed SSL errors while following all direction in README.
When cross-compiling using
diesel_codegen
and Rust 1.21.0, I get the following error:This appears to be caused by https://github.com/rust-lang/rust/issues/43486 and https://github.com/sgrif/pq-sys/pull/18.
Workaround: Use
FROM ekidd/rust-musl-builder:1.20.0
if you need to use diesel before https://github.com/sgrif/pq-sys/pull/18 gets fixed.