<?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>15375</bug_id>
          
          <creation_ts>2024-01-30 21:52:32 +0000</creation_ts>
          <short_desc>Define what a valid layer name can contain (and what it cannot)</short_desc>
          <delta_ts>2026-10-01 15:48:12 +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>BitBake</product>
          <component>bitbake</component>
          <version>5.0</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>6.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Orling">tim.orling</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</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>98066</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-01-30 21:52:32 +0000</bug_when>
    <thetext>In working on #15373, I discovered that the original 2013 commit of layerindex-web had defined that a valid layer name could only contain alphanumeric characters and dashes:

https://git.yoctoproject.org/layerindex-web/commit/layerindex?id=2eb5f38b21396b6584f532f9bb763918f0860cdd

    def clean_name(self):
        name = self.cleaned_data[&apos;name&apos;].strip()
        if re.compile(r&apos;[^a-z0-9-]&apos;).search(name):
            raise forms.ValidationError(&quot;Name must only contain alphanumeric characters and dashes&quot;)
        if name.startswith(&apos;-&apos;):
            raise forms.ValidationError(&quot;Name must not start with a dash&quot;)
        if name.endswith(&apos;-&apos;):
            raise forms.ValidationError(&quot;Name must not end with a dash&quot;)
        if &apos;--&apos; in name:
            raise forms.ValidationError(&quot;Name cannot contain consecutive dashes&quot;)
        return name

But clearly nothing is preventing a layer from having a . in the name, it simply was not supported in layerindex. meta-luneos and friends have been successfully using -backports-2.8 and so on layers since zeus.

This led to me to a question of what might be possible?

underscore : an underscore works (we probably don&apos;t want it given overrides confusion) so you could create a layer with &apos;bitbake-layers create-layer meta-foo_bar-1.2&apos; and the resulting example_1.0.bb recipe will build. The examples in the docs show an underscore... https://docs.yoctoproject.org/dev-manual/layers.html?highlight=_xyz#creating-your-own-layer
&quot;meta-GUI_xyz&quot;.

non alphanumeric characters %:! These will not work with &apos;bitbake-layers create-layer&apos; because they are invalid format characters for how Python is parsing the input (plus they probably cause other problems with bash/shell)
ValueError: unsupported format character &apos;:&apos; (0x3a) at index 44
To be sure, other characters like * &amp; / \ are also probably not valid, but I only tested the three (%:!).

unicode, emojis. It turns out you can use the &quot;:tada:&quot; unicode character and &apos;bitbake-layers create-layer meta-&lt;the :tada: emoji&gt;&apos; will happily create a layer. In this case it will fail to parse:
bb.parse.ParseError: ... unparsed line: &apos;BBFILE_PATTERN_meta-&lt;the :tada: character&gt; = &quot;^${LAYERDIR}/&quot;&apos;

This then made me realize we probably need to actually define what is valid and put in checks to ensure the supported characters/pattern are being used.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>