<?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>12963</bug_id>
          
          <creation_ts>2018-10-17 05:00:11 +0000</creation_ts>
          <short_desc>nativesdk-opkg prefixes all internal paths with $SDKPATH and won&apos;t work</short_desc>
          <delta_ts>2026-09-09 16:51: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>core</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>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Denys Dmytriyenko">denis</reporter>
          <assigned_to name="Harish Sadineni">Harish.Sadineni</assigned_to>
          <cc>alejandro.delcastillo</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>tgamblin</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>81887</commentid>
    <comment_count>0</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2018-10-17 05:00:11 +0000</bug_when>
    <thetext>Built an SDK with opkg, installed and relocated it.
When trying to use it to update a copy of rootfs at /tmp/sdk/rootfs (e.g. opkg -o /tmp/sdk/rootfs list), it silently fails. And strace shows that it tries to access following files/dirs:

/tmp/sdk/rootfs///opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux/etc/opkg
/tmp/sdk/rootfs///opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux/var/cache/opkg
/tmp/sdk/rootfs////opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux/var/lib/opkg/info
/tmp/sdk/rootfs////opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux/var/lib/opkg
/tmp/sdk/rootfs////opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux/var/lib/opkg/status

When it works, it should be:
/tmp/sdk/rootfs/etc/opkg
/tmp/sdk/rootfs/var/cache/opkg
/tmp/sdk/rootfs/var/lib/opkg/info
/tmp/sdk/rootfs/var/lib/opkg
/tmp/sdk/rootfs/var/lib/opkg/status</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83070</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2019-02-21 16:12:01 +0000</bug_when>
    <thetext>Chen, are you able to reproduce this problem? 
Moved to M3 and note that the deadline/goal is before the end of February.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83115</commentid>
    <comment_count>2</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2019-02-25 17:15:59 +0000</bug_when>
    <thetext>To make the SDK relocatable, the call that installs the SDK at /opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux/ should use an offline root (-o /opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux/) to have the opkg housekeeping files register files relative to /opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83121</commentid>
    <comment_count>3</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2019-02-26 05:06:58 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; To make the SDK relocatable, the call that installs the SDK at
&gt; /opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux/ should use an offline
&gt; root (-o /opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux/) to have the
&gt; opkg housekeeping files register files relative to
&gt; /opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux.

I don&apos;t want to install/relocate SDK to /opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux/, but that path gets hardcoded to nativesdk-opkg binary.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83124</commentid>
    <comment_count>4</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2019-02-26 15:46:38 +0000</bug_when>
    <thetext>My comment was meant to be a hint for Chen: to make the SDK relocatable, the code that creates the SDK should use an offline root.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83387</commentid>
    <comment_count>5</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2019-04-01 01:50:35 +0000</bug_when>
    <thetext>Any updates?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87731</commentid>
    <comment_count>6</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2020-07-09 08:23:50 +0000</bug_when>
    <thetext>Robert nor Qi are able to work on this now. :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94640</commentid>
    <comment_count>7</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-01-08 09:07:38 +0000</bug_when>
    <thetext>I&apos;ve looked into this and it really looks like a hard limit on path length in the sqlite code. I guess we can do 2 things about this :
- Setup an explicit error when this path length is used (saying we don&apos;t support this, sadly)
- Trying to push an improvement to sqlite to remove this limitation</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94641</commentid>
    <comment_count>8</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-01-08 09:09:54 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; I&apos;ve looked into this and it really looks like a hard limit on path length
&gt; in the sqlite code. I guess we can do 2 things about this :
&gt; - Setup an explicit error when this path length is used (saying we don&apos;t
&gt; support this, sadly)
&gt; - Trying to push an improvement to sqlite to remove this limitation

Oh I this comment did not end up in the good bug... Sorry, please ignore.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96069</commentid>
    <comment_count>9</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-07-26 21:22:00 +0000</bug_when>
    <thetext>Bulk move of 64 bugs to 4.3 M3 after a quick review.
If a bug is actually fixed, please add a commit link and resolve it.
-- Randy for YP bug team.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96436</commentid>
    <comment_count>10</comment_count>
    <who name="Trevor Gamblin">tgamblin</who>
    <bug_when>2023-09-14 15:44:49 +0000</bug_when>
    <thetext>Moved to M4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97061</commentid>
    <comment_count>11</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-10-30 15:29:09 +0000</bug_when>
    <thetext>Bulk move to 5.0 M1. -- Randy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97692</commentid>
    <comment_count>12</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-12-21 23:28:33 +0000</bug_when>
    <thetext>Bulk move of 52 5.0-M1 bugs to M2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98006</commentid>
    <comment_count>13</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-01-25 14:28:49 +0000</bug_when>
    <thetext>Bulk move of bugs owned by &quot;unassigned&quot; from 5.0-M2 to 5.0-M3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98303</commentid>
    <comment_count>14</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-02-22 19:53:23 +0000</bug_when>
    <thetext>Bulk move of bugs from 5.0-M3 to 5.99.
The bugs in this list are all unassigned and are ones that I consider to be nice to do some time but not essential track from milestone to milestone in 5.0 or 5.1. We agreed on this bug handling approach in the YP bug review on Feb 22, 2024.

If you disagree, please move back to a 5.[012...]-M* milestone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104581</commentid>
    <comment_count>15</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-03-11 15:22:59 +0000</bug_when>
    <thetext>I&apos;m not sure if this is still a problem but after 6.0 is in good shape, 
we should check.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106657</commentid>
    <comment_count>16</comment_count>
    <who name="Harish Sadineni">Harish.Sadineni</who>
    <bug_when>2026-08-27 10:55:39 +0000</bug_when>
    <thetext>With latest master this issue is currently not occurring.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106757</commentid>
    <comment_count>17</comment_count>
    <who name="Harish Sadineni">Harish.Sadineni</who>
    <bug_when>2026-09-09 06:01:10 +0000</bug_when>
    <thetext>Verification Steps:

Test on current oe-core/master:
Added the following to local.conf:

TOOLCHAIN_TARGET_TASK:append = &quot; opkg&quot;
TOOLCHAIN_HOST_TASK:append = &quot; nativesdk-opkg&quot;
PACKAGE_CLASSES = &quot;package_ipk&quot;
SDKIMAGE_FEATURES:append = &quot; package-management&quot;

Built and installed the SDK, then relocated it.
Copied the target sysroot to /tmp/sdk/rootfs and ran:

opkg -o /tmp/sdk/rootfs list

This completed successfully. Sample output:
acl-dbg - 2.4.0-r0
acl-dev - 2.4.0-r0
acl-src - 2.4.0-r0
base-files - 3.0.14-r0
...

To confirm which paths opkg was accessing, I traced the command:
strace -f -e trace=file -o /tmp/opkg_strace.log opkg -o /tmp/sdk/rootfs list

The strace log showed it correctly accessing:
/tmp/sdk/rootfs/etc/opkg
/tmp/sdk/rootfs/etc/opkg/arch.conf
/tmp/sdk/rootfs/etc/opkg/opkg.conf
/tmp/sdk/rootfs/var/lib/opkg/info
/tmp/sdk/rootfs/var/lib/opkg
/tmp/sdk/rootfs/var/lib/opkg/status

Test on Dunfell (same steps):
Repeating the identical procedure on Dunfell, the command failed silently, no output and no error.

Tracing this with strace showed opkg instead accessing paths under the hardcoded SDK build path, 
rather than the relocated rootfs I specified:
/tmp/sdk1/rootfs/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/etc/opkg
/tmp/sdk1/rootfs/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/var/cache/opkg
/tmp/sdk1/rootfs/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/var/lib/opkg/info
/tmp/sdk1/rootfs/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/var/lib/opkg
/tmp/sdk1/rootfs/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/var/lib/opkg/status</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106758</commentid>
    <comment_count>18</comment_count>
    <who name="Harish Sadineni">Harish.Sadineni</who>
    <bug_when>2026-09-09 06:03:43 +0000</bug_when>
    <thetext>Closing this issue as Resolved, Since this issue  is not anymore occurring on oe-core/master.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106769</commentid>
    <comment_count>19</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2026-09-09 16:51:40 +0000</bug_when>
    <thetext>Thank you for your due diligence.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>