This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It's relevant to check workspace crates individually because otherwise their compilation problems due to feature misconfigurations won't be caught, as exemplified by #12705
- Loading branch information
1 parent
eb1a2a8
commit fe64411
Showing
5 changed files
with
84 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
## A script that checks each workspace crate individually. | ||
## It's relevant to check workspace crates individually because otherwise their compilation problems | ||
## due to feature misconfigurations won't be caught, as exemplified by | ||
## https://github.com/paritytech/substrate/issues/12705 | ||
|
||
set -Eeu -o pipefail | ||
shopt -s inherit_errexit | ||
|
||
set -x | ||
|
||
target_group="$1" | ||
groups_total="$2" | ||
|
||
readarray -t workspace_crates < <(\ | ||
cargo tree --workspace --depth 0 | \ | ||
awk '{ if (length($1) == 0 || substr($1, 1, 1) == "[") { skip } else { print $1 } }' | ||
) | ||
|
||
crates_total=${#workspace_crates[*]} | ||
crates_per_group=$(( (crates_total / groups_total) + (crates_total % groups_total > 0) )) | ||
|
||
group=1 | ||
for ((i=0; i < crates_total; i += crates_per_group)); do | ||
if [ $group -eq "$target_group" ]; then | ||
for crate in "${workspace_crates[@]:$i:$crates_per_group}"; do | ||
cargo check --locked --release -p "$crate" | ||
done | ||
break | ||
fi | ||
group=$(( group + 1 )) | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters