You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ka...@apache.org on 2018/09/03 22:14:35 UTC

[mesos] branch master updated (6a98857 -> 06301a8)

This is an automated email from the ASF dual-hosted git repository.

kapil pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git.


    from 6a98857  Sent an event to resource providers when they are removed.
     new 6e5bdc6  Updated libjvm search logic for newer openjdk versions.
     new 4670aca  Fixed maven invocation with proper JAVA_HOME.
     new 146d93b  Consolidated Java header targets using makefile patterns.
     new 06301a8  Replaced javah with `javac -c` for newer JDKs.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 configure.ac    | 20 ++++++++++++----
 src/Makefile.am | 71 ++++++++++++++++-----------------------------------------
 2 files changed, 36 insertions(+), 55 deletions(-)


[mesos] 01/04: Updated libjvm search logic for newer openjdk versions.

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kapil pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 6e5bdc6a9050978cc1c788ec550bd62db49891e0
Author: Kapil Arya <ka...@mesosphere.io>
AuthorDate: Tue Jun 12 16:46:12 2018 -0400

    Updated libjvm search logic for newer openjdk versions.
    
    Review: https://reviews.apache.org/r/68610
---
 configure.ac | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 143f165..726348a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1302,11 +1302,19 @@ __EOF__
   # Determine linker flags for Java if not set.
   if test "$OS_NAME" = "darwin"; then
     dir="$JAVA_HOME/jre/lib/server"
-    JAVA_TEST_LDFLAGS="-framework JavaVM"
-    JAVA_JVM_LIBRARY=$dir/libjvm.dylib
+    for dir in "$JAVA_HOME/lib/server" "$JAVA_HOME/jre/lib/server"; do
+      if test -e "$dir"; then
+	# Note that these are libtool specific flags.
+        JAVA_TEST_LDFLAGS="-framework JavaVM"
+        JAVA_JVM_LIBRARY=$dir/libjvm.dylib
+	break;
+      fi
+    done
   elif test "$OS_NAME" = "linux"; then
-    for arch in amd64 i386 arm aarch64 ppc64 ppc64le s390 s390x; do
-      dir="$JAVA_HOME/jre/lib/$arch/server"
+    for dir in \
+      "$JAVA_HOME/lib/server" \
+      "$JAVA_HOME/jre/lib/"{amd64,i386,arm,aarch64,ppc64,ppc64le,s390,s390x}"/server"
+    do
       if test -e "$dir"; then
 	# Note that these are libtool specific flags.
 	JAVA_TEST_LDFLAGS="-L$dir -R$dir -Wl,-ljvm"
@@ -2744,4 +2752,6 @@ AC_MSG_NOTICE([Build option summary:
     CPPFLAGS:   $CPPFLAGS
     LDFLAGS:    $LDFLAGS
     LIBS:       $LIBS
+    JAVA_TEST_LDFLAGS: $JAVA_TEST_LDFLAGS
+    JAVA_JVM_LIBRARY:  $JAVA_JVM_LIBRARY
 ])


[mesos] 04/04: Replaced javah with `javac -c` for newer JDKs.

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kapil pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 06301a830aa57d99c350f5f241f85450baf74b29
Author: Kapil Arya <ka...@mesosphere.io>
AuthorDate: Mon Sep 3 12:57:46 2018 -0400

    Replaced javah with `javac -c` for newer JDKs.
    
    Starting with JDK 10, javah is not available. The substitute is to use
    `javac -h` for generating headers.
    
    Review: https://reviews.apache.org/r/68613
---
 configure.ac    |  2 ++
 src/Makefile.am | 14 ++++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 726348a..556a3b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1423,6 +1423,8 @@ has been correctly installed.
 fi
 
 AM_CONDITIONAL([HAS_JAVA], [test "x$has_java" = "xyes"])
+AC_PATH_PROG([JAVAH], [javah], [$JAVAH], [$JAVA_HOME/bin])
+AM_CONDITIONAL([HAS_JAVAH], [test -n "x$JAVAH" != "x"])
 
 
 # Check if LevelDB prefix path was supplied and if so, add it to
diff --git a/src/Makefile.am b/src/Makefile.am
index 0c3d22c..0a9eeab 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2009,12 +2009,22 @@ nodist_libjava_la_SOURCES =						\
 BUILT_SOURCES += $(nodist_libjava_la_SOURCES)
 
 # The automatic variable '$(*F)' captures the matching stem (whatever matches
-# the '%') of the target (e.g., 'org_apache_mesos_Log'). We then substitute
-# '_' with '.' to get the class name (e.g., org.apache.mesos.Log).
+# the '%') of the target (e.g., 'org_apache_mesos_Log').
+# * For 'javah' recipe, we then substitute '_' with '.' to get the class name
+#   (e.g., org.apache.mesos.Log).
+# * For 'javac -h' recipe, we substitute '_' with '/' to compute the source path
+#   of the java file. Unlike 'javah', 'javac -h' requires java sources to
+#   generate headers.
 java/jni/%.h: $(MESOS_JAR)
+if HAS_JAVAH
 	$(JAVA_HOME)/bin/javah -d java/jni                              \
 	  -classpath $(MESOS_JAR):@PROTOBUF_JAR@                        \
 	   $(subst _,.,$(*F))
+else
+	$(JAVA_HOME)/bin/javac -h java/jni				\
+	  -classpath $(MESOS_JAR):@PROTOBUF_JAR@                        \
+	   $(srcdir)/java/src/$(subst _,/,$(*F)).java
+endif
 
 $(EXAMPLES_JAR): $(EXAMPLES_SOURCE)
 	@echo "Building examples.jar ..."


[mesos] 03/04: Consolidated Java header targets using makefile patterns.

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kapil pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 146d93b8931e583dbb1ec0c9aaf86825c09258d3
Author: Kapil Arya <ka...@mesosphere.io>
AuthorDate: Mon Sep 3 12:20:24 2018 -0400

    Consolidated Java header targets using makefile patterns.
    
    Review: https://reviews.apache.org/r/68612
---
 src/Makefile.am | 56 +++++++-------------------------------------------------
 1 file changed, 7 insertions(+), 49 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 5bc82d3..0c3d22c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2008,55 +2008,13 @@ nodist_libjava_la_SOURCES =						\
 
 BUILT_SOURCES += $(nodist_libjava_la_SOURCES)
 
-java/jni/org_apache_mesos_MesosSchedulerDriver.h: $(MESOS_JAR)
-	$(JAVA_HOME)/bin/javah -d java/jni				\
-	-classpath $(MESOS_JAR):@PROTOBUF_JAR@				\
-	  org.apache.mesos.MesosSchedulerDriver
-
-java/jni/org_apache_mesos_MesosExecutorDriver.h: $(MESOS_JAR)
-	$(JAVA_HOME)/bin/javah -d java/jni				\
-	-classpath $(MESOS_JAR):@PROTOBUF_JAR@				\
-          org.apache.mesos.MesosExecutorDriver
-
-java/jni/org_apache_mesos_Log.h: $(MESOS_JAR)
-	$(JAVA_HOME)/bin/javah -d java/jni				\
-	-classpath $(MESOS_JAR):@PROTOBUF_JAR@				\
-	  org.apache.mesos.Log
-
-java/jni/org_apache_mesos_state_AbstractState.h: $(MESOS_JAR)
-	$(JAVA_HOME)/bin/javah -d java/jni				\
-	-classpath $(MESOS_JAR):@PROTOBUF_JAR@				\
-	  org.apache.mesos.state.AbstractState
-
-java/jni/org_apache_mesos_state_LevelDBState.h: $(MESOS_JAR)
-	$(JAVA_HOME)/bin/javah -d java/jni				\
-	-classpath $(MESOS_JAR):@PROTOBUF_JAR@				\
-	  org.apache.mesos.state.LevelDBState
-
-java/jni/org_apache_mesos_state_LogState.h: $(MESOS_JAR)
-	$(JAVA_HOME)/bin/javah -d java/jni				\
-	-classpath $(MESOS_JAR):@PROTOBUF_JAR@				\
-	  org.apache.mesos.state.LogState
-
-java/jni/org_apache_mesos_state_Variable.h: $(MESOS_JAR)
-	$(JAVA_HOME)/bin/javah -d java/jni				\
-	-classpath $(MESOS_JAR):@PROTOBUF_JAR@				\
-	  org.apache.mesos.state.Variable
-
-java/jni/org_apache_mesos_state_ZooKeeperState.h: $(MESOS_JAR)
-	$(JAVA_HOME)/bin/javah -d java/jni				\
-	-classpath $(MESOS_JAR):@PROTOBUF_JAR@				\
-	  org.apache.mesos.state.ZooKeeperState
-
-java/jni/org_apache_mesos_v1_scheduler_V1Mesos.h: $(MESOS_JAR)
-	$(JAVA_HOME)/bin/javah -d java/jni				\
-	-classpath $(MESOS_JAR):@PROTOBUF_JAR@				\
-	  org.apache.mesos.v1.scheduler.V1Mesos
-
-java/jni/org_apache_mesos_v1_scheduler_V0Mesos.h: $(MESOS_JAR)
-	$(JAVA_HOME)/bin/javah -d java/jni				\
-	-classpath $(MESOS_JAR):@PROTOBUF_JAR@				\
-	  org.apache.mesos.v1.scheduler.V0Mesos
+# The automatic variable '$(*F)' captures the matching stem (whatever matches
+# the '%') of the target (e.g., 'org_apache_mesos_Log'). We then substitute
+# '_' with '.' to get the class name (e.g., org.apache.mesos.Log).
+java/jni/%.h: $(MESOS_JAR)
+	$(JAVA_HOME)/bin/javah -d java/jni                              \
+	  -classpath $(MESOS_JAR):@PROTOBUF_JAR@                        \
+	   $(subst _,.,$(*F))
 
 $(EXAMPLES_JAR): $(EXAMPLES_SOURCE)
 	@echo "Building examples.jar ..."


[mesos] 02/04: Fixed maven invocation with proper JAVA_HOME.

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kapil pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 4670aca10943ff8df83e667691e6611aeac9555b
Author: Kapil Arya <ka...@mesosphere.io>
AuthorDate: Mon Sep 3 09:52:45 2018 -0400

    Fixed maven invocation with proper JAVA_HOME.
    
    On some distros, JAVA_HOME environment variable is not set by default.
    However, on such systems, our configure script is able to successfully
    compute the value of JAVA_HOME based on PATH, etc. We use this computed
    JAVA_HOME to set the environment variable when invoking maven.
    
    Review: https://reviews.apache.org/r/68611
---
 src/Makefile.am | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 3023061..5bc82d3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1931,7 +1931,8 @@ if HAS_JAVA
 
 $(MESOS_JAR): $(MESOS_JAR_SOURCE) $(MESOS_JAR_GENERATED) java/mesos.pom
 	@echo "Building mesos-$(PACKAGE_VERSION).jar ..."
-	@cd $(abs_top_builddir)/src/java && $(MVN) -B -q -f mesos.pom clean package
+	@cd $(abs_top_builddir)/src/java &&  \
+	  env JAVA_HOME=$(JAVA_HOME) $(MVN) -B -q -f mesos.pom clean package
 
 # Convenience library for JNI bindings.
 # TODO(Charles Reiss): We really should be building the Java library
@@ -2069,7 +2070,7 @@ $(EXAMPLES_JAR): $(EXAMPLES_SOURCE)
 CLEANFILES += $(EXAMPLES_JAR)
 
 maven-install: $(MESOS_JAR) java/mesos.pom
-	$(MVN) -B -q -f java/mesos.pom install
+	env JAVA_HOME=$(JAVA_HOME) $(MVN) -B -q -f java/mesos.pom install
 
 PHONY_TARGETS += maven-install
 endif # HAS_JAVA