Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 0ed563d

Browse files
Fix --without-components with subsetted components
It's not entirely clear what changed in 1.66, but rust-lang/rust#105755 shows that we are failing to run the install script with --without if there are subsetted component names. This changes the behavior of the filtering to require an *exact* match rather than a partial match, which seems like the better way to go. It's not very clear to me that the previous behavior was actually a good idea.
1 parent a2e6c29 commit 0ed563d

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

install-template.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,9 +921,27 @@ fi
921921

922922
if [ -n "$CFG_WITHOUT" ]; then
923923
without_components="$(echo "$CFG_WITHOUT" | sed "s/,/ /g")"
924-
for without_component in $without_components; do
925-
components="$(echo "$components" | sed "s/$without_component//" | sed "s/$without_component//")"
924+
925+
# This does **not** check that all components in without_components are
926+
# actually present in the list of available components.
927+
#
928+
# Currently that's considered good as it makes it easier to be compatible
929+
# with multiple Rust versions (which may change the exact list of
930+
# components) when writing install scripts.
931+
new_comp=""
932+
for component in $components; do
933+
found=false
934+
for my_component in $without_components; do
935+
if [ "$component" = "$my_component" ]; then
936+
found=true
937+
fi
938+
done
939+
if [ "$found" = false ]; then
940+
# If we didn't find the component in without, then add it to new list.
941+
new_comp="$new_comp $component"
942+
fi
926943
done
944+
components="$new_comp"
927945
fi
928946

929947
if [ -z "$components" ]; then

0 commit comments

Comments
 (0)