Skip to content

Commit 9b0e7fa

Browse files
author
Alex J Lennon
committed
Fix layer dependency paths in yocto-check-layer
- Use absolute paths in bblayers.conf instead of relative paths - Add explicit --dependency flags for all required layers - Fix meta-lmp-base dependency path resolution - Add debugging output to troubleshoot layer structure - Ensure yocto-check-layer can find all dependent layers This should resolve the 'dependent layers in wrong place' CI failure.
1 parent 238cecf commit 9b0e7fa

1 file changed

Lines changed: 33 additions & 9 deletions

File tree

.github/workflows/distro-layer-validation.yml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,26 +222,27 @@ jobs:
222222
fi
223223
cd ..
224224
225-
# Create bblayers.conf
225+
# Create bblayers.conf with correct absolute paths
226+
WORKSPACE_ROOT="$(pwd)"
226227
cat > build/conf/bblayers.conf << EOF
227228
LCONF_VERSION = "7"
228229
BBPATH = "\${TOPDIR}"
229230
BBFILES ?= ""
230231
BBLAYERS ?= " \\
231-
\${TOPDIR}/../build/layers/openembedded-core/meta \\
232-
\${TOPDIR}/../build/layers/meta-openembedded/meta-oe \\
232+
$WORKSPACE_ROOT/build/layers/openembedded-core/meta \\
233+
$WORKSPACE_ROOT/build/layers/meta-openembedded/meta-oe \\
233234
EOF
234235
235236
# Add meta-lmp layers if available
236-
if [ -d "../build/layers/meta-lmp" ]; then
237-
echo " \${TOPDIR}/../build/layers/meta-lmp/meta-lmp-base \\" >> build/conf/bblayers.conf
237+
if [ -d "build/layers/meta-lmp" ]; then
238+
echo " $WORKSPACE_ROOT/build/layers/meta-lmp/meta-lmp-base \\" >> build/conf/bblayers.conf
238239
else
239-
echo " \${TOPDIR}/../build/layers/meta-lmp-base \\" >> build/conf/bblayers.conf
240+
echo " $WORKSPACE_ROOT/build/layers/meta-lmp-base \\" >> build/conf/bblayers.conf
240241
fi
241242
242243
# Add the distro layer being tested
243244
cat >> build/conf/bblayers.conf << EOF
244-
\${TOPDIR}/.. \\
245+
$WORKSPACE_ROOT \\
245246
"
246247
EOF
247248
@@ -282,11 +283,34 @@ jobs:
282283
283284
# Run the layer check
284285
echo "Running yocto-check-layer..."
285-
# Run yocto-check-layer with proper environment setup
286+
# Debug: Show current directory and layer structure
287+
echo "Current directory: $(pwd)"
288+
echo "Available layers:"
289+
ls -la build/layers/ || echo "No build/layers directory found"
290+
if [ -d "build/layers/meta-lmp" ]; then
291+
echo "meta-lmp structure:"
292+
ls -la build/layers/meta-lmp/
293+
fi
294+
if [ -d "build/layers/meta-lmp-base" ]; then
295+
echo "meta-lmp-base structure:"
296+
ls -la build/layers/meta-lmp-base/
297+
fi
298+
299+
# Run yocto-check-layer with explicit dependencies
286300
# The layer being tested is the current directory (.)
301+
DEPENDENCY_ARGS=""
302+
if [ -d "build/layers/meta-lmp" ]; then
303+
DEPENDENCY_ARGS="--dependency build/layers/meta-lmp/meta-lmp-base"
304+
else
305+
DEPENDENCY_ARGS="--dependency build/layers/meta-lmp-base"
306+
fi
307+
308+
echo "Running with dependencies: $DEPENDENCY_ARGS"
287309
if python3 build/layers/openembedded-core/scripts/yocto-check-layer \
288310
. \
289-
--no-auto-dependency \
311+
$DEPENDENCY_ARGS \
312+
--dependency build/layers/openembedded-core/meta \
313+
--dependency build/layers/meta-openembedded/meta-oe \
290314
--output-log distro-layer-check-${{ matrix.yocto_branch }}.log; then
291315
echo "✅ yocto-check-layer completed successfully"
292316
else

0 commit comments

Comments
 (0)