Patchwork [1/1] sstate.bbclass: check before open the manifest

login
register
mail settings
Submitter Robert Yang
Date Aug. 29, 2013, 1:13 p.m.
Message ID <454944e7bd4c831bea934852393d8e16abe1d5ff.1377781793.git.liezhi.yang@windriver.com>
Download mbox | patch
Permalink /patch/56869/
State New
Headers show

Comments

Robert Yang - Aug. 29, 2013, 1:13 p.m.
The python stack trace would be printed if we:

$ bitbake make (the make-3.82 will be built)
// Edit make.inc
$ bitbake make-3.81
[snip]
 *** 0004:    mfile = open(manifest)
     0005:    entries = mfile.readlines()
     0006:    mfile.close()
     0007:
     0008:    for entry in entries:
Exception: IOError: [Errno 2] No such file or directory: xxx
[snip]

This because the make-3.81 and make-3.82 are being built at the same
time, the manifest may have been removed by make-3.82, but make-3.81
still opens it, so the error happens.

Check before open the manifest would fix the problem.

[YOCTO #5067]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/classes/sstate.bbclass |    3 +++
 1 file changed, 3 insertions(+)
Richard Purdie - Aug. 29, 2013, 5 p.m.
On Thu, 2013-08-29 at 09:13 -0400, Robert Yang wrote:
> The python stack trace would be printed if we:
> 
> $ bitbake make (the make-3.82 will be built)
> // Edit make.inc
> $ bitbake make-3.81

This is at best hiding the real problem. Why is bitbake building
make-3.82 when you asked for make-3.81?

I tried this here and also see the warning:

ERROR: Multiple .bb files are due to be built which each provide make
(/media/build1/poky/meta/recipes-devtools/make/make_3.81.bb /media/build1/poky/meta/recipes-devtools/make/make_3.82.bb).
 This usually means one provides something the other doesn't and should.

so bitbake is basically telling you there is a problem already. So there
are two issues:

a) Why is make 3.82 being built?
b) If multiple identical PNs are being built we probably should hard
error out since its not supported in the slightest. The sstate race you
mention is the least of the problems :(.

Cheers,

Richard
Robert Yang - Aug. 30, 2013, 1:24 a.m.
On 08/30/2013 01:00 AM, Richard Purdie wrote:
> On Thu, 2013-08-29 at 09:13 -0400, Robert Yang wrote:
>> The python stack trace would be printed if we:
>>
>> $ bitbake make (the make-3.82 will be built)
>> // Edit make.inc
>> $ bitbake make-3.81
>
> This is at best hiding the real problem. Why is bitbake building
> make-3.82 when you asked for make-3.81?
>
> I tried this here and also see the warning:
>
> ERROR: Multiple .bb files are due to be built which each provide make
> (/media/build1/poky/meta/recipes-devtools/make/make_3.81.bb /media/build1/poky/meta/recipes-devtools/make/make_3.82.bb).
>   This usually means one provides something the other doesn't and should.
>
> so bitbake is basically telling you there is a problem already. So there
> are two issues:
>

What I thought was that let the user know the normal error, but we can do
more to fix it as you pointed out.

> a) Why is make 3.82 being built?

Ah, yes, that's problem, I will do more investigation.

> b) If multiple identical PNs are being built we probably should hard
> error out since its not supported in the slightest. The sstate race you
> mention is the least of the problems :(.
>

OK, I will try to fix such a case:

bitbake make-3.81 make-3.82

// Robert

> Cheers,
>
> Richard
>
>
>
Richard Purdie - Aug. 30, 2013, 3:29 p.m.
On Fri, 2013-08-30 at 09:24 +0800, Robert Yang wrote:
> 
> On 08/30/2013 01:00 AM, Richard Purdie wrote:
> > On Thu, 2013-08-29 at 09:13 -0400, Robert Yang wrote:
> >> The python stack trace would be printed if we:
> >>
> >> $ bitbake make (the make-3.82 will be built)
> >> // Edit make.inc
> >> $ bitbake make-3.81
> >
> > This is at best hiding the real problem. Why is bitbake building
> > make-3.82 when you asked for make-3.81?
> >
> > I tried this here and also see the warning:
> >
> > ERROR: Multiple .bb files are due to be built which each provide make
> > (/media/build1/poky/meta/recipes-devtools/make/make_3.81.bb /media/build1/poky/meta/recipes-devtools/make/make_3.82.bb).
> >   This usually means one provides something the other doesn't and should.
> >
> > so bitbake is basically telling you there is a problem already. So there
> > are two issues:
> >
> 
> What I thought was that let the user know the normal error, but we can do
> more to fix it as you pointed out.
> 
> > a) Why is make 3.82 being built?
> 
> Ah, yes, that's problem, I will do more investigation.
> 
> > b) If multiple identical PNs are being built we probably should hard
> > error out since its not supported in the slightest. The sstate race you
> > mention is the least of the problems :(.
> >
> 
> OK, I will try to fix such a case:
> 
> bitbake make-3.81 make-3.82

I think this should just give an error.

Cheers,

Richard

Patch

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index c86f393..6e71086 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -302,6 +302,9 @@  def sstate_clean_cachefiles(d):
 def sstate_clean_manifest(manifest, d):
     import oe.path
 
+    if not os.path.exists(manifest):
+        return True
+
     mfile = open(manifest)
     entries = mfile.readlines()
     mfile.close()