Bug 14148 - yocto-check-layer argument parser is bad
Summary: yocto-check-layer argument parser is bad
Status: NEW
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: Scripts and Tools (show other bugs)
Version: 3.4
Hardware: x86 Multiple
: Medium normal
Target Milestone: 5.99
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-12-09 17:31 UTC by Ross Burton
Modified: 2026-03-24 15:19 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2020-12-09 17:31:00 UTC
The yocto-check-layer argument parser has both optional parameters (--machine and --dependency) and mandatory positional arguments (layers) all using + for nargs, which means that parsing is non-deterministic and ambiguous:

$ yocto-check-layer --dependency /home/ross/Yocto/meta-arm/meta-arm-toolchain --machines qemuarm64-secureboot /home/ross/Yocto/meta-arm/meta-arm

yocto-check-layer: error: the following arguments are required: LAYER_DIR

It thought I was passing two machines and no layer, when instead I was passing a machine and a layer.

This can be easily solved by changing the positional layers to be --layers [LAYER DIR ...].
Comment 1 Ross Burton 2020-12-09 17:31:30 UTC
The workaround is to creatively order the arguments so the variables are not ambiguous, but this might not be always possible.
Comment 2 Randy MacLeod 2023-04-21 18:45:45 UTC
Moved en masse from 4.2 to 4.3 by Randy.
Comment 3 Randy MacLeod 2024-04-30 18:05:09 UTC
Add Mingli/Grace to CC since she might want to fix this small bug.