From 1f6dabd7a04b3d711c1bb9515846a327b36069f7 Mon Sep 17 00:00:00 2001 From: joao-paulo-parity Date: Mon, 5 Dec 2022 06:00:23 -0300 Subject: [PATCH 1/3] update all references in Cargo.lock for patched crates works around https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2115137#L1544 --- check_dependent_project.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/check_dependent_project.sh b/check_dependent_project.sh index 0fcf843..c98a11f 100755 --- a/check_dependent_project.sh +++ b/check_dependent_project.sh @@ -420,6 +420,23 @@ patch_and_check_dependent() { --crates-to-patch "$this_repo_dir" \ --path "$companions_dir/$comp/Cargo.toml" + # Update all references in the Cargo.lock of the companion for the crates + # which were just patched. Since the companion will be patched into the + # dependent in the following step, doing this avoids having cargo resolve + # two versions for patched crates which are used in both the companion as + # well as the dependent, as shown in: + # https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2115137#L1544 + local comp_update_args=(--manifest-path "$companions_dir/$comp/Cargo.toml") + while IFS= read -r crate; do + comp_update_args+=(-p "$crate") + done < <( + cargo tree --quiet --workspace --depth 0 --manifest-path "$companions_dir/$comp/Cargo.toml" | + awk '{ if (length($1) == 0 || substr($1, 1, 1) == "[") { skip } else { print $1 } }' | + sort | + uniq + ) + cargo update "${comp_update_args[@]}" + echo "Patching $comp companion into $dependent" diener patch \ --target "$org_github_prefix/$comp" \ From 843b042c679eea550929085d272bbcfc8c2c36e8 Mon Sep 17 00:00:00 2001 From: joao-paulo-parity Date: Mon, 5 Dec 2022 07:36:04 -0300 Subject: [PATCH 2/3] wip: disable mergeable check --- check_dependent_project.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_dependent_project.sh b/check_dependent_project.sh index c98a11f..1826e05 100755 --- a/check_dependent_project.sh +++ b/check_dependent_project.sh @@ -220,9 +220,9 @@ process_pr_description_line() { return fi - if [ "$mergeable" != "true" ]; then - die "Github API says $repo#$pr_number is not mergeable" - fi + # if [ "$mergeable" != "true" ]; then + # die "Github API says $repo#$pr_number is not mergeable" + # fi companions+=("$repo") From 992a12790f5dd74506a0866e79ccb4da161fb98e Mon Sep 17 00:00:00 2001 From: joao-paulo-parity Date: Mon, 5 Dec 2022 08:03:27 -0300 Subject: [PATCH 3/3] Revert "wip: disable mergeable check" This reverts commit 843b042c679eea550929085d272bbcfc8c2c36e8. --- check_dependent_project.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_dependent_project.sh b/check_dependent_project.sh index 1826e05..c98a11f 100755 --- a/check_dependent_project.sh +++ b/check_dependent_project.sh @@ -220,9 +220,9 @@ process_pr_description_line() { return fi - # if [ "$mergeable" != "true" ]; then - # die "Github API says $repo#$pr_number is not mergeable" - # fi + if [ "$mergeable" != "true" ]; then + die "Github API says $repo#$pr_number is not mergeable" + fi companions+=("$repo")