Perl populate sysroot fails (yocto 2.0.3)
Hi all,
I'm trying to re-create a build that was previously made by someone else (in an effort to reproduce an exact old build). This is based on Yocto 2.0.3. I'm encountering an issue in do_populate_sysroot for Perl, where it fails because /usr/lib/perl5 already exists. (See details below:)
Exception: CalledProcessError: Command 'cd YOCTO_ROOT/build/tmp/work/corei7-64-poky-linux/perl/5.22.0-r0/sysroot-destdir; find . -type d -print | tar -cf - -C YOCTO_ROOT/build/tmp/work/corei7-64-poky-linux/perl/5.22.0-r0/sysroot-destdir -p --files-from - --no-recursion | tar -xf - -C YOCTO_ROOT/build/tmp/sysroots/intel-corei7-64' returned non-zero exit status 2 with output tar: ./usr/lib/perl5: Cannot create symlink to 'perl': File exists
tar: ./usr/lib/perl5: Cannot create symlink to 'perl': File exists
tar: ./usr/lib/perl5: Cannot create symlink to 'perl': File exists
The issue seems to always occur when the sstate-cache is present, so do_populate_sysroot_setscene fails first, then it tries to build from scratch and do_populate_sysroot fails as well. I have seen it in a completely fresh build as well, though this seems intermittent (or I haven't yet nailed down what changes when it does/doesn't happen).
It seems like somehow some recipe ahead of Perl is putting something in /usr/lib/perl5 and perhaps some kind of race condition caused this to be intermittent?
Any input would be greatly appreciated, eventually I will get this onto a newer version of Yocto but first I need to be able to reliably re-create this exact build.
Please find which other recipe is creating /usr/lib/perl5 directory, perhaps you can look through builddir for that. I think we had this kind of sysroot clash with libhugetlbfs and as a workaround may be add DEPENDS = "perl" in that recipe to pre-empt the clash.
Quoted 18 lines · Valen
Hi all,
I'm trying to re-create a build that was previously made by someone else (in an effort to reproduce an exact old build). This is based on Yocto 2.0.3. I'm encountering an issue in
do_populate_sysrootfor Perl, where it fails because/usr/lib/perl5already exists. (See details below:)Exception: CalledProcessError: Command 'cd YOCTO_ROOT/build/tmp/work/corei7-64-poky-linux/perl/5.22.0-r0/sysroot-destdir; find . -type d -print | tar -cf - -C YOCTO_ROOT/build/tmp/work/corei7-64-poky-linux/perl/5.22.0-r0/sysroot-destdir -p --files-from - --no-recursion | tar -xf - -C YOCTO_ROOT/build/tmp/sysroots/intel-corei7-64' returned non-zero exit status 2 with output tar:
./usr/lib/perl5: Cannot create symlink to 'perl': File exists
tar:./usr/lib/perl5: Cannot create symlink to 'perl': File exists
tar:./usr/lib/perl5: Cannot create symlink to 'perl': File existsThe issue seems to always occur when the sstate-cache is present, so
do_populate_sysroot_setscenefails first, then it tries to build from scratch anddo_populate_sysrootfails as well. I have seen it in a completely fresh build as well, though this seems intermittent (or I haven't yet nailed down what changes when it does/doesn't happen).It seems like somehow some recipe ahead of Perl is putting something in
/usr/lib/perl5and perhaps some kind of race condition caused this to be intermittent?Any input would be greatly appreciated, eventually I will get this onto a newer version of Yocto but first I need to be able to reliably re-create this exact build.
Thanks,
I've managed to narrow the problem down to samba - it has perl at sysroot/dest-dir/usr/lib/perl5.
However for the life of me I can't figure out how to force it to run after the actual Perl recipe. I've tried adding DEPENDS += "perl" in a .bbappend file (which bitbake-layers show-appends recognizes) and just directly editing the recipe. Neither seem to make it stick. The first run right after the change works (since it's able to use the cached perl, and waits to rebuild samba) but subsequent runs (once samba is in the cache) always fail. For now I'm working around it by manually purging samba from the cache after each run, but it would be nice to solve this properly at some point as well.
If anyone has any tips on where to look next to force the build order, that would be great.
Thanks,
Valen
Quoted 6 lines · Valen
Thanks,
I've managed to narrow the problem down to samba - it has perl at sysroot/dest-dir/usr/lib/perl5.
However for the life of me I can't figure out how to force it to run after the actual Perl recipe. I've tried adding DEPENDS += "perl" in a .bbappend file (which bitbake-layers show-appends recognizes) and just directly editing the recipe. Neither seem to make it stick. The first run right after the change works (since it's able to use the cached perl, and waits to rebuild samba) but subsequent runs (once samba is in the cache) always fail. For now I'm working around it by manually purging samba from the cache after each run, but it would be nice to solve this properly at some point as well.
If anyone has any tips on where to look next to force the build order, that would be great.
perhaps adding something like below to samba bbappend might help
do_populate_sysroot[depends] += "perl:do_populate_sysroot"
Quoted 8 lines
Thanks,
Valen
Perfect! Thanks for your help.
I had to add both
do_populate_sysroot[depends] += "perl:do_populate_sysroot"
AND
do_populate_sysroot_setscene[depends] += "perl:do_populate_sysroot_setscene"
and now things are working great!