Skip to content

Commit

Permalink
Not enable the rustls feature by default for sqlx
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guenhter committed Sep 3, 2024
1 parent 3bf9ef0 commit 9e25785
Show file tree
Hide file tree
Showing 20 changed files with 86 additions and 42 deletions.
20 changes: 15 additions & 5 deletions contrib/db_pools/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rocket_db_pools"
version = "0.1.0"
version = "0.2.1"
authors = ["Sergio Benitez <[email protected]>", "Jeb Rosen <[email protected]>"]
description = "Rocket async database pooling support"
repository = "https://github.com/rwf2/Rocket/tree/master/contrib/db_pools"
Expand All @@ -26,13 +26,23 @@ 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]
path = "../../../core/lib"
version = "0.6.0-dev"
version = "0.5.2-dev"
default-features = false

[dependencies.rocket_db_pools_codegen]
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion contrib/db_pools/lib/src/diesel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//!
//! ```toml
//! [dependencies]
//! rocket = "0.6.0-dev"
//! rocket = "0.5.2-dev"
//! diesel = "2"
//!
//! [dependencies.rocket_db_pools]
Expand Down
2 changes: 1 addition & 1 deletion contrib/dyn_templates/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ optional = true
features = ["loader", "speedups", "json", "urlencode"]

[dependencies.rocket]
version = "0.6.0-dev"
version = "0.5.2-dev"
path = "../../core/lib"
default-features = false

Expand Down
4 changes: 2 additions & 2 deletions contrib/sync_db_pools/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ version = "0.1.0"
path = "../codegen"

[dependencies.rocket]
version = "0.6.0-dev"
version = "0.5.2-dev"
path = "../../../core/lib"
default-features = false

[build-dependencies]
version_check = "0.9.1"

[dev-dependencies.rocket]
version = "0.6.0-dev"
version = "0.5.2-dev"
path = "../../../core/lib"
default-features = false
features = ["trace"]
Expand Down
2 changes: 1 addition & 1 deletion contrib/ws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tungstenite = ["tokio-tungstenite"]
tokio-tungstenite = { version = "0.23", optional = true }

[dependencies.rocket]
version = "0.6.0-dev"
version = "0.5.2-dev"
path = "../../core/lib"
default-features = false

Expand Down
13 changes: 9 additions & 4 deletions core/codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rocket_codegen"
version = "0.6.0-dev"
version = "0.5.2-dev"
authors = ["Sergio Benitez <[email protected]>"]
description = "Procedural macros for the Rocket web framework."
documentation = "https://api.rocket.rs/master/rocket_codegen/"
Expand All @@ -21,17 +21,22 @@ proc-macro = true
[dependencies]
indexmap = "2"
quote = "1.0"
syn = { version = "2.0", features = ["full", "visit", "visit-mut", "extra-traits"] }
syn = { version = "2.0", features = [
"full",
"visit",
"visit-mut",
"extra-traits",
] }
proc-macro2 = "1.0.60"
devise = "0.4"
rocket_http = { version = "0.6.0-dev", path = "../http/" }
rocket_http = { version = "0.5.2-dev", path = "../http/" }
unicode-xid = "0.2"
version_check = "0.9"
glob = "0.3"

[dev-dependencies]
rocket = { path = "../lib", features = ["json", "msgpack"] }
time = { version = "0.3", features = ["macros"] }
time = { version = "0.3", features = ["macros"] }
pretty_assertions = "1"
version_check = "0.9"
trybuild = "1.0"
2 changes: 1 addition & 1 deletion core/codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//!
//! ```toml
//! [dependencies]
//! rocket = "0.6.0-dev"
//! rocket = "0.5.2-dev"
//! ```
//!
//! And to import all macros, attributes, and derives via `#[macro_use]` in the
Expand Down
2 changes: 1 addition & 1 deletion core/http/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rocket_http"
version = "0.6.0-dev"
version = "0.5.2-dev"
authors = ["Sergio Benitez <[email protected]>"]
description = """
Types, traits, and parsers for HTTP requests, responses, and headers.
Expand Down
51 changes: 40 additions & 11 deletions core/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rocket"
version = "0.6.0-dev"
version = "0.5.2-dev"
authors = ["Sergio Benitez <[email protected]>"]
description = """
Web framework with a focus on usability, security, extensibility, and speed.
Expand Down Expand Up @@ -33,33 +33,50 @@ uuid = ["uuid_", "rocket_http/uuid"]
tls = ["rustls", "tokio-rustls", "rustls-pemfile"]
mtls = ["tls", "x509-parser"]
tokio-macros = ["tokio/macros"]
trace = ["tracing-subscriber", "tinyvec", "thread_local", "rustls?/logging", "tokio-rustls?/logging", "multer/log", "s2n-quic-h3?/tracing"]
trace = [
"tracing-subscriber",
"tinyvec",
"thread_local",
"rustls?/logging",
"tokio-rustls?/logging",
"multer/log",
"s2n-quic-h3?/tracing",
]

[dependencies]
# Optional serialization dependencies.
serde_json = { version = "1.0.26", optional = true }
rmp-serde = { version = "1", optional = true }
uuid_ = { package = "uuid", version = "1", optional = true, features = ["serde"] }
uuid_ = { package = "uuid", version = "1", optional = true, features = [
"serde",
] }

# Optional MTLS dependencies
x509-parser = { version = "0.16", optional = true }

# Hyper dependencies
http = "1"
bytes = "1.4"
hyper = { version = "1.1", default-features = false, features = ["http1", "server"] }
hyper-util = { version = "0.1.3", default-features = false, features = ["http1", "server", "tokio"] }
hyper = { version = "1.1", default-features = false, features = [
"http1",
"server",
] }
hyper-util = { version = "0.1.3", default-features = false, features = [
"http1",
"server",
"tokio",
] }

# Non-optional, core dependencies from here on out.
yansi = { version = "1.0.1", features = ["detect-tty"] }
num_cpus = "1.0"
time = { version = "0.3", features = ["macros", "parsing"] }
memchr = "2" # TODO: Use pear instead.
memchr = "2" # TODO: Use pear instead.
binascii = "0.1"
ref-cast = "1.0"
ref-swap = "0.1.2"
parking_lot = "0.12"
ubyte = {version = "0.10.2", features = ["serde"] }
ubyte = { version = "0.10.2", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
figment = { version = "0.10.17", features = ["toml", "env"] }
rand = "0.8"
Expand All @@ -76,7 +93,10 @@ futures = { version = "0.3.30", default-features = false, features = ["std"] }
state = "0.6"

# tracing
tracing = { version = "0.1.40", default-features = false, features = ["std", "attributes"] }
tracing = { version = "0.1.40", default-features = false, features = [
"std",
"attributes",
] }
tinyvec = { version = "1.6", optional = true, features = ["std", "rustc_1_57"] }
thread_local = { version = "1.1", optional = true }

Expand All @@ -87,17 +107,26 @@ default-features = false
features = ["fmt", "tracing-log", "parking_lot"]

[dependencies.rocket_codegen]
version = "0.6.0-dev"
version = "0.5.2-dev"
path = "../codegen"

[dependencies.rocket_http]
version = "0.6.0-dev"
version = "0.5.2-dev"
path = "../http"
features = ["serde"]

[dependencies.tokio]
version = "1.35.1"
features = ["rt-multi-thread", "net", "io-util", "fs", "time", "sync", "signal", "parking_lot"]
features = [
"rt-multi-thread",
"net",
"io-util",
"fs",
"time",
"sync",
"signal",
"parking_lot",
]

[dependencies.tokio-util]
version = "0.7"
Expand Down
6 changes: 3 additions & 3 deletions core/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//!
//! ```toml
//! [dependencies]
//! rocket = "0.6.0-dev"
//! rocket = "0.5.2-dev"
//! ```
//!
//! <small>Note that development versions, tagged with `-dev`, are not published
Expand Down Expand Up @@ -73,14 +73,14 @@
//!
//! ```toml
//! [dependencies]
//! rocket = { version = "0.6.0-dev", features = ["secrets", "tls", "json"] }
//! rocket = { version = "0.5.2-dev", features = ["secrets", "tls", "json"] }
//! ```
//!
//! Conversely, HTTP/2 can be disabled:
//!
//! ```toml
//! [dependencies]
//! rocket = { version = "0.6.0-dev", default-features = false }
//! rocket = { version = "0.5.2-dev", default-features = false }
//! ```
//!
//! [subscriber]: crate::trace::subscriber
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/listener/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! ```toml
//! // Add the following to your Cargo.toml:
//! [dependencies]
//! rocket = { version = "0.6.0-dev", features = ["http3-preview"] }
//! rocket = { version = "0.5.2-dev", features = ["http3-preview"] }
//!
//! // In your Rocket.toml or other equivalent config source:
//! [default.tls]
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/serde/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//!
//! ```toml
//! [dependencies.rocket]
//! version = "0.6.0-dev"
//! version = "0.5.2-dev"
//! features = ["json"]
//! ```
//!
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/serde/msgpack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//!
//! ```toml
//! [dependencies.rocket]
//! version = "0.6.0-dev"
//! version = "0.5.2-dev"
//! features = ["msgpack"]
//! ```
//!
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/serde/uuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! ```toml
//! [dependencies.rocket]
//! version = "0.6.0-dev"
//! version = "0.5.2-dev"
//! features = ["uuid"]
//! ```
//!
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/03-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Now, add Rocket as a dependency in your `Cargo.toml`:

```toml
[dependencies]
rocket = "0.6.0-dev"
rocket = "0.5.2-dev"
```

! warning: Development versions must be _git_ dependencies.
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/05-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ feature:

```toml
## in Cargo.toml
rocket = { version = "0.6.0-dev", features = ["secrets"] }
rocket = { version = "0.5.2-dev", features = ["secrets"] }
```

The API for retrieving, adding, and removing private cookies is identical except
Expand Down Expand Up @@ -839,7 +839,7 @@ complete example.
feature can be enabled in the `Cargo.toml`:

```toml
rocket = { version = "0.6.0-dev", features = ["json"] }
rocket = { version = "0.5.2-dev", features = ["json"] }
```

### Temporary Files
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/10-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Security). To enable TLS support:

```toml,ignore
[dependencies]
rocket = { version = "0.6.0-dev", features = ["tls"] }
rocket = { version = "0.5.2-dev", features = ["tls"] }
```

2. Configure a TLS certificate chain and private key via the `tls.key` and
Expand Down Expand Up @@ -312,7 +312,7 @@ enabled and support configured via the `tls.mutual` config parameter:

```toml,ignore
[dependencies]
rocket = { version = "0.6.0-dev", features = ["mtls"] }
rocket = { version = "0.5.2-dev", features = ["mtls"] }
```

This implicitly enables the `tls` feature.
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/12-pastebin.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Then add the usual Rocket dependencies to the `Cargo.toml` file:

```toml
[dependencies]
rocket = "0.6.0-dev"
rocket = "0.5.2-dev"
```

And finally, create a skeleton Rocket application to work off of in
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/14-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ is to depend on a `contrib` library from git while also depending on a
`crates.io` version of Rocket or vice-versa:

```toml
rocket = "0.6.0-dev"
rocket = "0.5.2-dev"
rocket_db_pools = { git = "https://github.com/rwf2/Rocket.git" }
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rocket_docs_tests"
version = "0.6.0-dev"
version = "0.5.2-dev"
workspace = "../../"
edition = "2021"
publish = false
Expand Down

0 comments on commit 9e25785

Please sign in to comment.