Skip to content

Commit 13e10dc

Browse files
authored
ci: fix recipe filtering for COMPATIBLE_MACHINE restrictions (#15258)
The workflow was not properly filtering recipes that use the pattern: COMPATIBLE_MACHINE = "null" COMPATIBLE_MACHINE:aarch64 = "(.*)" COMPATIBLE_MACHINE:x86-64 = "(.*)" This pattern sets a default of null (incompatible with all), then overrides for specific architectures. The filter was only checking for explicit COMPATIBLE_HOST:arch = "null" or COMPATIBLE_MACHINE:arch = "null", missing the default null case. Now the filter: 1. Checks COMPATIBLE_HOST:arch = "null" (existing) 2. Checks for COMPATIBLE_MACHINE = "null" and verifies there's an override for the current architecture 3. Checks explicit COMPATIBLE_MACHINE:arch = "null" (existing) This prevents build failures on incompatible architectures for recipes like firecracker-bin, jailer-bin, and aws-lc. Fixes: #15249
1 parent 49ee51b commit 13e10dc

File tree

1 file changed

+53
-14
lines changed

1 file changed

+53
-14
lines changed

.github/workflows/build-test-recipe.yml

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -140,29 +140,68 @@ jobs:
140140
echo THINGS_TO_EXCLUDE: $THINGS_TO_EXCLUDE
141141
fi
142142
143-
# Filter out recipes with COMPATIBLE_HOST:$ARCH = "null" or COMPATIBLE_MACHINE restrictions
143+
# Filter out recipes with COMPATIBLE_HOST or COMPATIBLE_MACHINE restrictions
144144
FILTERED_RECIPES=""
145145
for recipe in $RECIPES; do
146146
SKIP_RECIPE=false
147+
RECIPE_FILES=$(find meta-aws/ -name "${recipe}.bb" -o -name "${recipe}_*.bb" 2>/dev/null)
148+
149+
if [ -z "$RECIPE_FILES" ]; then
150+
continue
151+
fi
147152
148-
# Check COMPATIBLE_HOST
149-
if find meta-aws/ -name "${recipe}.bb" -o -name "${recipe}_*.bb" | xargs grep -q "COMPATIBLE_HOST:${ARCH}[[:space:]]*=[[:space:]]*\"null\"" 2>/dev/null; then
153+
# Check COMPATIBLE_HOST:$ARCH = "null"
154+
if echo "$RECIPE_FILES" | xargs grep -q "COMPATIBLE_HOST:${ARCH}[[:space:]]*=[[:space:]]*\"null\"" 2>/dev/null; then
155+
echo "Skipping $recipe: COMPATIBLE_HOST:${ARCH} = null"
150156
SKIP_RECIPE=true
151157
fi
152158
153-
# Check COMPATIBLE_MACHINE for ARM32
154-
if [ "${{ matrix.machine }}" == "qemuarm" ]; then
155-
if find meta-aws/ -name "${recipe}.bb" -o -name "${recipe}_*.bb" | xargs grep -q "COMPATIBLE_MACHINE:armv7[av][[:space:]]*=[[:space:]]*\"null\"" 2>/dev/null; then
156-
SKIP_RECIPE=true
157-
fi
159+
# Check for default COMPATIBLE_MACHINE = "null" without override for this arch
160+
if echo "$RECIPE_FILES" | xargs grep -q "^COMPATIBLE_MACHINE[[:space:]]*=[[:space:]]*\"null\"" 2>/dev/null; then
161+
# Check if there's an override for this specific architecture
162+
case "${{ matrix.machine }}" in
163+
qemuarm)
164+
if ! echo "$RECIPE_FILES" | xargs grep -q "COMPATIBLE_MACHINE:armv7[av][[:space:]]*=[[:space:]]*\"(.*)\"" 2>/dev/null; then
165+
echo "Skipping $recipe: COMPATIBLE_MACHINE = null (no armv7 override)"
166+
SKIP_RECIPE=true
167+
fi
168+
;;
169+
qemuarm64)
170+
if ! echo "$RECIPE_FILES" | xargs grep -q "COMPATIBLE_MACHINE:aarch64[[:space:]]*=[[:space:]]*\"(.*)\"" 2>/dev/null; then
171+
echo "Skipping $recipe: COMPATIBLE_MACHINE = null (no aarch64 override)"
172+
SKIP_RECIPE=true
173+
fi
174+
;;
175+
qemux86-64)
176+
if ! echo "$RECIPE_FILES" | xargs grep -q "COMPATIBLE_MACHINE:x86-64[[:space:]]*=[[:space:]]*\"(.*)\"" 2>/dev/null; then
177+
echo "Skipping $recipe: COMPATIBLE_MACHINE = null (no x86-64 override)"
178+
SKIP_RECIPE=true
179+
fi
180+
;;
181+
qemuriscv64)
182+
if ! echo "$RECIPE_FILES" | xargs grep -q "COMPATIBLE_MACHINE:riscv64[[:space:]]*=[[:space:]]*\"(.*)\"" 2>/dev/null; then
183+
echo "Skipping $recipe: COMPATIBLE_MACHINE = null (no riscv64 override)"
184+
SKIP_RECIPE=true
185+
fi
186+
;;
187+
esac
158188
fi
159189
160-
# Check COMPATIBLE_MACHINE for RISC-V
161-
if [ "${{ matrix.machine }}" == "qemuriscv64" ]; then
162-
if find meta-aws/ -name "${recipe}.bb" -o -name "${recipe}_*.bb" | xargs grep -q "COMPATIBLE_MACHINE:riscv64[[:space:]]*=[[:space:]]*\"null\"" 2>/dev/null; then
163-
SKIP_RECIPE=true
164-
fi
165-
fi
190+
# Check explicit COMPATIBLE_MACHINE:$ARCH = "null"
191+
case "${{ matrix.machine }}" in
192+
qemuarm)
193+
if echo "$RECIPE_FILES" | xargs grep -q "COMPATIBLE_MACHINE:armv7[av][[:space:]]*=[[:space:]]*\"null\"" 2>/dev/null; then
194+
echo "Skipping $recipe: COMPATIBLE_MACHINE:armv7 = null"
195+
SKIP_RECIPE=true
196+
fi
197+
;;
198+
qemuriscv64)
199+
if echo "$RECIPE_FILES" | xargs grep -q "COMPATIBLE_MACHINE:riscv64[[:space:]]*=[[:space:]]*\"null\"" 2>/dev/null; then
200+
echo "Skipping $recipe: COMPATIBLE_MACHINE:riscv64 = null"
201+
SKIP_RECIPE=true
202+
fi
203+
;;
204+
esac
166205
167206
if [ "$SKIP_RECIPE" = "false" ]; then
168207
FILTERED_RECIPES+="$recipe "

0 commit comments

Comments
 (0)