Skip to contentSkip to conversation

Broken parallel build of gcc*

DISCUSSION Enrico Scholz 3 participants 13 messages Jul 20, 2012 – Jul 22, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

some of the recent changes seem to break the parallel build of the gcc* recipes which are sharing a same source directory:

| $ ./bitbake gcc-cross-initial gcc-cross-intermediate gcc-cross -c cleansstate
| $ BB_NUMBER_THREADS=3 ./bitbake gcc-cross-initial gcc-cross-intermediate gcc-cross
| ...
| NOTE: package gcc-cross-initial-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Started
| NOTE: package gcc-cross-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Started
| NOTE: package gcc-cross-initial-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Succeeded
| ERROR: Error executing a python function in ...recipes-devtools/gcc/gcc-cross_4.7.bb:
| OSError: [Errno 39] Directory not empty: '...tmp/work-shared/gcc-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7/git/'
| NOTE: package gcc-cross-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Failed

It seems that the work-shared/ directory is not locked and cleaned when starting the second unpack.

Enrico

#1 lore raw
Quoted 15 lines · Enrico Scholz

Hi,

some of the recent changes seem to break the parallel build of the gcc* recipes which are sharing a same source directory:

| $ ./bitbake gcc-cross-initial gcc-cross-intermediate gcc-cross -c cleansstate
| $ BB_NUMBER_THREADS=3 ./bitbake gcc-cross-initial gcc-cross-intermediate gcc-cross
| ...
| NOTE: package gcc-cross-initial-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Started
| NOTE: package gcc-cross-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Started
| NOTE: package gcc-cross-initial-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Succeeded
| ERROR: Error executing a python function in ...recipes-devtools/gcc/gcc-cross_4.7.bb:
| OSError: [Errno 39] Directory not empty: '...tmp/work-shared/gcc-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7/git/'
| NOTE: package gcc-cross-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Failed
Quoted 2 lines

It seems that the work-shared/ directory is not locked and cleaned when starting the second unpack.

I can confirm the same
http://lists.linuxtogo.org/pipermail/openembedded-core/2012-July/026174.html

Cheers,

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#2 lore raw
Quoted 16 lines · Martin Jansa
Quoted 15 lines · Enrico Scholz

Hi,

some of the recent changes seem to break the parallel build of the gcc* recipes which are sharing a same source directory:

| $ ./bitbake gcc-cross-initial gcc-cross-intermediate gcc-cross -c cleansstate
| $ BB_NUMBER_THREADS=3 ./bitbake gcc-cross-initial gcc-cross-intermediate gcc-cross
| ...
| NOTE: package gcc-cross-initial-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Started
| NOTE: package gcc-cross-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Started
| NOTE: package gcc-cross-initial-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Succeeded
| ERROR: Error executing a python function in ...recipes-devtools/gcc/gcc-cross_4.7.bb:
| OSError: [Errno 39] Directory not empty: '...tmp/work-shared/gcc-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7/git/'
| NOTE: package gcc-cross-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r7: task do_unpack: Failed
Quoted 5 lines
Quoted 2 lines

It seems that the work-shared/ directory is not locked and cleaned when starting the second unpack.

I can confirm the same
http://lists.linuxtogo.org/pipermail/openembedded-core/2012-July/026174.html

The autobuilder is not seeing this and I'm not seeing it locally either.

This would imply there is some difference in configuration which is triggering it. rm_work* is a possibility, as could ASSUME_PROVIDED settings potentially although unlikely.

Encrico: Which DISTRO are you using and do you use rm_work*.bbclass?

Cheers,

Richard

#3 lore raw

Richard Purdie <[email protected]>

Quoted 1 line · writes:

Encrico: Which DISTRO are you using and do you use rm_work*.bbclass?

yes; rm_old_work seems to cause the problem. Task uses ${PN} and was declared with

addtask rm_old_work before do_unpack

which causes different base hashes.

Is there a way to exclude such tasks from the signature handling?

Enrico

#4 lore raw
Quoted 9 lines · Enrico Scholz

Richard Purdie <[email protected]>

Quoted 1 line · writes:

Encrico: Which DISTRO are you using and do you use rm_work*.bbclass?

yes; rm_old_work seems to cause the problem. Task uses ${PN} and was declared with

Quoted 6 lines

addtask rm_old_work before do_unpack

which causes different base hashes.

Is there a way to exclude such tasks from the signature handling?

The easiest option is probably something like:

do_rm_old_works[vardepexclude] = "PN"

but this will trigger rebuilds depending on whether rm_work_old is turned on or off.

The more advanced way to fix this would be in:

http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/lib/oe/sstatesig.py

probably something like:

if dep.endswith("do_rm_old_works"):
return False

before the first check.

Cheers,

Richard

#5 lore raw

Richard Purdie <[email protected]>

Quoted 5 lines · writes:
Quoted 1 line

Is there a way to exclude such tasks from the signature handling?

The easiest option is probably something like:

do_rm_old_works[vardepexclude] = "PN"

I tried this but it is not really an option because there must be added a lot of completely unrelated variables:

 $ bitbake-diffsigs gcc-runtime*do_rm_old_work.sigdata* libgcc*do_rm_old_work.sigdata*

Dependency on variable gcc_cv_collect2_libs was added Variable CPPFLAGS value changed from to ${TARGET_CPPFLAGS}

(none of these is used within do_rm_old_works).

Enrico

#6 lore raw
Quoted 13 lines · Enrico Scholz

Richard Purdie <[email protected]>

Quoted 5 lines · writes:
Quoted 1 line

Is there a way to exclude such tasks from the signature handling?

The easiest option is probably something like:

do_rm_old_works[vardepexclude] = "PN"

I tried this but it is not really an option because there must be added a lot of completely unrelated variables:

Quoted 6 lines
 $ bitbake-diffsigs gcc-runtime*do_rm_old_work.sigdata* libgcc*do_rm_old_work.sigdata*

Dependency on variable gcc_cv_collect2_libs was added Variable CPPFLAGS value changed from to ${TARGET_CPPFLAGS}

(none of these is used within do_rm_old_works).

Can you point me at a copy of the class your using and the full diffsigs output please?

Thanks,

Richard

#7 lore raw
Quoted 16 lines · Richard Purdie
Quoted 15 lines · Enrico Scholz

Richard Purdie <[email protected]>

Quoted 5 lines · writes:
Quoted 1 line

Is there a way to exclude such tasks from the signature handling?

The easiest option is probably something like:

do_rm_old_works[vardepexclude] = "PN"

I tried this but it is not really an option because there must be added a lot of completely unrelated variables:

 $ bitbake-diffsigs gcc-runtime*do_rm_old_work.sigdata* libgcc*do_rm_old_work.sigdata*
Quoted 7 lines
Quoted 4 lines

Dependency on variable gcc_cv_collect2_libs was added Variable CPPFLAGS value changed from to ${TARGET_CPPFLAGS}

(none of these is used within do_rm_old_works).

Can you point me at a copy of the class your using and the full diffsigs output please?

Mine is here
http://git.shr-project.org/git/?p=meta-smartphone.git;a=blob;f=meta-shr/classes/rm_old_work.bbclass;h=db13aa677958a52cd2c1b9efd6b90e38eadba41d;hb=refs/heads/shr

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#8 lore raw
In reply to Richard Purdie

Richard Purdie <[email protected]>

Quoted 10 lines · writes:
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Is there a way to exclude such tasks from the signature handling?

The easiest option is probably something like:

do_rm_old_works[vardepexclude] = "PN"

I tried this but it is not really an option...

Can you point me at a copy of the class your using and the full diffsigs output please?

---
do_rm_old_work() {
:
}
addtask rm_old_work before do_unpack
---

suffices; the diffsigs difference is caused by different sh environment between target, -native and -cross recipes.

I solved it for now by modifying sstatesig.py but a more generic way would be nice.

Enrico

#9 lore raw
In reply to Enrico Scholz

Enrico Scholz <enrico.scholz-wttK6gPy29v+Hn7q9Vec/[email protected]>

Quoted 3 lines · writes:
Quoted 1 line

Encrico: Which DISTRO are you using and do you use rm_work*.bbclass?

yes; rm_old_work seems to cause the problem.

The signature stuff was one problem; there is another, more trivial (but probably more difficult) one:

Adding a task like

| addtask do_rm_old_work before do_unpack

causes stampfile dependencies for the shared gcc like

gcc.do_unpack -> gcc-initial.do_rm_old_work
gcc.do_unpack -> gcc-intermediate.do_rm_old_work

E.g. the earlier 'do_rm_old_work' stamps are recipe dependent but the later 'do_unpack' are shared between recipes. Bitbake reexecutes do_unpack when the corresponding do_rm_old_work is newer which is causing the seen errors.

For now, I will declare the task as 'before do_compile'.

Enrico

#10 lore raw
Quoted 17 lines · Enrico Scholz

Enrico Scholz <enrico.scholz-wttK6gPy29v+Hn7q9Vec/[email protected]>

Quoted 3 lines · writes:
Quoted 1 line

Encrico: Which DISTRO are you using and do you use rm_work*.bbclass?

yes; rm_old_work seems to cause the problem.

The signature stuff was one problem; there is another, more trivial (but probably more difficult) one:

Adding a task like

| addtask do_rm_old_work before do_unpack

causes stampfile dependencies for the shared gcc like

Quoted 7 lines

gcc.do_unpack -> gcc-initial.do_rm_old_work
gcc.do_unpack -> gcc-intermediate.do_rm_old_work

E.g. the earlier 'do_rm_old_work' stamps are recipe dependent but the later 'do_unpack' are shared between recipes. Bitbake reexecutes do_unpack when the corresponding do_rm_old_work is newer which is causing the seen errors.

do_rm_old_work[stamp-base] = "${SS}"

in the gcc recipe would probably help that. Your alternative solution obviously works too.

Cheers,

Richard

#11 lore raw

Richard Purdie <[email protected]>

Quoted 1 line · writes:

do_rm_old_work[stamp-base] = "${SS}"

will not work because do_rm_old_work depends on ${PN} (it cleans the packages + packages-split directories of previously built packages in ${WORKDIR}). Executing it for only one gcc* recipe will keep the directories of the other recipes.

Enrico

#12 lore raw
Quoted 10 lines · Enrico Scholz

Richard Purdie <[email protected]>

Quoted 1 line · writes:

do_rm_old_work[stamp-base] = "${SS}"

will not work because do_rm_old_work depends on ${PN} (it cleans the packages + packages-split directories of previously built packages in ${WORKDIR}). Executing it for only one gcc* recipe will keep the directories of the other recipes.

This appears to be a situation I can't win with then...

Cheers,

Richard