<?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>15023</bug_id>
          
          <creation_ts>2023-01-30 15:59:59 +0000</creation_ts>
          <short_desc>Cannot build SDK with api-documentation enabled</short_desc>
          <delta_ts>2023-10-17 13:31:35 +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>devtools / tool chain</component>
          <version>4.2</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>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Eilís Ní Fhlannagáin">pidge</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>pidge</cc>
    
    <cc>randy.macleod</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>94835</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-01-30 15:59:59 +0000</bug_when>
    <thetext>If I build a SDK with api-documentation DISTRO_FEATURE enabled:

ERROR: core-image-base-1.0-r0 do_populate_sdk: Postinstall scriptlets of [&apos;alsa-utils-doc&apos;, &apos;kmod-doc&apos;, &apos;libglib-2.0-doc&apos;, &apos;openssh-doc&apos;, &apos;systemd-doc&apos;, &apos;util-linux-doc&apos;] have failed. If the intention is to defer them to first boot,

Looking at the log:

+ chown man:man /yocto/ross/build/tmp/work/qemuarm64-poky-linux/core-image-base/1.0-r0/sdk/image/usr/local/oe-sdk-hardcoded-buildpath/sysroots/cortexa57-poky-linux/var/cache/man/./fr/index.db
chown: invalid user: ‘man:man’
Error in POSTIN scriptlet in rpm package kmod-doc

Is pseudo looking in the wrong place for the passwd?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96261</commentid>
    <comment_count>1</comment_count>
    <who name="Eilís Ní Fhlannagáin">pidge</who>
    <bug_when>2023-08-16 15:59:09 +0000</bug_when>
    <thetext>It&apos;s not so much that pseudo is looking in the wrong place for a passwd file, it&apos;s that the passwd/group files it finds has no man:man in it. Adding man to ../meta/recipes-devtools/pseudo/files/fallback-group and ../meta/recipes-devtools/pseudo/files/fallback-passwd gets past the error (but is obviously not the correct fix)

The correct fix is to probably adduser when api-documentation is set as a DISTRO_FEATURES. I&apos;ll have a patch soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96362</commentid>
    <comment_count>2</comment_count>
    <who name="Eilís Ní Fhlannagáin">pidge</who>
    <bug_when>2023-09-07 15:02:59 +0000</bug_when>
    <thetext>So the issue here is deeper and has to do with the nativesdk-intercepts for chown and chgrp.

Running either of these ends up corrupting the os.execv args.

If we run:
./scripts/nativesdk-intercept/chown -R foo:foo bar

The loop here ends up missing the conversion of foo:foo to root:root because
it sees sys.argv[0] and assumes that it&apos;s the user:group argument and that we
should convert that. We end up a os.execv(path, args) that have the following
args:

[&apos;root:root&apos;, &apos;-R&apos;, &apos;foo:foo&apos;, &apos;bar&apos;]

As os.execv ignores args[0], we can just populate it with sys.argv[0] and then
loop through sys.argv[1:]. As both chgrp and chown would have either flags and
USER[:GROUP] next, this fixes the issue.

I have a patch for this, but the question I&apos;m trying to answer now is where the PATH prepend goes. Looking at this, it might need to go down in oe/lib/sdk.py</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96716</commentid>
    <comment_count>3</comment_count>
    <who name="Eilís Ní Fhlannagáin">pidge</who>
    <bug_when>2023-10-17 13:31:35 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/poky/commit/meta/lib/oe?id=9ccde59c5303abb04e9bb8e2c987ff4b8f44bb43</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>