Small update:
This hang is definitely caused by:
I've reproduced this issue with master 5 times with:
oe-selftest -r buildoptions.ImageOptionsTests.test_ccache_tool
then after reverting 00aeb84a5e7c6d4293fb4cd30dd1e28d60c6aac5 it passed 3 times and failed again when I've restored this commit.
I have huge 852M install.man-make-native-4.3.j2.trace.d.log
where it looks like make-native ends in neverending loop, make from gentoo has the same issue (when just called with full path as /usr/bin/make -d --trace -j 2 install.man 'DESTDIR=/OE/build/poky/build-st/tmp/work/x86_64-linux/perl-native/5.36.0-r0/image' 2>&1 | tee install.man-make-gentoo-4.3.j2.trace.d.log).
With -j 1 in the same directory it works fine.
perl-native/5.36.0-r0/perl-5.36.0 $ grep Considering.target.file..nonxs_ext install.man-make-gentoo-4.3.j2.trace.d.log | wc -l
7621
The relevant (I hope) part of the log looks like:
Pruning file 'ext/Sys-Hostname/pm_to_blib'.
Pruning file 'ext/XS-APItest/pm_to_blib'.
Pruning file 'ext/XS-Typemap/pm_to_blib'.
Finished prerequisites of target file 'dynamic_ext'.
The prerequisites of 'dynamic_ext' are being made.
Considering target file 'static_ext'.
File 'static_ext' was considered already.
Finished prerequisites of target file 'extensions'.
The prerequisites of 'extensions' are being made.
Finished prerequisites of target file 'modules'.
The prerequisites of 'modules' are being made.
Finished prerequisites of target file 'pod/perltoc.pod'.
The prerequisites of 'pod/perltoc.pod' are being made.
Pruning file 'miniperl'.
Finished prerequisites of target file 'install.man'.
The prerequisites of 'install.man' are being made.
Live child 0x55a28372eaf0 (ext/XS-Typemap/Makefile) PID 517626
Generating a Unix-style Makefile
Writing Makefile for XS::Typemap
Reaping winning child 0x55a28372eaf0 PID 517626
Removing child 0x55a28372eaf0 PID 517626 from chain.
Considering target file 'install.man'.
File 'install.man' does not exist.
Considering target file 'installman'.
File 'installman' was considered already.
Considering target file 'pod/perltoc.pod'.
Considering target file 'pod/buildtoc'.
File 'pod/buildtoc' was considered already.
Considering target file 'miniperl'.
File 'miniperl' was considered already.
Considering target file 'modules'.
File 'modules' does not exist.
Considering target file 'extensions'.
File 'extensions' does not exist.
Considering target file 'cflags'.
File 'cflags' was considered already.
Considering target file 'nonxs_ext'.
File 'nonxs_ext' does not exist.
Considering target file 'cpan/Archive-Tar/pm_to_blib'.
File 'cpan/Archive-Tar/pm_to_blib' was considered already.
Considering target file 'cpan/autodie/pm_to_blib'.
File 'cpan/autodie/pm_to_blib' was considered already.
......
Considering target file 'dist/ExtUtils-CBuilder/pm_to_blib'.
File 'dist/ExtUtils-CBuilder/pm_to_blib' was considered already.
Considering target file 'dist/ExtUtils-ParseXS/pm_to_blib'.
Considering target file 'dist/ExtUtils-ParseXS/Makefile'.
File 'dist/ExtUtils-ParseXS/Makefile' was considered already.
Considering target file 'dist/ExtUtils-ParseXS/ppport.h'.
Considering target file 'dist/Devel-PPPort/ppport.h'.
Considering target file 'dist/Devel-PPPort/PPPort.pm'.
Considering target file 'dist/Devel-PPPort/pm_to_blib'.
Considering target file 'dist/Devel-PPPort/Makefile'.
File 'dist/Devel-PPPort/Makefile' was considered already.
Considering target file 'DynaLoader.o'.
Considering target file 'ext/DynaLoader/pm_to_blib'.
Finished prerequisites of target file 'ext/DynaLoader/pm_to_blib'.
The prerequisites of 'ext/DynaLoader/pm_to_blib' are being made.
Finished prerequisites of target file 'DynaLoader.o'.
The prerequisites of 'DynaLoader.o' are being made.
Pruning file 'DynaLoader.o'.
Pruning file 'dist/ExtUtils-CBuilder/pm_to_blib'.
Finished prerequisites of target file 'dist/Devel-PPPort/pm_to_blib'.
The prerequisites of 'dist/Devel-PPPort/pm_to_blib' are being made.
Finished prerequisites of target file 'dist/Devel-PPPort/PPPort.pm'.
The prerequisites of 'dist/Devel-PPPort/PPPort.pm' are being made.
Pruning file 'miniperl'.
Finished prerequisites of target file 'dist/Devel-PPPort/ppport.h'.
The prerequisites of 'dist/Devel-PPPort/ppport.h' are being made.
Finished prerequisites of target file 'dist/ExtUtils-ParseXS/ppport.h'.
The prerequisites of 'dist/ExtUtils-ParseXS/ppport.h' are being made.
Finished prerequisites of target file 'dist/ExtUtils-ParseXS/pm_to_blib'.
The prerequisites of 'dist/ExtUtils-ParseXS/pm_to_blib' are being made.
Considering target file 'dist/Filter-Simple/pm_to_blib'.
File 'dist/Filter-Simple/pm_to_blib' was considered already.
Considering target file 'dist/FindBin/pm_to_blib'.
.....
Considering target file 'ext/Tie-Memoize/pm_to_blib'.
File 'ext/Tie-Memoize/pm_to_blib' was considered already.
Finished prerequisites of target file 'nonxs_ext'.
The prerequisites of 'nonxs_ext' are being made.
Considering target file 'dynamic_ext'.
File 'dynamic_ext' does not exist.
Considering target file 'cpan/Compress-Raw-Bzip2/pm_to_blib'.
Considering target file 'cpan/Compress-Raw-Bzip2/Makefile'.
File 'cpan/Compress-Raw-Bzip2/Makefile' was considered already.
Pruning file 'DynaLoader.o'.
Pruning file 'dist/ExtUtils-CBuilder/pm_to_blib'.
Finished prerequisites of target file 'cpan/Compress-Raw-Bzip2/pm_to_blib'.
The prerequisites of 'cpan/Compress-Raw-Bzip2/pm_to_blib' are being made.
Considering target file 'cpan/Compress-Raw-Zlib/pm_to_blib'.
....
The prerequisites of 'ext/XS-Typemap/pm_to_blib' are being made.
Finished prerequisites of target file 'dynamic_ext'.
The prerequisites of 'dynamic_ext' are being made.
Considering target file 'static_ext'.
File 'static_ext' was considered already.
Considering target file 'nonxs_ext'.
File 'nonxs_ext' does not exist.
Pruning file 'cpan/Archive-Tar/pm_to_blib'.
Pruning file 'cpan/autodie/pm_to_blib'.
Pruning file 'cpan/AutoLoader/pm_to_blib'.
....
Pruning file 'ext/Tie-Hash-NamedCapture/pm_to_blib'.
Pruning file 'ext/Tie-Memoize/pm_to_blib'.
Finished prerequisites of target file 'nonxs_ext'.
The prerequisites of 'nonxs_ext' are being made.
Considering target file 'dynamic_ext'.
File 'dynamic_ext' does not exist.
Pruning file 'cpan/Compress-Raw-Bzip2/pm_to_blib'.
Pruning file 'cpan/Compress-Raw-Zlib/pm_to_blib'.
...
Pruning file 'ext/XS-APItest/pm_to_blib'.
Pruning file 'ext/XS-Typemap/pm_to_blib'.
Finished prerequisites of target file 'dynamic_ext'.
The prerequisites of 'dynamic_ext' are being made.
Considering target file 'static_ext'.
File 'static_ext' was considered already.
Finished prerequisites of target file 'extensions'.
The prerequisites of 'extensions' are being made.
Considering target file 'extensions'.
File 'extensions' does not exist.
Pruning file 'cflags'.
Pruning file 'nonxs_ext'.
Pruning file 'dynamic_ext'.
Pruning file 'static_ext'.
Considering target file 'nonxs_ext'.
File 'nonxs_ext' does not exist.
Pruning file 'cpan/Archive-Tar/pm_to_blib'.
Pruning file 'cpan/autodie/pm_to_blib'.
....
Pruning file 'ext/XS-APItest/pm_to_blib'.
Pruning file 'ext/XS-Typemap/pm_to_blib'.
Finished prerequisites of target file 'dynamic_ext'.
The prerequisites of 'dynamic_ext' are being made.
Considering target file 'static_ext'.
File 'static_ext' was considered already.
Finished prerequisites of target file 'extensions'.
The prerequisites of 'extensions' are being made.
Finished prerequisites of target file 'modules'.
The prerequisites of 'modules' are being made.
Considering target file 'extra.pods'.
File 'extra.pods' was considered already.
Considering target file 'pod/perlapi.pod'.
File 'pod/perlapi.pod' was considered already.
Considering target file 'pod/perlintern.pod'.
File 'pod/perlintern.pod' was considered already.
Considering target file 'pod/perlmodlib.pod'.
File 'pod/perlmodlib.pod' was considered already.
Considering target file 'pod/perluniprops.pod'.
File 'pod/perluniprops.pod' was considered already.
Considering target file 'pod/perl5360delta.pod'.
File 'pod/perl5360delta.pod' was considered already.
Considering target file 'modules'.
File 'modules' does not exist.
Pruning file 'extensions'.
Considering target file 'extensions'.
File 'extensions' does not exist.
Pruning file 'cflags'.
Pruning file 'nonxs_ext'.
Pruning file 'dynamic_ext'.
Pruning file 'static_ext'.
Considering target file 'nonxs_ext'.
File 'nonxs_ext' does not exist.
Pruning file 'cpan/Archive-Tar/pm_to_blib'.
Pruning file 'cpan/autodie/pm_to_blib'.
....
Pruning file 'ext/XS-APItest/pm_to_blib'.
Pruning file 'ext/XS-Typemap/pm_to_blib'.
Finished prerequisites of target file 'dynamic_ext'.
The prerequisites of 'dynamic_ext' are being made.
Considering target file 'static_ext'.
File 'static_ext' was considered already.
Finished prerequisites of target file 'extensions'.
The prerequisites of 'extensions' are being made.
Finished prerequisites of target file 'modules'.
The prerequisites of 'modules' are being made.
Finished prerequisites of target file 'pod/perltoc.pod'.
The prerequisites of 'pod/perltoc.pod' are being made.
Pruning file 'miniperl'.
Finished prerequisites of target file 'install.man'.
The prerequisites of 'install.man' are being made.
Considering target file 'install.man'.
File 'install.man' does not exist.
Considering target file 'installman'.
File 'installman' was considered already.
Considering target file 'pod/perltoc.pod'.
Considering target file 'pod/buildtoc'.
File 'pod/buildtoc' was considered already.
Considering target file 'miniperl'.
File 'miniperl' was considered already.
Considering target file 'modules'.
File 'modules' does not exist.
Considering target file 'extensions'.
File 'extensions' does not exist.
Considering target file 'cflags'.
File 'cflags' was considered already.
Considering target file 'nonxs_ext'.
File 'nonxs_ext' does not exist.
Considering target file 'cpan/Archive-Tar/pm_to_blib'.
File 'cpan/Archive-Tar/pm_to_blib' was considered already.
and then it repeats in never-ending loop, only make using 100% CPU and even on smaller log:
120M install.man-make-gentoo-4.3.j2.trace.d.log
it considers nonxs_ext too many times (before I've killed the make):
x86_64-linux/perl-native/5.36.0-r0/perl-5.36.0 $ grep Considering.target.file..nonxs_ext install.man-make-gentoo-4.3.j2.trace.d.log | wc -l
7621
Will try to narrow this even more and produce the debug/trace output from working case for comparison, just wanted to share the update in case someone sees what's wrong right away.
I still wasn't able to reproduce this outside poky build "bitbake libgcc-initial -f -c compile" with INHERIT += "ccache" in local.conf in build dir without sstate-cache populated isn't enough to reproduce what buildoptions.ImageOptionsTests.test_ccache_tool somehow triggers, but YMMV, let me know if you have seen this or can reproduce it with selftest as well.
Cheers,