Bug 15632

Summary: FIXMESTAGINGDIRHOST broken when recipes use externalsrc.bbclass (devtool?)
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ola Nilsson <ola.x.nilsson>
Component: oe-core otherAssignee: Unassigned <unassigned>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium CC: randy.macleod, richard.purdie, yoann.congal
Version: 5.1   
Target Milestone: 6.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Ola Nilsson 2024-10-25 09:10:24 UTC
Start in a clean build dir, /mnt/build/poky/fixmestagingdirhost in my case

## Do devtool modify equivalent for automake

devtool modify automake

# devtool modify automake does not work for me, these are the steps I
# take to create a workspace for automake:

bitbake -c fetch automake
tar -C workspace/sources -xaf downloads/automake-1.17.tar.gz
mv workspace/sources/automake-1.17 workspace/sources/automake
cat > workspace/appends/automake_%.bbappend <<-EOF
	inherit externalsrc
	EXTERNALSRC:pn-automake = "$PWD/workspace/sources/automake"
	EXTERNALSRC:pn-automake-native = "$PWD/workspace/sources/automake"
EOF
git -C workspace/sources/automake init
git -C workspace/sources/automake add .
git -C workspace/sources/automake commit -m "automake 1.17"
git -C workspace/sources/automake apply $PWD/../meta/recipes-devtools/automake/automake/*.patch

# build automake-native
bitbake automake-native

# attempt to build libtool-native
bitbake libtool-native
....
Can't locate Automake/Config.pm in @INC (you may need to install the Automake::Config module) (@INC contains: /mnt/build/poky/fixmestagingdirhost/tmp/work/x86_64-linux/automake-native/1.17/recipe-sysroot-native/usr/share/automake-1.17 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /mnt/build/poky/fixmestagingdirhost/tmp/work/x86_64-linux/libtool-native/2.5.2/recipe-sysroot-native/usr/bin/automake line 48.
| BEGIN failed--compilation aborted at /mnt/build/poky/fixmestagingdirhost/tmp/work/x86_64-linux/libtool-native/2.5.2/recipe-sysroot-native/usr/bin/automake line 48.
....

The error message contains the automake-native RECIPE_SYSROOT_NATIVE:
/mnt/build/poky/fixmestagingdirhost/tmp/work/x86_64-linux/automake-native/1.17/recipe-sysroot-native/usr/share/automake-1.17
it should have been translated to
/mnt/build/poky/fixmestaginghost/tmp/work/x86_64-linux/libtool-native/2.5.2/recipe-sysroot-native/usr/share/automake-1.17
via the FIXMESTAGINGDIRHOST marker.

In a normal build
sysroot-destdir/${RECIPE_SYSROOT_NATIVE}/usr/bin/automake line 31 has
/mnt/build/poky/fixmestagingdirhost/tmp/work/x86_64-linux/automake-native/1.17/recipe-sysroot-native
replaced with the FIXMESTAGINGDIRHOST.  Likewise in
tmp/sysroots-components/x86_64/sysroots-components/x86_64/automake-native/usr/bin/automake.

In my devtooled builds,
sysroot-destdir/${RECIPE_SYSROOT_NATIVE}/usr/bin/automake line 31 has
not been changed and consequently neither has
tmp/sysroots-components/x86_64/sysroots-components/x86_64/automake-native/usr/bin/automake
and
tmp/work/x86_64-linux/libtool-native/2.5.2/recipe-sysroot-native/usr/bin/automake
There are also no fixmepath* files in
tmp/sysroots-components/x86_64/sysroots-components/x86_64/automake-native.

All of the instances of automake (in automake-native's D and
SYSROOT_DESTDIR, in the sysroot-components and in libtool-native's
RECIPE_SYSROOT_NATIVE) is the same hardlinked file both in the
normal and devtooled case.  Not sure whether that is relevant. 

As far as I can tell, the SYSROOT_RECIPE_NATIVE -> FIXMESTAGINGDIRHOST
transformation is done in sstate_hardcode_path, which is not called
for recipes using externalsrc.bbclass because it sets
SSTATE_SKIP_CREATION = 1.
Comment 1 Richard Purdie 2024-10-25 10:20:09 UTC
From IRC so the context is not lost:

11:08:37) olani: RP: When I run 'devtool modify automake' I get an error:
(11:08:40) olani: RP:  ERROR: Command '['rm', '-rf', '/mnt/build/poky/fixmestagingdirhost/tmp/work/core2-64-poky-linux/automake/1.17/devtooltmp-2l27ojdj/workdir/sources-unpack']' returned non-zero exit status 1.
(11:10:15) olani: RP: I don't get that for 'devtool modify quilt', so I think it's something special with automake.  I tried to figure out what was going on, but it was blocking me so I created the workspace by hand instead.
olani olof
Comment 2 Ola Nilsson 2024-10-25 10:33:12 UTC
Trying to eliminate the hand-made automake workspace, I did 

devtool modify automake-native

which worked, but a subsequent

bitbake libtool-native

still fails with the same error.

The files in automake-natives SYSROOT_DESTDIR and tmp/sysroots-component/x86_64/automake-native are still not transformed with the marker.  No fixmepath* files are created.
Comment 3 Randy MacLeod 2025-05-01 14:07:10 UTC
Bulk move of all unassigned 5.2 medium importance bugs to 5.3.
Comment 4 Randy MacLeod 2026-04-01 19:06:07 UTC
Still borken (sic), bump to 6.99

on bitbake/oe-core commits:

7cf11787e   2026-03-29   (HEAD -> master, origin/master, origin/HEAD) doc: document new bitbake-setup init and update features

c56990178b   2026-03-27   (origin/master, origin/HEAD) python3: Add warning comment before PACKAGECONFIG[freethreading]


$ devtool modify automake --> still broken 
# new project
$ devtool modify  automake-native --> works
$ bitbake libtool-native --> fails with:

| DEBUG: SITE files ['endian-little', 'common-linux', 'common-glibc', 'bit-64', 'x86_64-linux', 'common']
| DEBUG: Python function autotools_sitefiles finished
| DEBUG: Executing shell function do_configure
| NOTE: Executing ACLOCAL="aclocal --aclocal-path=/media/rmacleod/gitter/rmacleod/src/distro/yocto/b/yp-15632/tmp/work/x86_64-linux/libtool-native/2.5.4/recipe-sysroot-native/usr/share/aclocal/" autoreconf -Wcross --verbose --install --force --exclude=libtoolize
| autoreconf: export WARNINGS=cross,no-obsolete
| autoreconf: Entering directory '.'
| autoreconf: configure.ac: not using Gettext
| autoreconf: running: aclocal --aclocal-path=/media/rmacleod/gitter/rmacleod/src/distro/yocto/b/yp-15632/tmp/work/x86_64-linux/libtool-native/2.5.4/recipe-sysroot-native/usr/share/aclocal/ --force -I m4
| Can't locate Automake/Config.pm in @INC (you may need to install the Automake::Config module) (@INC contains: /.../yp-15632/tmp/work/x86_64-linux/automake-native/1.18.1/recipe-sysroot-native/usr/share/automake-1.18 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.34.0 /usr/local/share/perl/5.34.0 /usr/lib/x86_64-linux-gnu/perl5/5.34 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.34 /usr/share/perl/5.34 /usr/local/lib/site_perl) at /.../yp-15632/tmp/work/x86_64-linux/libtool-native/2.5.4/recipe-sysroot-native/usr/bin/aclocal line 33.