[Cmake-commits] CMake branch, next, updated. v3.6.0-rc1-139-g6455c5c

Brad King brad.king at kitware.com
Wed Jun 8 13:58:41 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  6455c5c0afeba7e9f7f5ecc8f04b25f1462157f8 (commit)
       via  19a0a85e3adc229a995846611bbc461be352635b (commit)
      from  6c7dd8eb8ae00a1a0b8c628e4d6e3c7b5f3ea1f9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6455c5c0afeba7e9f7f5ecc8f04b25f1462157f8
commit 6455c5c0afeba7e9f7f5ecc8f04b25f1462157f8
Merge: 6c7dd8e 19a0a85
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jun 8 13:58:40 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jun 8 13:58:40 2016 -0400

    Merge topic 'java-export-targets' into next
    
    19a0a85e Fix race condition creating java class list


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=19a0a85e3adc229a995846611bbc461be352635b
commit 19a0a85e3adc229a995846611bbc461be352635b
Author:     Matthew Woehlke <matthew.woehlke at kitware.com>
AuthorDate: Wed Jun 8 13:48:30 2016 -0400
Commit:     Matthew Woehlke <matthew.woehlke at kitware.com>
CommitDate: Wed Jun 8 13:48:30 2016 -0400

    Fix race condition creating java class list
    
    Modify logic to unconditionally create an empty class list response file
    to instead only create the empty file if no classes are being compiled.
    Otherwise, the response file is created via a custom command that
    generates the correct list.
    
    This fixes a race condition on certain systems (e.g. HFS on OS X) where
    the dependency for creating the "correct" list can have the "same" (due
    to limited precision of the filesystem) timestamp as the empty file
    created at configure time, resulting in an empty class list being
    incorrectly used to invoke `jar` (resulting in `jar` being unhappy that
    it was not given any input files). Although one would have some hope
    that this doesn't affect "real" projects, it definitely does affect the
    JavaExportImport unit test, causing the same to fail randomly when run
    on an HFS partition.

diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 6644bd4..cf9c2d7 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -609,11 +609,6 @@ function(add_jar _TARGET_NAME)
         endif ()
     endforeach()
 
-    # create an empty java_class_filelist
-    if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
-        file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
-    endif()
-
     if (_JAVA_COMPILE_FILES OR _JAVA_COMPILE_FILELISTS)
         set (_JAVA_SOURCES_FILELISTS)
 
@@ -653,6 +648,11 @@ function(add_jar _TARGET_NAME)
             DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
         )
+    else ()
+        # create an empty java_class_filelist
+        if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
+            file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
+        endif()
     endif ()
 
     # create the jar file

-----------------------------------------------------------------------

Summary of changes:
 Modules/UseJava.cmake |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list