<?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>15255</bug_id>
          
          <creation_ts>2023-10-26 22:52:54 +0000</creation_ts>
          <short_desc>bitbake explodes when there is a typo SRC_URL instead of SRC_URI</short_desc>
          <delta_ts>2023-12-09 08:34:03 +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>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.0 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nick Owens">nick.owens</reporter>
          <assigned_to name="Pavel Zhukov">pavel</assigned_to>
          <cc>pavel</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>yoann.congal</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97008</commentid>
    <comment_count>0</comment_count>
    <who name="Nick Owens">nick.owens</who>
    <bug_when>2023-10-26 22:52:54 +0000</bug_when>
    <thetext>my coworker who is new to bitbake was writing a recipe and it didn&apos;t work. we discovered that a typo in SRC_URL will lead to bitbake exploding with an obtuse error and will also create a bunch of directories in $PWD that are named after code fragments from bbclasses.

i think this situation can probably be improved so that other people aren&apos;t scratching their heads when this happens.

repro recipe at the bottom.

mischief@beast:~/src/poky $ bitbake x-native
WARNING: Host distribution &quot;gentoo-2.14&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |################################################################################################################################################################| Time: 0:00:00
Loaded 3065 entries from dependency cache.
Parsing recipes: 100% |##############################################################################################################################################################| Time: 0:00:00
Parsing of 1814 .bb files complete (1813 cached, 1 parsed). 3066 targets, 89 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = &quot;2.4.0&quot;
BUILD_SYS            = &quot;x86_64-linux&quot;
NATIVELSBSTRING      = &quot;universal&quot;
TARGET_SYS           = &quot;x86_64-poky-linux&quot;
MACHINE              = &quot;qemux86-64&quot;
DISTRO               = &quot;poky&quot;
DISTRO_VERSION       = &quot;4.2.3&quot;
TUNE_FEATURES        = &quot;m64 core2&quot;
TARGET_FPU           = &quot;&quot;
meta
meta-poky
meta-yocto-bsp       = &quot;mickledore:6c3c62ebc171e16a45f55f276a83a32db075794e&quot;
meta-oe              = &quot;mickledore:57c516973978ca2667339bf1aae7dc722b5bcac7&quot;

Initialising tasks: 100% |###########################################################################################################################################################| Time: 0:00:00
Sstate summary: Wanted 99 Local 9 Mirrors 83 Missed 7 Current 20 (92% match, 94% complete)
NOTE: Executing Tasks
ERROR: x-native-1.0+${SRCPV}-r0 do_populate_lic: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;exec_func_python() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
     0001:
 *** 0002:sstate_hardcode_path(d)
     0003:
File: &apos;/home/mischief/src/poky/meta/classes-global/sstate.bbclass&apos;, lineno: 654, function: sstate_hardcode_path
     0650:    bb.note(&quot;Removing hardcoded paths from sstate package: &apos;%s&apos;&quot; % (sstate_hardcode_cmd))
     0651:    subprocess.check_output(sstate_hardcode_cmd, shell=True, cwd=sstate_builddir)
     0652:
     0653:        # If the fixmefn is empty, remove it..
 *** 0654:    if os.stat(fixmefn).st_size == 0:
     0655:        os.remove(fixmefn)
     0656:    else:
     0657:        bb.note(&quot;Replacing absolute paths in fixmepath file: &apos;%s&apos;&quot; % (sstate_filelist_relative_cmd))
     0658:        subprocess.check_output(sstate_filelist_relative_cmd, shell=True)
Exception: FileNotFoundError: [Errno 2] No such file or directory: &apos;/home/mischief/src/poky/build/tmp/work/core2-64-poky-linux/x-native/1.0+${SRCPV}-r0/sstate-build-populate_lic/fixmepath&apos;

ERROR: Logfile of failure stored in: /home/mischief/src/poky/build/tmp/work/core2-64-poky-linux/x-native/1.0+${SRCPV}-r0/temp/log.do_populate_lic.1507434
ERROR: Task (/home/mischief/src/poky/meta/recipes-devtools/x/x-native.bb:do_populate_lic) failed with exit code &apos;1&apos;
ERROR: x-native-1.0+${SRCPV}-r0 do_deploy_source_date_epoch: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;exec_func_python() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
     0001:
 *** 0002:sstate_hardcode_path(d)
     0003:
File: &apos;/home/mischief/src/poky/meta/classes-global/sstate.bbclass&apos;, lineno: 654, function: sstate_hardcode_path
     0650:    bb.note(&quot;Removing hardcoded paths from sstate package: &apos;%s&apos;&quot; % (sstate_hardcode_cmd))
     0651:    subprocess.check_output(sstate_hardcode_cmd, shell=True, cwd=sstate_builddir)
     0652:
     0653:        # If the fixmefn is empty, remove it..
 *** 0654:    if os.stat(fixmefn).st_size == 0:
     0655:        os.remove(fixmefn)
     0656:    else:
     0657:        bb.note(&quot;Replacing absolute paths in fixmepath file: &apos;%s&apos;&quot; % (sstate_filelist_relative_cmd))
     0658:        subprocess.check_output(sstate_filelist_relative_cmd, shell=True)
Exception: FileNotFoundError: [Errno 2] No such file or directory: &apos;/home/mischief/src/poky/build/tmp/work/core2-64-poky-linux/x-native/1.0+${SRCPV}-r0/sstate-build-deploy_source_date_epoch/fixmepath&apos;

ERROR: Logfile of failure stored in: /home/mischief/src/poky/build/tmp/work/core2-64-poky-linux/x-native/1.0+${SRCPV}-r0/temp/log.do_deploy_source_date_epoch.1507433
ERROR: Task (/home/mischief/src/poky/meta/recipes-devtools/x/x-native.bb:do_deploy_source_date_epoch) failed with exit code &apos;1&apos;
NOTE: Tasks Summary: Attempted 510 tasks of which 504 didn&apos;t need to be rerun and 2 failed.

Summary: 2 tasks failed:
  /home/mischief/src/poky/meta/recipes-devtools/x/x-native.bb:do_populate_lic
  /home/mischief/src/poky/meta/recipes-devtools/x/x-native.bb:do_deploy_source_date_epoch
Summary: There was 1 WARNING message.
Summary: There were 2 ERROR messages, returning a non-zero exit code.
mischief@beast:~/src/poky $ ls
&apos;!=&apos;                       contrib         LICENSE                Makefile            meta-poky        oe-init-build-env                             &apos;&apos;\&apos;&apos;patches&apos;\&apos;&apos;)}&apos;   README.poky.md   tools
&apos;${@d.getVar(&apos;\&apos;&apos;S&apos;\&apos;&apos;)&apos;   documentation   LICENSE.GPL-2.0-only   MEMORIAM            meta-selftest   &apos;os.path.join(&apos;\&apos;&apos;&apos;                             README.hardware.md   README.qemu.md
 bitbake                   else            LICENSE.MIT            meta                meta-skeleton   &apos;os.path.normpath(d.getVar(&apos;\&apos;&apos;S&apos;\&apos;&apos;))&apos;         README.md            scripts
 build                     if              MAINTAINERS.md         meta-openembedded   meta-yocto-bsp  &apos;os.path.normpath(d.getVar(&apos;\&apos;&apos;WORKDIR&apos;\&apos;&apos;))&apos;   README.OE-Core.md    SECURITY.md
mischief@beast:~/src/poky $ cat meta/recipes-devtools/x/x-native.bb
SUMMARY = &quot;broken&quot;
HOMEPAGE = &quot;https://github.com/&quot;
LICENSE = &quot;CLOSED&quot;

SRC_URL = &quot;git://gist.github.com/mischief/74d8d99ca3b6c299242717a05af1401b.git;protocol=https&quot;
SRCREV = &quot;${AUTOREV}&quot;
PV:append = &quot;+${SRCPV}&quot;

INHIBIT_DEFAULT_DEPS = &quot;1&quot;

S = &quot;${WORKDIR}/git&quot;

mischief@beast:~/src/poky $</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97453</commentid>
    <comment_count>1</comment_count>
    <who name="Pavel Zhukov">pavel</who>
    <bug_when>2023-12-07 23:16:15 +0000</bug_when>
    <thetext>This issue is not caused by SRC_URI =&gt; SRC_URL typo directly (to be honest I made same mistake in the past). 
Nevertheless this was fixed in 62afa02d01794376efab75623f42e7e08af08526 (oe-core a8e7b0f932b9ea69b3a218fca18041676c65aba0 )

commit 62afa02d01794376efab75623f42e7e08af08526
Author: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Date:   Fri Aug 11 13:52:59 2023 +0100

    base/package: Move source revision information from PV to PKGV</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97461</commentid>
    <comment_count>2</comment_count>
    <who name="Pavel Zhukov">pavel</who>
    <bug_when>2023-12-08 10:37:00 +0000</bug_when>
    <thetext>Reopen the bug because it was not fixed but masked by mentioned commit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97470</commentid>
    <comment_count>3</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-12-08 22:58:54 +0000</bug_when>
    <thetext>FYI, the commit 62afa02d01794376efab75623f42e7e08af08526 was also mentioned as a fix for #14918 (See https://bugzilla.yoctoproject.org/show_bug.cgi?id=14918#c2)
Though it look like a coincidence, I thought it would be better to mention it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97471</commentid>
    <comment_count>4</comment_count>
    <who name="Pavel Zhukov">pavel</who>
    <bug_when>2023-12-09 08:32:02 +0000</bug_when>
    <thetext>Should be fixed in https://git.openembedded.org/bitbake/commit/?id=e91c256ec076e70cf8a18e369fe7862e50618c48</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97472</commentid>
    <comment_count>5</comment_count>
    <who name="Pavel Zhukov">pavel</who>
    <bug_when>2023-12-09 08:34:03 +0000</bug_when>
    <thetext>Test case https://git.openembedded.org/openembedded-core-contrib/commit/?h=abelloni/master-next&amp;id=a717508c54954ec22dd40d7fe314bd9a83a85c8f</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>