From bc32059eee86ce2dbe37f25a0c9210e0072688c1 Mon Sep 17 00:00:00 2001 From: Eric Kidd Date: Wed, 25 Apr 2018 07:00:34 -0400 Subject: [PATCH] Update documentation for making `diesel` work --- README.md | 17 +++++++---------- examples/using-diesel/Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7a07f8b..119f234 100644 --- a/README.md +++ b/README.md @@ -30,10 +30,7 @@ With a bit of luck, you should be able to just copy your application binary from - OpenSSL, which is needed by many Rust applications. - `libpq`, which is needed for applications that use `diesel` with PostgreSQL. Note that this may be broken under Rust 1.21.0 and later (see https://github.com/emk/rust-musl-builder/issues/27). - `libz`, which is needed by `libpq`. - -You can also use the following libraries with a bit of setup: - -- SQLite3 with `diesel`. See [examples/using-diesel](./examples/using-diesel/). +- SQLite3. See [examples/using-diesel](./examples/using-diesel/). This library also sets up the environment variables needed to compile popular Rust crates using these libraries. @@ -63,13 +60,13 @@ In addition to setting up OpenSSL, you'll need to add the following lines to you ```toml [dependencies] -# This is needed to make sure that Cargo statically links against -# `libssl`. This should happen automatically, but it doesn't. -openssl-sys = "0.9" +diesel = { version = "1", features = ["postgres", "sqlite"] } -[patch.crates-io] -# This is needed to handle cross-compilation of libpq. -pq-sys = { git = 'https://github.com/golddranks/pq-sys' } +# Needed for sqlite. +libsqlite3-sys = { version = "*", features = ["bundled"] } + +# Needed for Postgres. +openssl = "*" ``` See [this PR](https://github.com/sgrif/pq-sys/pull/18) for a discussion of the issues involved in cross-compiling `diesel` and `diesel_codegen`. diff --git a/examples/using-diesel/Cargo.toml b/examples/using-diesel/Cargo.toml index 6c3956e..003295d 100644 --- a/examples/using-diesel/Cargo.toml +++ b/examples/using-diesel/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Eric Kidd "] [dependencies] -diesel = { version = "*", features = ["postgres", "sqlite"] } +diesel = { version = "1", features = ["postgres", "sqlite"] } # Needed for sqlite. libsqlite3-sys = { version = "*", features = ["bundled"] } # Needed for Postgres.