All of lore.kernel.org
 help / color / mirror / Atom feed
* PSTAGE_MIRROR not working with file:// uri
@ 2011-07-15  8:48 Aeschbacher, Fabrice
  2011-07-15 20:04 ` Tom Rini
  0 siblings, 1 reply; 3+ messages in thread
From: Aeschbacher, Fabrice @ 2011-07-15  8:48 UTC (permalink / raw)
  To: openembedded-devel@lists.openembedded.org

Hi,

[bitbake 1.12 / OE 2010.12]

I am facing a quite strange issue with packaged-staging (INHERIT += "packaged-staging" in local.conf) when trying to use a pre-built toolchain.

1. First I build the toolchain:
  $ bitbake meta-toolchain

2. Then I save out the ${PSTAGE_DIR} somewhere and remove ${TMPDIR}:
  $ rsync -a --delete ${PSTAGE_DIR} /path/to/pstage_mirror
  $ rm -rf ${TMPDIR}

3. Now I restore only the staging dir, and build something:
  $ mkdir -p ${PSTAGE_DIR}
  $ rsync -a /path/to/pstage_mirror ${PSTAGE_DIR}
  $ time bitbake busybox

  => works fine: packaged staging is working as expected, the toolchain is not rebuilt and busybox is built in few minutes.

4. Now, rather than manually restoring the ${PSTAGE_DIR}, I want to use PSTAGE_MIRROR. The point is, if the URI for PSTAGE_MIRROR is anything but file://, it works fine, e.g.:
  ## put PSTAGE_MIRROR = http://localhost:pstage_mirror in local.conf, and 
  ## configure the web server to make this uri points to /path/to/pstage_mirror
  $ rm -rf ${TMPDIR}
  $ time bitbake busybox
  
  => it works fine.
But if I set PSTAGE_MIRROR = "file:///path/to/pstage_mirror"

  => does not work, the prebuilt packages are not used and everything gets re-compiled.



I looked inside the class packaged-staging.bbclass, to try to figure out the problem.
The pre-built package is fetched during do_setscene. In the function packagestage_scenefunc(), there is following code:

    stagepkg = bb.data.expand("${PSTAGE_PKG}", d)
    if not os.path.exists(stagepkg):
        staging_fetch(stagepkg, d)

    if os.path.exists(stagepkg):
        ...

stagepkg points to the ipk file in ${PSTAGE_DIR} (which is not yet present).
The problem is, after returning from staging_fetch(), the file is still not present:

        # Try a fetch from the pstage mirror, if it fails just return and
        # we will build the package
        bb.debug(1, "Attempting to fetch staging package %s" % (bn))
        try:
            bb.fetch.init([srcuri], pd)
            bb.fetch.go(pd, [srcuri])
        except Exception, ex:
            bb.debug(1, "Failed to fetch staging package %s: %s" % (bn, ex))
        else:
            bb.debug(1, "Fetched staging package %s" % bn)

=> bb.fetch.go() does not throw an exception, _but_ the file has not been fetched.


I guess this must already have worked, mainly because of this comment in the .bbclass:

  # To use the prebuilt pstage packages, save them away..
  # $ rsync --delete -a tmp/pstage/ /there/oe/build/pstage_mirror
  # .. and use it as mirror in your conf/local.conf:
  # PSTAGE_MIRROR = "file:///there/oe/build/pstage_mirror"

So I wondered if someone can confirm that PSTAGE_MIRROR has already worked with a file:/// uri,
and could see what I am missing here.

With Kind regards,
   Fabrice



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PSTAGE_MIRROR not working with file:// uri
  2011-07-15  8:48 PSTAGE_MIRROR not working with file:// uri Aeschbacher, Fabrice
@ 2011-07-15 20:04 ` Tom Rini
  2011-07-16 11:15   ` Aeschbacher, Fabrice
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Rini @ 2011-07-15 20:04 UTC (permalink / raw)
  To: openembedded-devel

On 07/15/2011 01:48 AM, Aeschbacher, Fabrice wrote:
> Hi,
> 
> [bitbake 1.12 / OE 2010.12]
> 
> I am facing a quite strange issue with packaged-staging (INHERIT += "packaged-staging" in local.conf) when trying to use a pre-built toolchain.
[snip]
> I guess this must already have worked, mainly because of this comment in the .bbclass:
> 
>   # To use the prebuilt pstage packages, save them away..
>   # $ rsync --delete -a tmp/pstage/ /there/oe/build/pstage_mirror
>   # .. and use it as mirror in your conf/local.conf:
>   # PSTAGE_MIRROR = "file:///there/oe/build/pstage_mirror"
> 
> So I wondered if someone can confirm that PSTAGE_MIRROR has already worked with a file:/// uri,
> and could see what I am missing here.

Internally we have code like http://pastebin.com/cb1Nen97 and file URIs
work.  Try merging the two and see if that fixes things?

-- 
Tom Rini
Mentor Graphics Corporation



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PSTAGE_MIRROR not working with file:// uri
  2011-07-15 20:04 ` Tom Rini
@ 2011-07-16 11:15   ` Aeschbacher, Fabrice
  0 siblings, 0 replies; 3+ messages in thread
From: Aeschbacher, Fabrice @ 2011-07-16 11:15 UTC (permalink / raw)
  To: openembedded-devel@lists.openembedded.org

Hi Tom,

Thanks, it helped. The key in your code was to return bb.fetch.localpath() - which was not the case in the version we used (release-2010.12)

Anyone interessed in the patch? As far as I can see, this has not been fixed yet in openembedded HEAD.

With kind regards,
Fabrice Aeschbacher


> -----Ursprüngliche Nachricht-----
> Von: openembedded-devel-bounces@lists.openembedded.org 
> [mailto:openembedded-devel-bounces@lists.openembedded.org] Im 
> Auftrag von Tom Rini
> Gesendet: Freitag, 15. Juli 2011 22:04
> An: openembedded-devel@lists.openembedded.org
> Betreff: Re: [oe] PSTAGE_MIRROR not working with file:// uri
> 
> On 07/15/2011 01:48 AM, Aeschbacher, Fabrice wrote:
> > Hi,
> > 
> > [bitbake 1.12 / OE 2010.12]
> > 
> > I am facing a quite strange issue with packaged-staging 
> (INHERIT += "packaged-staging" in local.conf) when trying to 
> use a pre-built toolchain.
> [snip]
> > I guess this must already have worked, mainly because of 
> this comment in the .bbclass:
> > 
> >   # To use the prebuilt pstage packages, save them away..
> >   # $ rsync --delete -a tmp/pstage/ /there/oe/build/pstage_mirror
> >   # .. and use it as mirror in your conf/local.conf:
> >   # PSTAGE_MIRROR = "file:///there/oe/build/pstage_mirror"
> > 
> > So I wondered if someone can confirm that PSTAGE_MIRROR has 
> already worked with a file:/// uri,
> > and could see what I am missing here.
> 
> Internally we have code like http://pastebin.com/cb1Nen97 and 
> file URIs
> work.  Try merging the two and see if that fixes things?
> 
> -- 
> Tom Rini
> Mentor Graphics Corporation
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-16 11:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-15  8:48 PSTAGE_MIRROR not working with file:// uri Aeschbacher, Fabrice
2011-07-15 20:04 ` Tom Rini
2011-07-16 11:15   ` Aeschbacher, Fabrice

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.