[oe] PSTAGE_MIRROR not working with file:// uri

Aeschbacher, Fabrice Fabrice.Aeschbacher at siemens.com
Fri Jul 15 08:48:38 UTC 2011


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




More information about the Openembedded-devel mailing list