All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-java][PATCH 1/2] rhino-native should depend on classpath-native
@ 2016-08-19 21:58 Kyle Russell
  2016-08-19 21:58 ` [meta-java][PATCH 2/2] Reimplement helper method for parallelizing JDK builds Kyle Russell
  2016-08-24 12:57 ` [meta-java][PATCH 1/2] rhino-native should depend on classpath-native Maxin B. John
  0 siblings, 2 replies; 5+ messages in thread
From: Kyle Russell @ 2016-08-19 21:58 UTC (permalink / raw)
  To: openembedded-devel

rhino's do_compile task passes
${STAGING_DATADIR_NATIVE}/classpath/glibj.zip to javac.  This glibj.zip
archive comes from the classpath-native package.

Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
---
 recipes-core/rhino/rhino_1.7r4.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/recipes-core/rhino/rhino_1.7r4.bb b/recipes-core/rhino/rhino_1.7r4.bb
index 7898d23..30d5a62 100644
--- a/recipes-core/rhino/rhino_1.7r4.bb
+++ b/recipes-core/rhino/rhino_1.7r4.bb
@@ -2,6 +2,8 @@ DESCRIPTION = "Lexical analyzer generator for Java"
 LICENSE = "MPL-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=8e2372bdbf22c99279ae4599a13cc458"
 
+DEPENDS_class-native += "classpath-native"
+
 BBCLASSEXTEND = "native"
 
 inherit java-library
-- 
2.7.4



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

* [meta-java][PATCH 2/2] Reimplement helper method for parallelizing JDK builds
  2016-08-19 21:58 [meta-java][PATCH 1/2] rhino-native should depend on classpath-native Kyle Russell
@ 2016-08-19 21:58 ` Kyle Russell
  2016-08-24 13:00   ` Maxin B. John
  2016-08-24 12:57 ` [meta-java][PATCH 1/2] rhino-native should depend on classpath-native Maxin B. John
  1 sibling, 1 reply; 5+ messages in thread
From: Kyle Russell @ 2016-08-19 21:58 UTC (permalink / raw)
  To: openembedded-devel

Simplifies duplicated implementation across multiple recipes that all
inherited from java.bbclass.

Previously implementation was not flexible in supporting other make
job-limiting flags (like -l for load) that are typically passed in
through PARALLEL_MAKE.  (OpenJDK doesn't know about these other flags
that might have gotten tagged on after the value for -j.)

Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
---
 classes/java.bbclass                      | 17 ++++++++++++++++
 recipes-core/icedtea/icedtea7-native.inc  | 23 +---------------------
 recipes-core/openjdk/openjdk-7-common.inc | 32 +------------------------------
 recipes-core/openjdk/openjdk-8-common.inc | 21 --------------------
 recipes-core/openjdk/openjdk-8-cross.inc  |  6 +++---
 recipes-core/openjdk/openjdk-8-native.inc |  2 +-
 6 files changed, 23 insertions(+), 78 deletions(-)

diff --git a/classes/java.bbclass b/classes/java.bbclass
index fc97295..aa012ab 100644
--- a/classes/java.bbclass
+++ b/classes/java.bbclass
@@ -21,6 +21,23 @@ STAGING_DATADIR_JAVA_NATIVE ?= "${STAGING_DATADIR_NATIVE}/java"
 STAGING_LIBDIR_JNI_NATIVE ?= "${STAGING_LIBDIR_NATIVE}/jni"
 STAGING_LIBDIR_JVM_NATIVE ?= "${STAGING_LIBDIR_NATIVE}/jvm"
 
+# Icedtea's makefile is not compatible to parallelization so we cannot allow
+# passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are
+# parallelizable and we need ${PARALLEL_MAKE} to derive the proper value.
+# The base for this quirk is that GNU Make only considers the last "-j" option.
+EXTRA_OEMAKE_remove_task-compile = "${PARALLEL_MAKE}"
+EXTRA_OEMAKE_remove_task-install = "${PARALLEL_MAKEINST}"
+
+# OpenJDK supports parallel compilation but uses a plain number for this.
+# In OE we have PARALLEL_MAKE which is the actual option passed to make,
+# e.g. "-j 4".
+def java_get_parallel_make(d):
+    pm = d.getVar('PARALLEL_MAKE', True);
+    if not pm or '-j' not in pm:
+        return 1
+
+    return pm.partition('-j')[2].strip().split(' ')[0]
+
 oe_jarinstall() {
   # Purpose: Install a jar file and create all the given symlinks to it.
   # Example:
diff --git a/recipes-core/icedtea/icedtea7-native.inc b/recipes-core/icedtea/icedtea7-native.inc
index 3344acb..d4c5c29 100644
--- a/recipes-core/icedtea/icedtea7-native.inc
+++ b/recipes-core/icedtea/icedtea7-native.inc
@@ -54,27 +54,8 @@ export ALT_FREETYPE_LIB_PATH = "${STAGING_LIBDIR}"
 # which is already stripped.
 INSANE_SKIP_${PN} = "already-stripped"
 
-# OpenJDK supports parallel compilation but uses a plain number for this.
-# In OE we have PARALLEL_MAKE which is the actual option passed to make,
-# e.g. "-j 4".
-ICEDTEA_PARALLEL_MAKE := "${PARALLEL_MAKE}"
-PARALLEL_MAKE = ""
-def get_jdk7_native_jobs(d):
-    import bb
-
-    pm = bb.data.getVar('ICEDTEA_PARALLEL_MAKE', d, 1);
-    if not pm:
-        return "1"
-
-    pm = pm.split("j");
-    if (len(pm) == 2):
-        return pm[1].strip()
-
-    # Whatever found in PARALLEL_MAKE was not suitable.
-    return "1"
-
 EXTRA_OECONF = "\
-	--with-parallel-jobs=${@get_jdk7_native_jobs(d)} \
+	--with-parallel-jobs=${@java_get_parallel_make(d)} \
 	\
         --disable-tests \
         --disable-hotspot-tests \
@@ -273,5 +254,3 @@ do_install() {
 	# Fix missing write permissions on the files.
 	chmod ug+w -R ${JDK_INSTALL_DIR}
 }
-
-get_jdk7_native_jobs[vardepsexclude] += "ICEDTEA_PARALLEL_MAKE"
diff --git a/recipes-core/openjdk/openjdk-7-common.inc b/recipes-core/openjdk/openjdk-7-common.inc
index 759b426..ba738cf 100644
--- a/recipes-core/openjdk/openjdk-7-common.inc
+++ b/recipes-core/openjdk/openjdk-7-common.inc
@@ -59,30 +59,6 @@ export CACAO_CONFIGURE_ARGS = " \
 
 JAVA_HOME[unexport] = "1"
 
-# OpenJDK supports parallel compilation but uses a plain number for this.
-# In OE we have PARALLEL_MAKE which is the actual option passed to make,
-# e.g. "-j 4".
-
-OPENJDK_PARALLEL_MAKE := "${PARALLEL_MAKE}"
-PARALLEL_MAKE =  ""
-
-def get_jdk7_jobs(d):
-    import bb
-
-    pm = bb.data.getVar('OPENJDK_PARALLEL_MAKE', d, 1);
-    if not pm:
-        return "1"
-
-    pm = pm.split("j");
-    if (len(pm) == 2):
-        return pm[1].strip()
-
-    # Whatever found in PARALLEL_MAKE was not suitable.
-    return "1"
-
-get_jdk7_jobs[vardepsexclude] += "OPENJDK_PARALLEL_MAKE"
-JDK_JOBS = "${@get_jdk7_jobs(d)}"
-
 EXTRA_OECONF = " \
     --disable-tests \
     --disable-hotspot-tests \
@@ -106,7 +82,7 @@ EXTRA_OECONF = " \
     --with-jdk-src-zip=${WORKDIR}/${JDK_FILE} \
     --with-langtools-src-zip=${WORKDIR}/${LANGTOOLS_FILE} \
     \
-    --with-parallel-jobs=${JDK_JOBS} \
+    --with-parallel-jobs=${@java_get_parallel_make(d)} \
     \
     --with-pkgversion=${PV} \
     --with-cc-for-build=${BUILD_CC} \
@@ -121,8 +97,6 @@ EXTRA_OECONF += " \
 "
 
 do_configure_prepend() {
-    echo "Configure with parallel-jobs: ${JDK_JOBS}"
-
     # Automatically copy everything that starts with "icedtea" (or "cacao") and ends with
     # ".patch" into the patches directory.
     find ${WORKDIR} -maxdepth 1 -name "icedtea*.patch" -exec cp {} ${S}/patches \;
@@ -136,10 +110,6 @@ do_configure_append() {
 # Work around broken variable quoting in oe-stable 2009 and provide the variable
 # via the environment which then overrides the erroneous value that was written
 # into '${ICETDEA}/Makefile'.
-# Icedtea's makefile is not compatible to parallelization so we cannot allow
-# passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are
-# parallelizable and we need ${PARALLEL_MAKE} to derive the proper value.
-# The base for this quirk is that GNU Make only considers the last "-j" option.
 EXTRA_OEMAKE += 'CC="${CC}" CCC="${CXX}" CPP="${CPP}" CXX="${CXX}" CC_FOR_BUILD="${BUILD_CC}"'
 
 EXTRA_OEMAKE += ' \
diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-core/openjdk/openjdk-8-common.inc
index c2f9eb4..c339985 100644
--- a/recipes-core/openjdk/openjdk-8-common.inc
+++ b/recipes-core/openjdk/openjdk-8-common.inc
@@ -167,27 +167,6 @@ do_configure_prepend() {
         export ${@jdk_environment_options(d)}
 }
 
-# OpenJDK supports parallel compilation but uses a plain number for this.
-# In OE we have PARALLEL_MAKE which is the actual option passed to make,
-# e.g. "-j 4".
-OPENJDK8_PARALLEL_MAKE := "${PARALLEL_MAKE}"
-PARALLEL_MAKE = ""
-def get_jdk8_native_jobs(d):
-    import bb
-
-    pm = bb.data.getVar('OPENJDK8_PARALLEL_MAKE', d, 1);
-    if not pm:
-        return "1"
-
-    pm = pm.split("j");
-    if (len(pm) == 2):
-        return pm[1].strip()
-
-    # Whatever found in PARALLEL_MAKE was not suitable.
-    return "1"
-
-get_jdk8_native_jobs[vardepsexclude] += "OPENJDK8_PARALLEL_MAKE"
-
 # A function that is needed in the Shark builds.
 def get_llvm_configure_arch(d):
     import bb;
diff --git a/recipes-core/openjdk/openjdk-8-cross.inc b/recipes-core/openjdk/openjdk-8-cross.inc
index 11e94ce..47fe35d 100644
--- a/recipes-core/openjdk/openjdk-8-cross.inc
+++ b/recipes-core/openjdk/openjdk-8-cross.inc
@@ -40,7 +40,7 @@ SRC_URI_append = "\
 "
 
 EXTRA_OECONF_append = "\
-    --with-jobs=${@get_jdk8_native_jobs(d)} \
+    --with-jobs=${@java_get_parallel_make(d)} \
     \
     --with-sys-root=${STAGING_DIR} \
     --with-tools-dir=${STAGING_DIR_NATIVE} \
@@ -65,13 +65,13 @@ do_install_append() {
     if ${@bb.utils.contains('PACKAGECONFIG', 'repack', 'true', 'false', d)} ; then
       if [ -d ${D}${JDK_HOME} ] ; then
         find ${D}${JDK_HOME} -name "*.jar" -print0 | \
-          xargs -0 -n1 -P ${@get_jdk8_native_jobs(d)} sh -c ' \
+          xargs -0 -n1 -P ${@java_get_parallel_make(d)} sh -c ' \
               echo "Repacking" "$0" ; \
               pack200 --repack --effort=9 --segment-limit=-1 --modification-time=latest --strip-debug "$0"'
       fi
       if [ -d ${D}${JRE_HOME} ] ; then
         find ${D}${JRE_HOME} -name "*.jar" -print0 | \
-          xargs -0 -n1 -P ${@get_jdk8_native_jobs(d)} sh -c ' \
+          xargs -0 -n1 -P ${@java_get_parallel_make(d)} sh -c ' \
               echo "Repacking" "$0" ; \
               pack200 --repack --effort=9 --segment-limit=-1 --modification-time=latest --strip-debug "$0"'
       fi
diff --git a/recipes-core/openjdk/openjdk-8-native.inc b/recipes-core/openjdk/openjdk-8-native.inc
index 91080d2..c7d3992 100644
--- a/recipes-core/openjdk/openjdk-8-native.inc
+++ b/recipes-core/openjdk/openjdk-8-native.inc
@@ -16,7 +16,7 @@ PACKAGECONFIG[alsa] = "--with-alsa,,alsa-lib-native"
 PACKAGECONFIG[jce] = "--enable-unlimited-crypto,,"
 
 EXTRA_OECONF_append = "\
-    --with-jobs=${@get_jdk8_native_jobs(d)} \
+    --with-jobs=${@java_get_parallel_make(d)} \
     \
     --with-sys-root=${STAGING_DIR_NATIVE} \
     --with-tools-dir=${STAGING_DIR_NATIVE} \
-- 
2.7.4



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

* Re: [meta-java][PATCH 1/2] rhino-native should depend on classpath-native
  2016-08-19 21:58 [meta-java][PATCH 1/2] rhino-native should depend on classpath-native Kyle Russell
  2016-08-19 21:58 ` [meta-java][PATCH 2/2] Reimplement helper method for parallelizing JDK builds Kyle Russell
@ 2016-08-24 12:57 ` Maxin B. John
  1 sibling, 0 replies; 5+ messages in thread
From: Maxin B. John @ 2016-08-24 12:57 UTC (permalink / raw)
  To: Kyle Russell; +Cc: openembedded-devel

Hi Kyle,

On Fri, Aug 19, 2016 at 05:58:01PM -0400, Kyle Russell wrote:
> rhino's do_compile task passes
> ${STAGING_DATADIR_NATIVE}/classpath/glibj.zip to javac.  This glibj.zip
> archive comes from the classpath-native package.
> 
> Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
> ---
>  recipes-core/rhino/rhino_1.7r4.bb | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/recipes-core/rhino/rhino_1.7r4.bb b/recipes-core/rhino/rhino_1.7r4.bb
> index 7898d23..30d5a62 100644
> --- a/recipes-core/rhino/rhino_1.7r4.bb
> +++ b/recipes-core/rhino/rhino_1.7r4.bb
> @@ -2,6 +2,8 @@ DESCRIPTION = "Lexical analyzer generator for Java"
>  LICENSE = "MPL-2.0"
>  LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=8e2372bdbf22c99279ae4599a13cc458"
>  
> +DEPENDS_class-native += "classpath-native"
> +
>  BBCLASSEXTEND = "native"
>  
>  inherit java-library

Pushed to master-next. Thanks.

Best Regards,
Maxin


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

* Re: [meta-java][PATCH 2/2] Reimplement helper method for parallelizing JDK builds
  2016-08-19 21:58 ` [meta-java][PATCH 2/2] Reimplement helper method for parallelizing JDK builds Kyle Russell
@ 2016-08-24 13:00   ` Maxin B. John
  2016-08-24 13:23     ` Kyle Russell
  0 siblings, 1 reply; 5+ messages in thread
From: Maxin B. John @ 2016-08-24 13:00 UTC (permalink / raw)
  To: Kyle Russell; +Cc: openembedded-devel

Hi,

On Fri, Aug 19, 2016 at 05:58:02PM -0400, Kyle Russell wrote:
> Simplifies duplicated implementation across multiple recipes that all
> inherited from java.bbclass.
> 
> Previously implementation was not flexible in supporting other make
> job-limiting flags (like -l for load) that are typically passed in
> through PARALLEL_MAKE.  (OpenJDK doesn't know about these other flags
> that might have gotten tagged on after the value for -j.)
> 
> Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
> ---
>  classes/java.bbclass                      | 17 ++++++++++++++++
>  recipes-core/icedtea/icedtea7-native.inc  | 23 +---------------------
>  recipes-core/openjdk/openjdk-7-common.inc | 32 +------------------------------
>  recipes-core/openjdk/openjdk-8-common.inc | 21 --------------------
>  recipes-core/openjdk/openjdk-8-cross.inc  |  6 +++---
>  recipes-core/openjdk/openjdk-8-native.inc |  2 +-
>  6 files changed, 23 insertions(+), 78 deletions(-)

Can you please rebase this on the latest master branch and resend?

<snip>

Best Regards,
Maxin


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

* Re: [meta-java][PATCH 2/2] Reimplement helper method for parallelizing JDK builds
  2016-08-24 13:00   ` Maxin B. John
@ 2016-08-24 13:23     ` Kyle Russell
  0 siblings, 0 replies; 5+ messages in thread
From: Kyle Russell @ 2016-08-24 13:23 UTC (permalink / raw)
  To: Maxin B. John; +Cc: openembedded-devel

Sure thing.

On Wed, Aug 24, 2016, 9:00 AM Maxin B. John <maxin.john@intel.com> wrote:

> Hi,
>
> On Fri, Aug 19, 2016 at 05:58:02PM -0400, Kyle Russell wrote:
> > Simplifies duplicated implementation across multiple recipes that all
> > inherited from java.bbclass.
> >
> > Previously implementation was not flexible in supporting other make
> > job-limiting flags (like -l for load) that are typically passed in
> > through PARALLEL_MAKE.  (OpenJDK doesn't know about these other flags
> > that might have gotten tagged on after the value for -j.)
> >
> > Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
> > ---
> >  classes/java.bbclass                      | 17 ++++++++++++++++
> >  recipes-core/icedtea/icedtea7-native.inc  | 23 +---------------------
> >  recipes-core/openjdk/openjdk-7-common.inc | 32
> +------------------------------
> >  recipes-core/openjdk/openjdk-8-common.inc | 21 --------------------
> >  recipes-core/openjdk/openjdk-8-cross.inc  |  6 +++---
> >  recipes-core/openjdk/openjdk-8-native.inc |  2 +-
> >  6 files changed, 23 insertions(+), 78 deletions(-)
>
> Can you please rebase this on the latest master branch and resend?
>
> <snip>
>
> Best Regards,
> Maxin
>


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

end of thread, other threads:[~2016-08-24 13:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-19 21:58 [meta-java][PATCH 1/2] rhino-native should depend on classpath-native Kyle Russell
2016-08-19 21:58 ` [meta-java][PATCH 2/2] Reimplement helper method for parallelizing JDK builds Kyle Russell
2016-08-24 13:00   ` Maxin B. John
2016-08-24 13:23     ` Kyle Russell
2016-08-24 12:57 ` [meta-java][PATCH 1/2] rhino-native should depend on classpath-native Maxin B. John

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.