Skip to content

Commit f92b276

Browse files
committed
Merge #13: Enable usage of machine set CRATES var
534e497 Enable usage of machine set CRATES var (Tobin C. Harding) Pull request description: Repos using the `run_task` script would like to set the `CRATES` env var by using ```bash REPO_DIR=$(git rev-parse --show-toplevel) CRATES="$(cargo metadata --no-deps --format-version 1 | jq -j -r '.packages | map(.manifest_path | rtrimstr("/Cargo.toml") | ltrimstr("'"$REPO_DIR"'/")) | join(" ")')" ``` I don't know exactly why but this results in some sort of square braces data type that seems to only work in a loop using `for crate in $CRATES` instead of the `for crate in ${CRATES[@]}` like we currently have. ACKs for top commit: apoelstra: ACK 534e497 Kixunil: ACK 534e497 Tree-SHA512: 542f0f2e4721d5efa43d298d3d0eff94cf9f701e047e3db1a882526a2def88a6504c73c52bcb04cd812e93c9d2e2fce571e25c8086f0a54dfcbfd7cb00d3f133
2 parents 0f235e0 + 534e497 commit f92b276

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ci/run_task.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ main() {
6464
# can't find the file because of the ENV var
6565
# shellcheck source=/dev/null
6666
. "$crates_script"
67-
for crate in "${CRATES[@]}"; do
67+
for crate in $CRATES; do
6868
verbose_say "Found crate: $crate"
6969
done
7070
else
@@ -111,7 +111,7 @@ main() {
111111

112112
# Build and test for each crate, done with each toolchain.
113113
build_and_test() {
114-
for crate in "${CRATES[@]}"; do
114+
for crate in $CRATES; do
115115
local test_vars_script="$REPO_DIR/$crate/contrib/test_vars.sh"
116116

117117
# Clean variables and also make sure they are defined.
@@ -287,7 +287,7 @@ build_docs_with_stable_toolchain() {
287287
do_bench() {
288288
verbose_say "Running bench tests for: $CRATES"
289289

290-
for crate in "${CRATES[@]}"; do
290+
for crate in $CRATES; do
291291
pushd "$REPO_DIR/$crate" > /dev/null
292292
# Unit tests are ignored so if there are no bench test then this will just succeed.
293293
RUSTFLAGS='--cfg=bench' cargo bench

0 commit comments

Comments
 (0)