[oe] package_ipk.bbclass fails due to a wrong version of a package

Denys Dmytriyenko denis at denix.org
Tue Apr 7 21:34:12 UTC 2009


On Tue, Apr 07, 2009 at 12:24:32PM -0400, Denys Dmytriyenko wrote:
> On Thu, Apr 02, 2009 at 04:38:32PM -0400, Denys Dmytriyenko wrote:
> > On Thu, Apr 02, 2009 at 12:11:18PM -0700, Tom Rini wrote:
> > > On Thu, Apr 02, 2009 at 02:50:06PM -0400, Denys Dmytriyenko wrote:
> > > 
> > > > I've been debugging this issue for a while now w/o much success.
> > > > 
> > > > We have following recipes in play:
> > > > curl_7.19.0.bb
> > > > curl-native_7.18.2.bb
> > > > curl-sdk_7.18.2.bb
> > > > 
> > > > None of those set PV explicitly, so they are picked up from the filename.
> > > 
> > > Hmm, if you throw in a -v -DDD and log all the output, do you see both
> > > curl_7.18.2.bb being loaded (for -sdk) and curl_7.19.0.bb (for target)
> > > being loaded up?
> > 
> > Nope. While trying to build curl-sdk_7.18.2.bb there is no mentioning of 
> > 7.19.0 (grepped the output) until the do_package_write_ipk, where it tried to 
> > create a lock file, as I mentioned above:
> > 
> > NOTE: package curl-sdk-7.18.2-r0: task do_package_write_ipk: started
> > DEBUG: mkdirhier(/oe/tmp/work/i686-i686-sdk-angstrom-linux/curl-sdk-7.18.2-r0/image)
> > DEBUG: mkdirhier(/oe/tmp/work/i686-i686-sdk-angstrom-linux/curl-7.19.0-r1/image)
> > ERROR: Error, lockfile path does not exist!: /oe/tmp/work/i686-i686-sdk-angstrom-linux/curl-7.19.0-r1/install
> > 
> > The second mkdirhier() is where it fails and it is called from lockfile(), 
> > which gets called from do_package_ipk()...
> > 
> > BTW, this was a i686-generic build, thus i686-i686-sdk path...
> 
> FYI, I figured it out few days ago, but had some personal matters to resolve 
> first. I'll be sending a detailed explanation and a patch soon.

Ok, the problem comes from the 1af5030de05a1e65d1de734f7675ffc22c8318fc 
commit taken from Poky, which seems legitimate, as it "fixes" the generation 
of pkgdata/runtime files by adding extra fields, such as PN, PV and PR. It was 
commited as part of RPM packaging.

Unfortunately, that unmasks some issues, namely the one with curl/curl-sdk...

All curl recipes use a single .inc file, which expands the PACKAGES variable 
with libcurl name (i.e. "curl curl-dev curl-dbg libcurl libcurl-dev...").

Now when curl target is packaged, it generates a pkgdata file with version 
7.19.0-r1 in it under arch dir. Next, when curl-sdk is being packaged its 
PACKAGES variable is "curl-sdk curl-sdk-dev curl-sdk-dbg libcurl 
libcurl-dev...". So when do_package_write_ipk() calls 
read_subpackage_metadata(), it looks for pkgdata of libcurl and finds it in 
arch dir first, extracting the wrong version numbers, hence lockfile() trying 
to access the wrong directory. Here is the code:

def get_subpkgedata_fn(pkg, d):
    import bb, os
    archs = bb.data.expand("${PACKAGE_ARCHS}", d).split(" ")
    archs.reverse()
    pkgdata = bb.data.expand('${TMPDIR}/pkgdata/', d)
    targetdir = bb.data.expand('${TARGET_VENDOR}-${TARGET_OS}/runtime/', d)
    for arch in archs:
        fn = pkgdata + arch + targetdir + pkg
        if os.path.exists(fn):
            return fn
    return bb.data.expand('${PKGDATA_DIR}/runtime/%s' % pkg, d)

Now, the above code works in Poky, because Poky has the same version numbers 
for curl, curl-native and curl-sdk.

Maybe there is way to fix this issue in the core classes, but I don't believe 
libcurl should be in curl-sdk PACKAGES anyway. I have it fixed this way and 
I'll be sending the patch to the list shortly. Plus, curl-sdk is only needed 
for do_stage() and has empty do_install() anyway.

The above commit from Poky may unmask some other similar issues, not related 
to curl - for example the one Otavio reported recently. It can be easily 
verified if it is the rootcause:

$ git revert -n 1af5030de05a1e65d1de734f7675ffc22c8318fc

If there are multiple pkgdata files with the same name, but different 
contents, the above quoted get_subpkgedata_fn() function may pick the wrong 
one. The question is - is it even valid to have something like this:

${TMPDIR}/pkgdata/armv5te-none-linux-gnueabi/runtime/foo
${TMPDIR}/pkgdata/i686-armv5te-sdk-none-linux-gnueabi/runtime/foo

-- 
Denys




More information about the Openembedded-devel mailing list