diff --git a/rs/justfile b/rs/justfile index 78834941d2..8074f2f9d4 100644 --- a/rs/justfile +++ b/rs/justfile @@ -220,9 +220,10 @@ _select $FILES: ' <<< "$metadata") # A crate has to be rebuilt when anything it depends on changed, so walk the - # edges backwards until the selection stops growing. - selected=$(awk -v seeds="$seeds" ' - BEGIN { split(seeds, s, "\n"); for (i in s) want[s[i]] = 1 } + # edges backwards until the selection stops growing. The seeds go through the + # environment because BSD awk (macOS) rejects a newline in a `-v` value. + selected=$(SEEDS="$seeds" awk ' + BEGIN { split(ENVIRON["SEEDS"], s, "\n"); for (i in s) want[s[i]] = 1 } { pkg[NR] = $1; dep[NR] = $2 } END { do { @@ -409,6 +410,11 @@ _select-test: fail "a moq-relay diff must not drive the media contract: $(just rs _names "$relay")" fi + # Several seeds select all of them, not just the first. + pair=$(just rs _names "$(just rs _select $'rs/moq-auth/src/lib.rs\nrs/moq-hls/src/lib.rs')") + grep -qw moq-auth <<< "$pair" && grep -qw moq-hls <<< "$pair" \ + || fail "a two-crate diff must select both: $pair" + # A crate nested inside another crate's directory is covered by its parent's # seed. Selecting it directly would compile libFuzzer on every moq-net diff, # and its directory name is not its crate name, so it would also mis-report.