[oe] [meta-java] archiver.bbclass incompatible with openjdk-8

robert.berger.oe.devel robert.berger.oe.devel at gmail.com
Fri Mar 20 16:38:17 UTC 2020


Hi,

The problem can be very easily reproduced. Just enable the 
archiver.bbclass and build openjdk-8 and it will break. I'll explain 
further down why.

I would really like to have some upstream solution, so openjdk-8 can be 
built with the archiver.bbclass active, but so far I only have my hacky 
patch[1].

[1] 
https://github.com/RobertBerger/meta-java/commit/a97d27ea0d6701df222c79fb1ce983fc39308c0c

Here I try to explain the problem:

1) Without the archiver class:

in openjdk-8-common.inc:

1.1) do_unpack[postfuncs] += "do_unpack_extract_submodules"

1.2)

do_unpack_extract_submodules () {
     cd "${S}"
     # tar --transform
     tar xjf ${WORKDIR}/${CORBA_FILE_LOCAL} --transform 
"s,-${CORBA_CHANGESET},,g"
...
}

2) With the archiver class:

2.1) do_unpack_and_patch could be used instead of do_unpack directly:

2.1.1) It is always used for ARCHIVER_MODE[src] = "patched" and 
ARCHIVER_MODE[src] = "configured".

2.1.2) For ARCHIVER_MODE[src] = "original" it is only enabled if 
ARCHIVER_MODE[diff] = "1" is also enabled.

2.1.3) And for the new ARCHIVE_MODE[src] = "mirror" it is never enabled.

Thanks to Saur for the detailed explanation when and when not 
do_unpack_and_patch is being called.

2.2) if do_unpack_and_patch() is used it sets WORKDIR itself to 
${ARCHIVER_WORKDIR}, which defaults to ${WORKDIR}/archiver-work/

2.3) Which makes

do_unpack_extract_submodules () {
     cd "${S}"
     # tar --transform
     tar xjf ${WORKDIR}/${CORBA_FILE_LOCAL} --transform 
"s,-${CORBA_CHANGESET},,g"
...
}

fail, since it should be tar xjf ${WORKDIR}/../${CORBA_FILE_LOCAL} 
--transform "s,-${CORBA_CHANGESET},,g"

...

due to the additional directory structure.

I would be happy to hear suggestions how to improve my hack.

If I could somehow programatically figure out within BitBake that 
do_unpack_extract_submodules is called from do_unpack_and_patch -> 
do_unpack I guess it would be better. Just don't know how this can be 
done. Is there a BitBake callstack?

3) My (hacky) solution

[1] 
https://github.com/RobertBerger/meta-java/commit/a97d27ea0d6701df222c79fb1ce983fc39308c0c


Regards,

Robert


More information about the Openembedded-devel mailing list