From 8640ed190aad77f4f9ebe5698a13ef322d579122 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Mon, 5 Oct 2026 19:58:15 +0300 Subject: [PATCH] fix: update workspace lockfile with macro pin --- Cargo.lock | 65 ++++------------------------------------ scripts/update-macro-pin | 15 ++++++---- 2 files changed, 16 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 858f701..f5957ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -206,7 +206,7 @@ dependencies = [ "camino", "cfg-if", "chrono", - "confik-macros 0.15.3", + "confik-macros", "envious", "humantime-serde", "indoc", @@ -231,25 +231,13 @@ dependencies = [ "yaml_serde", ] -[[package]] -name = "confik-macros" -version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069b63bb6e1794329e90fe6e76fa58424815d5ae2a701469dea914758c483d13" -dependencies = [ - "darling 0.21.3", - "proc-macro2", - "quote", - "syn 2.0.118", -] - [[package]] name = "confik-macros" version = "0.15.4" dependencies = [ "assert_matches", "confik", - "darling 0.24.1", + "darling", "indoc", "proc-macro2", "quote", @@ -286,38 +274,14 @@ dependencies = [ "typenum", ] -[[package]] -name = "darling" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" -dependencies = [ - "darling_core 0.21.3", - "darling_macro 0.21.3", -] - [[package]] name = "darling" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" dependencies = [ - "darling_core 0.24.1", - "darling_macro 0.24.1", -] - -[[package]] -name = "darling_core" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.118", + "darling_core", + "darling_macro", ] [[package]] @@ -333,24 +297,13 @@ dependencies = [ "syn 3.0.6", ] -[[package]] -name = "darling_macro" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" -dependencies = [ - "darling_core 0.21.3", - "quote", - "syn 2.0.118", -] - [[package]] name = "darling_macro" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" dependencies = [ - "darling_core 0.24.1", + "darling_core", "quote", "syn 3.0.6", ] @@ -436,12 +389,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - [[package]] name = "foldhash" version = "0.1.5" @@ -1363,7 +1310,7 @@ version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d607aa01a3cb0ad757d6fd216136910db3c97b102fe686585689615a02dbcdc" dependencies = [ - "darling 0.24.1", + "darling", "proc-macro2", "quote", "syn 3.0.6", diff --git a/scripts/update-macro-pin b/scripts/update-macro-pin index e25ea7c..2e9de47 100755 --- a/scripts/update-macro-pin +++ b/scripts/update-macro-pin @@ -23,6 +23,10 @@ if [[ -z "$new_version" || "$new_version" == "null" ]]; then exit 0 fi +if [[ -n "$PR_NUMBER" && "$PR_NUMBER" != "null" ]]; then + gh pr checkout "$PR_NUMBER" +fi + current_version="$( sed -nE "s/^${DEPENDENCY_NAME} = \"=([^\"]+)\"$/\\1/p" "$TARGET_MANIFEST" | head -n 1 )" @@ -37,17 +41,18 @@ if [[ "$current_version" == "$new_version" ]]; then exit 0 fi -if [[ -n "$PR_NUMBER" && "$PR_NUMBER" != "null" ]]; then - gh pr checkout "$PR_NUMBER" -fi - sed -i.bak -E "s|^${DEPENDENCY_NAME} = \"=[^\"]+\"$|${DEPENDENCY_NAME} = \"=${new_version}\"|" "$TARGET_MANIFEST" rm -f "${TARGET_MANIFEST}.bak" +cargo update --manifest-path "$TARGET_MANIFEST" \ + --package "$DEPENDENCY_NAME" --precise "$new_version" + +workspace_root="$(cargo metadata --format-version=1 --no-deps --manifest-path "$TARGET_MANIFEST" | jq -r '.workspace_root')" + echo "Updated ${DEPENDENCY_NAME} pin in ${TARGET_MANIFEST}: ${current_version} -> ${new_version}" if [[ -n "$PR_NUMBER" && "$PR_NUMBER" != "null" ]]; then - git add "$TARGET_MANIFEST" + git add "$TARGET_MANIFEST" "$workspace_root/Cargo.lock" if ! git diff --cached --quiet; then git commit -m "chore: update ${DEPENDENCY_NAME} pin"