From 336dc898442d8b9689a18474d16e65954516cabf Mon Sep 17 00:00:00 2001 From: "oxide-renovate[bot]" <146848827+oxide-renovate[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 07:30:01 +0000 Subject: [PATCH 1/4] Update Rust crate diesel to 2.2.2 --- Cargo.lock | 27 +++++++++++++++++++++------ Cargo.toml | 2 +- workspace-hack/Cargo.toml | 4 ++-- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b19f14891..3df0cf0f97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1828,9 +1828,9 @@ checksum = "a7993efb860416547839c115490d4951c6d0f8ec04a3594d9dd99d50ed7ec170" [[package]] name = "diesel" -version = "2.1.6" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff236accb9a5069572099f0b350a92e9560e8e63a9b8d546162f4a5e03026bb2" +checksum = "bf97ee7261bb708fa3402fa9c17a54b70e90e3cb98afb3dc8999d5512cb03f94" dependencies = [ "bitflags 2.6.0", "byteorder", @@ -1859,11 +1859,12 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.1.4" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14701062d6bed917b5c7103bdffaee1e4609279e240488ad24e7bd979ca6866c" +checksum = "d6ff2be1e7312c858b2ef974f5c7089833ae57b5311b334b30923af58e5718d8" dependencies = [ "diesel_table_macro_syntax", + "dsl_auto_type", "proc-macro2", "quote", "syn 2.0.72", @@ -1871,9 +1872,9 @@ dependencies = [ [[package]] name = "diesel_table_macro_syntax" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" +checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ "syn 2.0.72", ] @@ -2148,6 +2149,20 @@ dependencies = [ "syn 2.0.72", ] +[[package]] +name = "dsl_auto_type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5d9abe6314103864cc2d8901b7ae224e0ab1a103a0a416661b4097b0779b607" +dependencies = [ + "darling", + "either", + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "dtrace-parser" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index d744ec09c3..d07a1244c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -304,7 +304,7 @@ db-macros = { path = "nexus/db-macros" } debug-ignore = "1.0.5" derive_more = "0.99.18" derive-where = "1.2.7" -diesel = { version = "2.1.6", features = ["postgres", "r2d2", "chrono", "serde_json", "network-address", "uuid"] } +diesel = { version = "2.2.2", features = ["postgres", "r2d2", "chrono", "serde_json", "network-address", "uuid"] } diesel-dtrace = { git = "https://github.com/oxidecomputer/diesel-dtrace", branch = "main" } dns-server = { path = "dns-server" } dns-server-api = { path = "dns-server-api" } diff --git a/workspace-hack/Cargo.toml b/workspace-hack/Cargo.toml index 6c7f0baad5..77ddbfff5c 100644 --- a/workspace-hack/Cargo.toml +++ b/workspace-hack/Cargo.toml @@ -40,7 +40,7 @@ crossbeam-utils = { version = "0.8.19" } crossterm = { version = "0.27.0", features = ["event-stream", "serde"] } crypto-common = { version = "0.1.6", default-features = false, features = ["getrandom", "std"] } der = { version = "0.7.9", default-features = false, features = ["derive", "flagset", "oid", "pem", "std"] } -diesel = { version = "2.1.6", features = ["chrono", "i-implement-a-third-party-backend-and-opt-into-breaking-changes", "network-address", "postgres", "r2d2", "serde_json", "uuid"] } +diesel = { version = "2.2.2", features = ["chrono", "i-implement-a-third-party-backend-and-opt-into-breaking-changes", "network-address", "postgres", "r2d2", "serde_json", "uuid"] } digest = { version = "0.10.7", features = ["mac", "oid", "std"] } either = { version = "1.12.0" } elliptic-curve = { version = "0.13.8", features = ["ecdh", "hazmat", "pem", "std"] } @@ -145,7 +145,7 @@ crossbeam-utils = { version = "0.8.19" } crossterm = { version = "0.27.0", features = ["event-stream", "serde"] } crypto-common = { version = "0.1.6", default-features = false, features = ["getrandom", "std"] } der = { version = "0.7.9", default-features = false, features = ["derive", "flagset", "oid", "pem", "std"] } -diesel = { version = "2.1.6", features = ["chrono", "i-implement-a-third-party-backend-and-opt-into-breaking-changes", "network-address", "postgres", "r2d2", "serde_json", "uuid"] } +diesel = { version = "2.2.2", features = ["chrono", "i-implement-a-third-party-backend-and-opt-into-breaking-changes", "network-address", "postgres", "r2d2", "serde_json", "uuid"] } digest = { version = "0.10.7", features = ["mac", "oid", "std"] } either = { version = "1.12.0" } elliptic-curve = { version = "0.13.8", features = ["ecdh", "hazmat", "pem", "std"] } From 9698c5fe0ad2c249978e4a978c0ee63722a51171 Mon Sep 17 00:00:00 2001 From: Rain Date: Tue, 6 Aug 2024 20:04:06 -0700 Subject: [PATCH 2/4] also update diesel-dtrace to pick up change there --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 8d9aecea3c..538cd9024d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1848,7 +1848,7 @@ dependencies = [ [[package]] name = "diesel-dtrace" version = "0.3.0" -source = "git+https://github.com/oxidecomputer/diesel-dtrace?branch=main#62ef5ca0fe243a0929791bb9efbb7ed9c32c5368" +source = "git+https://github.com/oxidecomputer/diesel-dtrace?branch=main#8fcc2bb37c635598c39711d8034b14227c210096" dependencies = [ "diesel", "serde", From 96423c4869fa8812821f99b0a64194214b955593 Mon Sep 17 00:00:00 2001 From: Rain Date: Tue, 6 Aug 2024 20:07:36 -0700 Subject: [PATCH 3/4] also effectively remove diesel from the workspace-hack --- Cargo.lock | 2 -- Cargo.toml | 3 ++- workspace-hack/Cargo.toml | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 538cd9024d..fa277905a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6077,7 +6077,6 @@ dependencies = [ "crossterm", "crypto-common", "der", - "diesel", "digest", "dof", "either", @@ -6102,7 +6101,6 @@ dependencies = [ "hyper 0.14.30", "indexmap 2.3.0", "inout", - "ipnetwork", "itertools 0.10.5", "itertools 0.12.1", "lalrpop-util", diff --git a/Cargo.toml b/Cargo.toml index 08f66be99d..9dc40623ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -304,7 +304,8 @@ db-macros = { path = "nexus/db-macros" } debug-ignore = "1.0.5" derive_more = "0.99.18" derive-where = "1.2.7" -diesel = { version = "2.2.2", features = ["postgres", "r2d2", "chrono", "serde_json", "network-address", "uuid"] } +# Having the i-implement-... feature here makes diesel go away from the workspace-hack +diesel = { version = "2.2.2", features = ["i-implement-a-third-party-backend-and-opt-into-breaking-changes", "postgres", "r2d2", "chrono", "serde_json", "network-address", "uuid"] } diesel-dtrace = { git = "https://github.com/oxidecomputer/diesel-dtrace", branch = "main" } dns-server = { path = "dns-server" } dns-server-api = { path = "dns-server-api" } diff --git a/workspace-hack/Cargo.toml b/workspace-hack/Cargo.toml index 1913355aab..9134e97280 100644 --- a/workspace-hack/Cargo.toml +++ b/workspace-hack/Cargo.toml @@ -40,7 +40,6 @@ crossbeam-utils = { version = "0.8.19" } crossterm = { version = "0.27.0", features = ["event-stream", "serde"] } crypto-common = { version = "0.1.6", default-features = false, features = ["getrandom", "std"] } der = { version = "0.7.9", default-features = false, features = ["derive", "flagset", "oid", "pem", "std"] } -diesel = { version = "2.2.2", features = ["chrono", "i-implement-a-third-party-backend-and-opt-into-breaking-changes", "network-address", "postgres", "r2d2", "serde_json", "uuid"] } digest = { version = "0.10.7", features = ["mac", "oid", "std"] } either = { version = "1.12.0" } elliptic-curve = { version = "0.13.8", features = ["ecdh", "hazmat", "pem", "std"] } @@ -64,7 +63,6 @@ hmac = { version = "0.12.1", default-features = false, features = ["reset"] } hyper = { version = "0.14.30", features = ["full"] } indexmap = { version = "2.3.0", features = ["serde"] } inout = { version = "0.1.3", default-features = false, features = ["std"] } -ipnetwork = { version = "0.20.0", features = ["schemars"] } itertools-5ef9efb8ec2df382 = { package = "itertools", version = "0.12.1" } itertools-93f6ce9d446188ac = { package = "itertools", version = "0.10.5" } lalrpop-util = { version = "0.19.12" } @@ -145,7 +143,6 @@ crossbeam-utils = { version = "0.8.19" } crossterm = { version = "0.27.0", features = ["event-stream", "serde"] } crypto-common = { version = "0.1.6", default-features = false, features = ["getrandom", "std"] } der = { version = "0.7.9", default-features = false, features = ["derive", "flagset", "oid", "pem", "std"] } -diesel = { version = "2.2.2", features = ["chrono", "i-implement-a-third-party-backend-and-opt-into-breaking-changes", "network-address", "postgres", "r2d2", "serde_json", "uuid"] } digest = { version = "0.10.7", features = ["mac", "oid", "std"] } either = { version = "1.12.0" } elliptic-curve = { version = "0.13.8", features = ["ecdh", "hazmat", "pem", "std"] } @@ -169,7 +166,6 @@ hmac = { version = "0.12.1", default-features = false, features = ["reset"] } hyper = { version = "0.14.30", features = ["full"] } indexmap = { version = "2.3.0", features = ["serde"] } inout = { version = "0.1.3", default-features = false, features = ["std"] } -ipnetwork = { version = "0.20.0", features = ["schemars"] } itertools-5ef9efb8ec2df382 = { package = "itertools", version = "0.12.1" } itertools-93f6ce9d446188ac = { package = "itertools", version = "0.10.5" } lalrpop-util = { version = "0.19.12" } From 405d2fd05da51ab9d5d65b7a44edffc8d695d08d Mon Sep 17 00:00:00 2001 From: Rain Date: Tue, 6 Aug 2024 20:17:31 -0700 Subject: [PATCH 4/4] fix build issues --- nexus/db-model/src/tuf_repo.rs | 5 ++++- nexus/db-queries/src/db/datastore/sled.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nexus/db-model/src/tuf_repo.rs b/nexus/db-model/src/tuf_repo.rs index 4a64566a62..6f5a898a2d 100644 --- a/nexus/db-model/src/tuf_repo.rs +++ b/nexus/db-model/src/tuf_repo.rs @@ -307,7 +307,10 @@ impl FromSql for ArtifactHash { fn from_sql( bytes: diesel::pg::PgValue<'_>, ) -> diesel::deserialize::Result { - let s = String::from_sql(bytes)?; + let s = + >::from_sql( + bytes, + )?; ExternalArtifactHash::from_str(&s) .map(ArtifactHash) .map_err(|e| e.into()) diff --git a/nexus/db-queries/src/db/datastore/sled.rs b/nexus/db-queries/src/db/datastore/sled.rs index 381b25dc17..123689087d 100644 --- a/nexus/db-queries/src/db/datastore/sled.rs +++ b/nexus/db-queries/src/db/datastore/sled.rs @@ -272,7 +272,7 @@ impl DataStore { ); } - sql_function!(fn random() -> diesel::sql_types::Float); + define_sql_function!(fn random() -> diesel::sql_types::Float); // We only actually care about one target here, so this // query should have a `.limit(1)` attached. We fetch all