From 9e8292e68b453ad120de6c4434db0cec888cc15c Mon Sep 17 00:00:00 2001 From: Grisha Kruglov Date: Mon, 20 Aug 2018 16:09:16 -0700 Subject: [PATCH] Allow 'sqlcipher' feature for all uses of rusqlite This also patches our CI test script to only run "--feature sqlcipher" tests on sub-crates which expose this feature (i.e. themselves rely on rusqlite). --- .travis.yml | 6 +++--- db-traits/Cargo.toml | 3 +++ public-traits/Cargo.toml | 1 + query-projector-traits/Cargo.toml | 3 +++ query-projector/Cargo.toml | 3 +++ query-pull/Cargo.toml | 3 +++ sql/Cargo.toml | 3 +++ tolstoy-traits/Cargo.toml | 3 +++ tolstoy/Cargo.toml | 3 +++ 9 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6403cfe1..45a88372 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,10 +19,10 @@ script: # We can't pick individual features out with `cargo test --all` (At the time of this writing, this # works but does the wrong thing because of a bug in cargo, but its fix will be to disallow doing # this all-together, see https://github.com/rust-lang/cargo/issues/5364 for more information). To - # work around this, we run individual tests for each subcrate individually. + # work around this, we run tests individually for subcrates that rely on `rusqlite`. - | - for manifest in $(find . -type f -name Cargo.toml); do - cargo test --manifest-path $manifest --verbose --no-default-features --features sqlcipher + for crate in "" "db" "db-traits" "ffi" "public-traits" "query-projector" "query-projector-traits" "query-pull" "sql" "tolstoy" "tolstoy-traits" "tools/cli"; do + cargo test --manifest-path ./$crate/Cargo.toml --verbose --no-default-features --features sqlcipher done after_success: - | diff --git a/db-traits/Cargo.toml b/db-traits/Cargo.toml index 9df1c5df..6f1b5bc0 100644 --- a/db-traits/Cargo.toml +++ b/db-traits/Cargo.toml @@ -7,6 +7,9 @@ workspace = ".." name = "db_traits" path = "lib.rs" +[features] +sqlcipher = ["rusqlite/sqlcipher"] + [dependencies] failure = "0.1.1" failure_derive = "0.1.1" diff --git a/public-traits/Cargo.toml b/public-traits/Cargo.toml index 260add5f..92bc255d 100644 --- a/public-traits/Cargo.toml +++ b/public-traits/Cargo.toml @@ -9,6 +9,7 @@ path = "lib.rs" [features] default = ["syncable"] +sqlcipher = ["rusqlite/sqlcipher"] syncable = ["tolstoy_traits"] [dependencies] diff --git a/query-projector-traits/Cargo.toml b/query-projector-traits/Cargo.toml index 2cf166d0..ebdbc366 100644 --- a/query-projector-traits/Cargo.toml +++ b/query-projector-traits/Cargo.toml @@ -7,6 +7,9 @@ workspace = ".." name = "query_projector_traits" path = "lib.rs" +[features] +sqlcipher = ["rusqlite/sqlcipher"] + [dependencies] failure = "0.1.1" failure_derive = "0.1.1" diff --git a/query-projector/Cargo.toml b/query-projector/Cargo.toml index 4e156f72..cc2f49eb 100644 --- a/query-projector/Cargo.toml +++ b/query-projector/Cargo.toml @@ -3,6 +3,9 @@ name = "mentat_query_projector" version = "0.0.1" workspace = ".." +[features] +sqlcipher = ["rusqlite/sqlcipher"] + [dependencies] failure = "0.1.1" indexmap = "1" diff --git a/query-pull/Cargo.toml b/query-pull/Cargo.toml index 940ec4b4..ece464bd 100644 --- a/query-pull/Cargo.toml +++ b/query-pull/Cargo.toml @@ -3,6 +3,9 @@ name = "mentat_query_pull" version = "0.0.1" workspace = ".." +[features] +sqlcipher = ["rusqlite/sqlcipher"] + [dependencies] failure = "0.1.1" diff --git a/sql/Cargo.toml b/sql/Cargo.toml index d39f9149..b6786030 100644 --- a/sql/Cargo.toml +++ b/sql/Cargo.toml @@ -3,6 +3,9 @@ name = "mentat_sql" version = "0.0.1" workspace = ".." +[features] +sqlcipher = ["rusqlite/sqlcipher"] + [dependencies] failure = "0.1.1" ordered-float = "0.5" diff --git a/tolstoy-traits/Cargo.toml b/tolstoy-traits/Cargo.toml index 79a12203..e4d29c2e 100644 --- a/tolstoy-traits/Cargo.toml +++ b/tolstoy-traits/Cargo.toml @@ -7,6 +7,9 @@ workspace = ".." name = "tolstoy_traits" path = "lib.rs" +[features] +sqlcipher = ["rusqlite/sqlcipher"] + [dependencies] failure = "0.1.1" failure_derive = "0.1.1" diff --git a/tolstoy/Cargo.toml b/tolstoy/Cargo.toml index bfb55186..a0025e27 100644 --- a/tolstoy/Cargo.toml +++ b/tolstoy/Cargo.toml @@ -4,6 +4,9 @@ version = "0.0.1" workspace = ".." authors = ["Grisha Kruglov "] +[features] +sqlcipher = ["rusqlite/sqlcipher"] + [dependencies] failure = "0.1.1" futures = "0.1"