[OE-core] [PATCH 1/1] sstate.bbclass: fix parallel building issue

Richard Purdie richard.purdie at linuxfoundation.org
Thu Sep 12 15:39:33 UTC 2013


On Tue, 2013-08-13 at 16:20 +0800, rongqing.li at windriver.com wrote:
> From: "Roy.Li" <rongqing.li at windriver.com>
> 
> sstate_package creates hardlink from sysroot to SSTATE_BUILDDIR, then
> sstate_create_package will store SSTATE_BUILDDIR into a archive file by
> tar, but once other packages install the same file into sysroot, the
> creating the archive file will fail with below error:
> 
>     DEBUG: Executing shell function sstate_create_package
>     tar: x86_64-linux/usr/share/aclocal/xorg-macros.m4: file changed as we read it
> 
> This kind of error is harmless, use --ignore-failed-read to ignore it.
> 
> Signed-off-by: Roy.Li <rongqing.li at windriver.com>


I've dug into this issue a bit and having looked a the code in tar for
this warning, I believe this is the right fix.

Throughout the system we now hardlink files together and the timestamps
of the files can change when the number of hardlinks is changed so its
possible to race against various parts of the system. The aclocal-copy
is the most frequently used so we hit it there easiest.

So I'm now in favour of taking this patch. We could improve aclocal but
that is really a separate issue.

Cheers,

Richard

> ---
>  meta/classes/sstate.bbclass |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
> index c1ca54b..3e2fedd 100644
> --- a/meta/classes/sstate.bbclass
> +++ b/meta/classes/sstate.bbclass
> @@ -565,7 +565,7 @@ sstate_create_package () {
>  	TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX`
>  	# Need to handle empty directories
>  	if [ "$(ls -A)" ]; then
> -		tar -czf $TFILE *
> +		tar --ignore-failed-read -czf $TFILE *
>  	else
>  		tar -cz --file=$TFILE --files-from=/dev/null
>  	fi





More information about the Openembedded-core mailing list