From 2a788ca1418ce43e9a1400a8777663f7884082c1 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Wed, 23 Jul 2025 14:32:27 +0200 Subject: [PATCH 1/2] chore: replace `serde_yaml` with `serde_yml` in `mithril-build-script` and `mithril-api-spec` --- Cargo.lock | 30 +++++++++++-------- internal/mithril-build-script/Cargo.toml | 2 +- internal/mithril-build-script/src/open_api.rs | 2 +- internal/tests/mithril-api-spec/Cargo.toml | 2 +- .../tests/mithril-api-spec/src/apispec.rs | 2 +- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6107dee327b..792b97548a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3727,6 +3727,16 @@ dependencies = [ "redox_syscall", ] +[[package]] +name = "libyml" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3302702afa434ffa30847a83305f0a69d6abd74293b6554c18ec85c7ef30c980" +dependencies = [ + "anyhow", + "version_check", +] + [[package]] name = "libz-rs-sys" version = "0.5.1" @@ -4006,7 +4016,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "serde_yaml", + "serde_yml", "warp", ] @@ -4016,7 +4026,7 @@ version = "0.2.25" dependencies = [ "semver", "serde_json", - "serde_yaml", + "serde_yml", ] [[package]] @@ -6448,16 +6458,18 @@ dependencies = [ ] [[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" +name = "serde_yml" +version = "0.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +checksum = "59e2dd588bf1597a252c3b920e0143eb99b0f76e4e082f4c92ce34fbc9e71ddd" dependencies = [ "indexmap 2.10.0", "itoa", + "libyml", + "memchr", "ryu", "serde", - "unsafe-libyaml", + "version_check", ] [[package]] @@ -7515,12 +7527,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "unsigned-varint" version = "0.7.2" diff --git a/internal/mithril-build-script/Cargo.toml b/internal/mithril-build-script/Cargo.toml index 6291e1d33df..50e54210566 100644 --- a/internal/mithril-build-script/Cargo.toml +++ b/internal/mithril-build-script/Cargo.toml @@ -12,4 +12,4 @@ include = ["**/*.rs", "Cargo.toml", "README.md", ".gitignore"] [dependencies] semver = { workspace = true } serde_json = { workspace = true } -serde_yaml = "0.9.34" +serde_yml = "0.0.12" diff --git a/internal/mithril-build-script/src/open_api.rs b/internal/mithril-build-script/src/open_api.rs index 26770002b10..242e049de16 100644 --- a/internal/mithril-build-script/src/open_api.rs +++ b/internal/mithril-build-script/src/open_api.rs @@ -29,7 +29,7 @@ pub fn list_all_open_api_spec_files(paths: &[&Path]) -> Vec { fn read_version_from_open_api_spec_file>(spec_file_path: P) -> OpenAPIVersionRaw { let yaml_spec = fs::read_to_string(spec_file_path).unwrap(); - let open_api: serde_yaml::Value = serde_yaml::from_str(&yaml_spec).unwrap(); + let open_api: serde_yml::Value = serde_yml::from_str(&yaml_spec).unwrap(); open_api["info"]["version"].as_str().unwrap().to_owned() } diff --git a/internal/tests/mithril-api-spec/Cargo.toml b/internal/tests/mithril-api-spec/Cargo.toml index 3e4ad960099..debdb663118 100644 --- a/internal/tests/mithril-api-spec/Cargo.toml +++ b/internal/tests/mithril-api-spec/Cargo.toml @@ -13,7 +13,7 @@ jsonschema = { version = "0.30.0" } reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -serde_yaml = { version = "0.9.34" } +serde_yml = "0.0.12" warp = { workspace = true } [dev-dependencies] diff --git a/internal/tests/mithril-api-spec/src/apispec.rs b/internal/tests/mithril-api-spec/src/apispec.rs index 74da2774683..7f41cb3dcf4 100644 --- a/internal/tests/mithril-api-spec/src/apispec.rs +++ b/internal/tests/mithril-api-spec/src/apispec.rs @@ -56,7 +56,7 @@ impl<'a> APISpec<'a> { /// APISpec factory from spec pub fn from_file(path: &str) -> APISpec<'a> { let yaml_spec = std::fs::read_to_string(path).unwrap(); - let openapi: serde_json::Value = serde_yaml::from_str(&yaml_spec).unwrap(); + let openapi: serde_json::Value = serde_yml::from_str(&yaml_spec).unwrap(); APISpec { openapi, path: None, From 1ec2bbf4d37a81008bf5598d95cb8405b815b651 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Thu, 24 Jul 2025 10:11:06 +0200 Subject: [PATCH 2/2] chore: upgrade crate versions * mithril-build-script from `0.2.25` to `0.2.26` * mithril-api-spec from `0.1.2` to `0.1.3` --- Cargo.lock | 4 ++-- internal/mithril-build-script/Cargo.toml | 2 +- internal/tests/mithril-api-spec/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 792b97548a9..1f0e93d9428 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4009,7 +4009,7 @@ dependencies = [ [[package]] name = "mithril-api-spec" -version = "0.1.2" +version = "0.1.3" dependencies = [ "jsonschema", "mithril-common", @@ -4022,7 +4022,7 @@ dependencies = [ [[package]] name = "mithril-build-script" -version = "0.2.25" +version = "0.2.26" dependencies = [ "semver", "serde_json", diff --git a/internal/mithril-build-script/Cargo.toml b/internal/mithril-build-script/Cargo.toml index 50e54210566..046eb8a7baf 100644 --- a/internal/mithril-build-script/Cargo.toml +++ b/internal/mithril-build-script/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-build-script" -version = "0.2.25" +version = "0.2.26" description = "A toolbox for Mithril crates build scripts" authors = { workspace = true } edition = { workspace = true } diff --git a/internal/tests/mithril-api-spec/Cargo.toml b/internal/tests/mithril-api-spec/Cargo.toml index debdb663118..113a2ba6687 100644 --- a/internal/tests/mithril-api-spec/Cargo.toml +++ b/internal/tests/mithril-api-spec/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-api-spec" -version = "0.1.2" +version = "0.1.3" authors.workspace = true documentation.workspace = true edition.workspace = true