Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions check_dependent_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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[@]}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't it conflict with --locked flag?
#88

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because cargo check is being executed without the --locked flag below, as intended: Cargo.lock will invariably need to be updated because we're patching packages into projects


echo "Patching $comp companion into $dependent"
diener patch \
--target "$org_github_prefix/$comp" \
Expand Down