fix: schemars 0.8.18 compatibility (#9680)

* fix: schemars 0.8.18 compatibility

backport of #9676

Co-authored-by: Hankung <73242257+Hankung7183@users.noreply.github.com>

* fix clippy lol

---------

Co-authored-by: Hankung <73242257+Hankung7183@users.noreply.github.com>
This commit is contained in:
Fabian-Lars 2024-05-06 21:35:01 +02:00 committed by GitHub
parent b8fd8e1bac
commit 5ee5ed4dc6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 34 additions and 42 deletions

View File

@ -0,0 +1,5 @@
---
tauri-utils: "patch:bug"
---
Fixes `schemars` compilation issue.

16
Cargo.lock generated
View File

@ -3462,9 +3462,9 @@ dependencies = [
[[package]] [[package]]
name = "schemars" name = "schemars"
version = "0.8.16" version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" checksum = "fc6e7ed6919cb46507fb01ff1654309219f62b4d603822501b0b80d42f6f21ef"
dependencies = [ dependencies = [
"dyn-clone", "dyn-clone",
"indexmap", "indexmap",
@ -3476,14 +3476,14 @@ dependencies = [
[[package]] [[package]]
name = "schemars_derive" name = "schemars_derive"
version = "0.8.16" version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" checksum = "185f2b7aa7e02d418e453790dde16890256bbd2bcd04b7dc5348811052b53f49"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde_derive_internals", "serde_derive_internals",
"syn 1.0.109", "syn 2.0.60",
] ]
[[package]] [[package]]
@ -3572,13 +3572,13 @@ dependencies = [
[[package]] [[package]]
name = "serde_derive_internals" name = "serde_derive_internals"
version = "0.26.0" version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.109", "syn 2.0.60",
] ]
[[package]] [[package]]

View File

@ -8,7 +8,7 @@ publish = false
tauri-utils = { version = "1.0.0", features = [ tauri-utils = { version = "1.0.0", features = [
"schema", "schema",
], path = "../tauri-utils" } ], path = "../tauri-utils" }
schemars = { version = "0.8", features = ["url", "preserve_order"] } schemars = { version = "0.8.18", features = ["url", "preserve_order"] }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
url = { version = "2.3", features = ["serde"] } url = { version = "2.3", features = ["serde"] }

View File

@ -226,7 +226,6 @@
}, },
"version": { "version": {
"description": "App version. It is a semver version number or a path to a `package.json` file containing the `version` field. If removed the version number from `Cargo.toml` is used.", "description": "App version. It is a semver version number or a path to a `package.json` file containing the `version` field. If removed the version number from `Cargo.toml` is used.",
"default": null,
"type": [ "type": [
"string", "string",
"null" "null"

View File

@ -22,7 +22,7 @@ html5ever = "0.26"
kuchiki = { package = "kuchikiki", version = "0.8" } kuchiki = { package = "kuchikiki", version = "0.8" }
proc-macro2 = { version = "1", optional = true } proc-macro2 = { version = "1", optional = true }
quote = { version = "1", optional = true } quote = { version = "1", optional = true }
schemars = { version = "0.8", features = [ "url" ], optional = true } schemars = { version = "0.8.18", features = [ "url" ], optional = true }
serde_with = "3" serde_with = "3"
aes-gcm = { version = "0.10", optional = true } aes-gcm = { version = "0.10", optional = true }
getrandom = { version = "0.2", optional = true, features = [ "std" ] } getrandom = { version = "0.2", optional = true, features = [ "std" ] }

View File

@ -166,19 +166,13 @@ impl schemars::JsonSchema for BundleTarget {
..Default::default() ..Default::default()
} }
.into(), .into(),
schemars::_private::apply_metadata( schemars::_private::metadata::add_description(
gen.subschema_for::<Vec<BundleType>>(), gen.subschema_for::<Vec<BundleType>>(),
schemars::schema::Metadata { "A list of bundle targets.",
description: Some("A list of bundle targets.".to_owned()),
..Default::default()
},
), ),
schemars::_private::apply_metadata( schemars::_private::metadata::add_description(
gen.subschema_for::<BundleType>(), gen.subschema_for::<BundleType>(),
schemars::schema::Metadata { "A single bundle target.",
description: Some("A single bundle target.".to_owned()),
..Default::default()
},
), ),
]; ];

View File

@ -42,7 +42,7 @@ impl GlobalRuntime {
} }
} }
fn spawn<F: Future>(&self, task: F) -> JoinHandle<F::Output> fn spawn<F>(&self, task: F) -> JoinHandle<F::Output>
where where
F: Future + Send + 'static, F: Future + Send + 'static,
F::Output: Send + 'static, F::Output: Send + 'static,
@ -96,7 +96,7 @@ impl Runtime {
} }
/// Spawns a future onto the runtime. /// Spawns a future onto the runtime.
pub fn spawn<F: Future>(&self, task: F) -> JoinHandle<F::Output> pub fn spawn<F>(&self, task: F) -> JoinHandle<F::Output>
where where
F: Future + Send + 'static, F: Future + Send + 'static,
F::Output: Send + 'static, F::Output: Send + 'static,
@ -189,7 +189,7 @@ impl RuntimeHandle {
} }
/// Spawns a future onto the runtime. /// Spawns a future onto the runtime.
pub fn spawn<F: Future>(&self, task: F) -> JoinHandle<F::Output> pub fn spawn<F>(&self, task: F) -> JoinHandle<F::Output>
where where
F: Future + Send + 'static, F: Future + Send + 'static,
F::Output: Send + 'static, F::Output: Send + 'static,

16
tooling/cli/Cargo.lock generated
View File

@ -2812,9 +2812,9 @@ dependencies = [
[[package]] [[package]]
name = "schemars" name = "schemars"
version = "0.8.16" version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" checksum = "fc6e7ed6919cb46507fb01ff1654309219f62b4d603822501b0b80d42f6f21ef"
dependencies = [ dependencies = [
"dyn-clone", "dyn-clone",
"schemars_derive", "schemars_derive",
@ -2825,14 +2825,14 @@ dependencies = [
[[package]] [[package]]
name = "schemars_derive" name = "schemars_derive"
version = "0.8.16" version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" checksum = "185f2b7aa7e02d418e453790dde16890256bbd2bcd04b7dc5348811052b53f49"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde_derive_internals", "serde_derive_internals",
"syn 1.0.109", "syn 2.0.52",
] ]
[[package]] [[package]]
@ -2943,13 +2943,13 @@ dependencies = [
[[package]] [[package]]
name = "serde_derive_internals" name = "serde_derive_internals"
version = "0.26.0" version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.109", "syn 2.0.52",
] ]
[[package]] [[package]]

View File

@ -6,7 +6,7 @@ name = "tauri-cli"
version = "1.5.12" version = "1.5.12"
authors = [ "Tauri Programme within The Commons Conservancy" ] authors = [ "Tauri Programme within The Commons Conservancy" ]
edition = "2021" edition = "2021"
rust-version = "1.60" rust-version = "1.70"
categories = [ "gui", "web-programming" ] categories = [ "gui", "web-programming" ]
license = "Apache-2.0 OR MIT" license = "Apache-2.0 OR MIT"
homepage = "https://tauri.app" homepage = "https://tauri.app"

View File

@ -226,7 +226,6 @@
}, },
"version": { "version": {
"description": "App version. It is a semver version number or a path to a `package.json` file containing the `version` field. If removed the version number from `Cargo.toml` is used.", "description": "App version. It is a semver version number or a path to a `package.json` file containing the `version` field. If removed the version number from `Cargo.toml` is used.",
"default": null,
"type": [ "type": [
"string", "string",
"null" "null"

View File

@ -160,7 +160,7 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> {
} }
if options.runner.is_none() { if options.runner.is_none() {
options.runner = config_.build.runner.clone(); options.runner.clone_from(&config_.build.runner);
} }
options options

View File

@ -192,14 +192,9 @@ fn command_internal(mut options: Options) -> Result<()> {
} }
if options.runner.is_none() { if options.runner.is_none() {
options.runner = config options
.lock()
.unwrap()
.as_ref()
.unwrap()
.build
.runner .runner
.clone(); .clone_from(&config.lock().unwrap().as_ref().unwrap().build.runner);
} }
let mut cargo_features = config let mut cargo_features = config