From 2acf6bfbe3ce6028534656ce4f9e035bca0661a1 Mon Sep 17 00:00:00 2001 From: guenhter Date: Fri, 23 Aug 2024 11:24:25 +0200 Subject: [PATCH 1/4] Not enable the rustls feature by default for sqlx DB's like sqlite not need the tls feature with sqlx at all. When cross compiling e.g. to i586, ring is not supported and therefore the db-pool cannot be used because the rustls feature is turned on by default even though not needed. --- contrib/db_pools/lib/Cargo.toml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/contrib/db_pools/lib/Cargo.toml b/contrib/db_pools/lib/Cargo.toml index 2654139914..2fd125ca51 100644 --- a/contrib/db_pools/lib/Cargo.toml +++ b/contrib/db_pools/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rocket_db_pools" -version = "0.1.0" +version = "0.2.1" authors = ["Sergio Benitez ", "Jeb Rosen "] description = "Rocket async database pooling support" repository = "https://github.com/rwf2/Rocket/tree/master/contrib/db_pools" @@ -26,8 +26,18 @@ sqlx_postgres = ["sqlx", "sqlx/postgres", "log"] sqlx_sqlite = ["sqlx", "sqlx/sqlite", "log"] sqlx_macros = ["sqlx/macros"] # diesel features -diesel_postgres = ["diesel-async/postgres", "diesel-async/deadpool", "deadpool", "diesel"] -diesel_mysql = ["diesel-async/mysql", "diesel-async/deadpool", "deadpool", "diesel"] +diesel_postgres = [ + "diesel-async/postgres", + "diesel-async/deadpool", + "deadpool", + "diesel", +] +diesel_mysql = [ + "diesel-async/mysql", + "diesel-async/deadpool", + "deadpool", + "diesel", +] # implicit features: mongodb [dependencies.rocket] @@ -77,7 +87,7 @@ optional = true [dependencies.sqlx] version = "0.8" default-features = false -features = ["runtime-tokio-rustls"] +features = ["runtime-tokio"] optional = true [dependencies.log] From 5b33d50133c8a781a43c40239890e9b06c349d03 Mon Sep 17 00:00:00 2001 From: Matthew Pomes Date: Sat, 7 Dec 2024 10:56:08 -0600 Subject: [PATCH 2/4] Make disabling tls fully optional, but on by default --- contrib/db_pools/lib/Cargo.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/db_pools/lib/Cargo.toml b/contrib/db_pools/lib/Cargo.toml index 2fd125ca51..a8dd6dddee 100644 --- a/contrib/db_pools/lib/Cargo.toml +++ b/contrib/db_pools/lib/Cargo.toml @@ -17,6 +17,10 @@ all-features = true workspace = true [features] +default = [ + "sqlx?/runtime-tokio-rustls", + "mongodb?/rustls-tls", +] # deadpool features deadpool_postgres = ["deadpool-postgres", "deadpool"] deadpool_redis = ["deadpool-redis", "deadpool"] @@ -70,7 +74,7 @@ optional = true [dependencies.mongodb] version = "3" default-features = false -features = ["compat-3-0-0", "rustls-tls"] +features = ["compat-3-0-0"] optional = true [dependencies.diesel-async] From b6b657ae4a34231d06f4b6e860532efe441896bb Mon Sep 17 00:00:00 2001 From: Matthew Pomes Date: Sat, 7 Dec 2024 10:58:00 -0600 Subject: [PATCH 3/4] Fix version number --- contrib/db_pools/lib/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/db_pools/lib/Cargo.toml b/contrib/db_pools/lib/Cargo.toml index a8dd6dddee..8488fc6abb 100644 --- a/contrib/db_pools/lib/Cargo.toml +++ b/contrib/db_pools/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rocket_db_pools" -version = "0.2.1" +version = "0.1.0" authors = ["Sergio Benitez ", "Jeb Rosen "] description = "Rocket async database pooling support" repository = "https://github.com/rwf2/Rocket/tree/master/contrib/db_pools" From b572aa4fb5e0630348362a56ba791cb61a2a7ccd Mon Sep 17 00:00:00 2001 From: Matthew Pomes Date: Sat, 7 Dec 2024 11:03:20 -0600 Subject: [PATCH 4/4] Make mongodb/rustls non-optional, since mongodb actually requires it --- contrib/db_pools/lib/Cargo.toml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/contrib/db_pools/lib/Cargo.toml b/contrib/db_pools/lib/Cargo.toml index 8488fc6abb..d613203d29 100644 --- a/contrib/db_pools/lib/Cargo.toml +++ b/contrib/db_pools/lib/Cargo.toml @@ -17,10 +17,7 @@ all-features = true workspace = true [features] -default = [ - "sqlx?/runtime-tokio-rustls", - "mongodb?/rustls-tls", -] +default = ["sqlx?/runtime-tokio-rustls"] # deadpool features deadpool_postgres = ["deadpool-postgres", "deadpool"] deadpool_redis = ["deadpool-redis", "deadpool"] @@ -74,7 +71,7 @@ optional = true [dependencies.mongodb] version = "3" default-features = false -features = ["compat-3-0-0"] +features = ["compat-3-0-0", "rustls-tls"] optional = true [dependencies.diesel-async]