* [meta-java] how to properly handle conflict between openjdk-8-native, fastjar-native and ecj-bootstrap-native
@ 2015-12-21 9:14 Huang, Jie (Jackie)
2016-01-04 19:15 ` Jens Rehsack
0 siblings, 1 reply; 2+ messages in thread
From: Huang, Jie (Jackie) @ 2015-12-21 9:14 UTC (permalink / raw)
To: openembedded-devel
Hi,
I found that builds with sstate will fail with:
checking if /build/tmp/sysroots/x86_64-linux/usr/bin/ecj-initial works... configure: error: The Java compiler /build/tmp/sysroots/x86_64-linux/usr/bin/ecj-initial failed (see config.log, check the CLASSPATH?)
That's because the do_install of openjdk-8-native install files directly into staging dirs, so the sstate is empty, I tried to send a patch to fix it:
[meta-java][PATCH v2] openjdk-8-native: fix incorrect do_install
But ends up with conflicting with fastjar-native and ecj-bootstrap-native, further investigation show me that they are not properly handled.
fastjar-native provides virtual/jar-native,
ecj-bootstrap-native provides virtual/javac-native (used to, the PROVIDES was removed recently)
and openjdk-8-native provides both of them.
Usually we use update-alternatives to avoid conflicts but seems like it doesn't work for native package,
But openjdk-8-native is still trying to use it which should be invalid:
$ grep ALTERNATIVE openjdk-8-native_72b05.bb
ALTERNATIVE_${PN} = "java javac jar pack200 unpack200 keytool"
ALTERNATIVE_LINK[java] = "${bindir}/java"
ALTERNATIVE_TARGET[java] = "${JDK_HOME}/bin/java"
ALTERNATIVE_PRIORITY[java] = "100"
ALTERNATIVE_LINK[javac] = "${bindir}/javac"
ALTERNATIVE_TARGET[javac] = "${JDK_HOME}/bin/javac"
ALTERNATIVE_PRIORITY[javac] = "100"
ALTERNATIVE_LINK[jar] = "${bindir}/jar"
ALTERNATIVE_TARGET[jar] = "${JDK_HOME}/bin/jar"
ALTERNATIVE_PRIORITY[jar] = "100"
ALTERNATIVE_LINK[pack200] = "${bindir}/pack200"
ALTERNATIVE_TARGET[pack200] = "${JDK_HOME}/bin/pack200"
ALTERNATIVE_PRIORITY[pack200] = "100"
ALTERNATIVE_LINK[unpack200] = "${bindir}/unpack200"
ALTERNATIVE_TARGET[unpack200] = "${JDK_HOME}/bin/unpack200"
ALTERNATIVE_PRIORITY[unpack200] = "100"
ALTERNATIVE_LINK[keytool] = "${bindir}/keytool"
ALTERNATIVE_TARGET[keytool] = "${JDK_HOME}/bin/keytool"
ALTERNATIVE_PRIORITY[keytool] = "100"
So we should use the virtual/foo everywhere and set PREFERRRED_PROVIDER for it, but many
recipes is depending on fastjar-native directly:
$ grep -r 'DEPENDS.*fastjar-native' *|wc -l
14
virtual/jar-native is never used in depends.
And many recipe is depending on ecj-bootstrap-native directly through java-bootstrap-components.bbclass:
$ tail -n 2 classes/java-bootstrap-components.bbclass
DEPENDS_prepend_class-native = " ecj-bootstrap-native "
DEPENDS_prepend_class-target = " virtual/javac-native "
I don't understand the purpose from reading the commit logs there, and it seems not correct to me.
The default for virtual/javac-native is openjdk-8-native, then these conflicted recipes will be built
together, it works without ssate since openjdk-8-native force to remove those files in staging dir
before installing them(which definitely breaks sstate):
# clean up the mess from bootstrap
for tool in jar java javac keytool pack200 unpack200
do
rm -f ${STAGING_BINDIR_NATIVE}/$tool
ln -sf "../lib/jvm/${JDK_DIR}/bin/$tool" ${STAGING_BINDIR_NATIVE}/$tool
done
it's assuming that fastjar-native and ecj-bootstrap-native are built before openjdk-8-native,
but its' not always true especially when build with sstate.
I'm going to fix the do_install and remove the useless ALTERNATIVE settings for openjdk-8-native,
and fix the depends only on virtual/foo then the user needs to set PREFERRED_PROVIDER,
so to avoid these conflicts. Please anyone has a better understanding correct me if this doesn't seem
to work.
Anyone has a better idea? Thanks!
Thanks,
Jackie
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [meta-java] how to properly handle conflict between openjdk-8-native, fastjar-native and ecj-bootstrap-native
2015-12-21 9:14 [meta-java] how to properly handle conflict between openjdk-8-native, fastjar-native and ecj-bootstrap-native Huang, Jie (Jackie)
@ 2016-01-04 19:15 ` Jens Rehsack
0 siblings, 0 replies; 2+ messages in thread
From: Jens Rehsack @ 2016-01-04 19:15 UTC (permalink / raw)
To: Jie Huang; +Cc: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 4259 bytes --]
> Am 21.12.2015 um 10:14 schrieb Huang, Jie (Jackie) <Jackie.Huang@windriver.com>:
>
> Hi,
>
> I found that builds with sstate will fail with:
> checking if /build/tmp/sysroots/x86_64-linux/usr/bin/ecj-initial works... configure: error: The Java compiler /build/tmp/sysroots/x86_64-linux/usr/bin/ecj-initial failed (see config.log, check the CLASSPATH?)
>
> That's because the do_install of openjdk-8-native install files directly into staging dirs, so the sstate is empty, I tried to send a patch to fix it:
> [meta-java][PATCH v2] openjdk-8-native: fix incorrect do_install
>
> But ends up with conflicting with fastjar-native and ecj-bootstrap-native, further investigation show me that they are not properly handled.
>
> fastjar-native provides virtual/jar-native,
> ecj-bootstrap-native provides virtual/javac-native (used to, the PROVIDES was removed recently)
>
> and openjdk-8-native provides both of them.
>
> Usually we use update-alternatives to avoid conflicts but seems like it doesn't work for native package,
> But openjdk-8-native is still trying to use it which should be invalid:
>
> $ grep ALTERNATIVE openjdk-8-native_72b05.bb
> ALTERNATIVE_${PN} = "java javac jar pack200 unpack200 keytool"
> ALTERNATIVE_LINK[java] = "${bindir}/java"
> ALTERNATIVE_TARGET[java] = "${JDK_HOME}/bin/java"
> ALTERNATIVE_PRIORITY[java] = "100"
> ALTERNATIVE_LINK[javac] = "${bindir}/javac"
> ALTERNATIVE_TARGET[javac] = "${JDK_HOME}/bin/javac"
> ALTERNATIVE_PRIORITY[javac] = "100"
> ALTERNATIVE_LINK[jar] = "${bindir}/jar"
> ALTERNATIVE_TARGET[jar] = "${JDK_HOME}/bin/jar"
> ALTERNATIVE_PRIORITY[jar] = "100"
> ALTERNATIVE_LINK[pack200] = "${bindir}/pack200"
> ALTERNATIVE_TARGET[pack200] = "${JDK_HOME}/bin/pack200"
> ALTERNATIVE_PRIORITY[pack200] = "100"
> ALTERNATIVE_LINK[unpack200] = "${bindir}/unpack200"
> ALTERNATIVE_TARGET[unpack200] = "${JDK_HOME}/bin/unpack200"
> ALTERNATIVE_PRIORITY[unpack200] = "100"
> ALTERNATIVE_LINK[keytool] = "${bindir}/keytool"
> ALTERNATIVE_TARGET[keytool] = "${JDK_HOME}/bin/keytool"
> ALTERNATIVE_PRIORITY[keytool] = "100"
>
> So we should use the virtual/foo everywhere and set PREFERRRED_PROVIDER for it, but many
> recipes is depending on fastjar-native directly:
You cannot do that in a sane way for java, because they depend on each other. So your openjdk-xy
build will end with 3-5 virtual/java-native packages, which must fail.
> $ grep -r 'DEPENDS.*fastjar-native' *|wc -l
> 14
>
> virtual/jar-native is never used in depends.
>
> And many recipe is depending on ecj-bootstrap-native directly through java-bootstrap-components.bbclass:
>
> $ tail -n 2 classes/java-bootstrap-components.bbclass
> DEPENDS_prepend_class-native = " ecj-bootstrap-native "
> DEPENDS_prepend_class-target = " virtual/javac-native "
>
> I don't understand the purpose from reading the commit logs there, and it seems not correct to me.
> The default for virtual/javac-native is openjdk-8-native, then these conflicted recipes will be built
> together, it works without ssate since openjdk-8-native force to remove those files in staging dir
> before installing them(which definitely breaks sstate):
> # clean up the mess from bootstrap
> for tool in jar java javac keytool pack200 unpack200
> do
> rm -f ${STAGING_BINDIR_NATIVE}/$tool
>
> ln -sf "../lib/jvm/${JDK_DIR}/bin/$tool" ${STAGING_BINDIR_NATIVE}/$tool
> done
>
> it's assuming that fastjar-native and ecj-bootstrap-native are built before openjdk-8-native,
> but its' not always true especially when build with sstate.
>
> I'm going to fix the do_install and remove the useless ALTERNATIVE settings for openjdk-8-native,
> and fix the depends only on virtual/foo then the user needs to set PREFERRED_PROVIDER,
> so to avoid these conflicts. Please anyone has a better understanding correct me if this doesn't seem
> to work.
>
> Anyone has a better idea? Thanks!
Better idea: rewrite the entire bootstrap packaging (including every native component) and use
a ${STAGING_LIBDIR_NATIVE}/jvm/${JVM_IDENT} only. Properly deal with JAVA_HOME and PATH by having
some nice jvm-xy-native.bbclass
Best regards
--
Jens Rehsack - rehsack@gmail.com
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 859 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-04 19:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-21 9:14 [meta-java] how to properly handle conflict between openjdk-8-native, fastjar-native and ecj-bootstrap-native Huang, Jie (Jackie)
2016-01-04 19:15 ` Jens Rehsack
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.