<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14148</bug_id>
          
          <creation_ts>2020-12-09 17:31:00 +0000</creation_ts>
          <short_desc>yocto-check-layer argument parser is bad</short_desc>
          <delta_ts>2026-03-24 15:19:40 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>Scripts and Tools</component>
          <version>3.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>denis</cc>
    
    <cc>mingli.yu</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88739</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-12-09 17:31:00 +0000</bug_when>
    <thetext>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 ...].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88740</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-12-09 17:31:30 +0000</bug_when>
    <thetext>The workaround is to creatively order the arguments so the variables are not ambiguous, but this might not be always possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95434</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-04-21 18:45:45 +0000</bug_when>
    <thetext>Moved en masse from 4.2 to 4.3 by Randy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98950</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-04-30 18:05:09 +0000</bug_when>
    <thetext>Add Mingli/Grace to CC since she might want to fix this small bug.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>