Details

    Description

      1. CMake's Feature Summary is printing wrong information about variable CONNECT_JDBC (CONNECT_WITH_JDBC cached variable), that is by default ON

        - The following features have been disabled:
         * CONNECT_JDBC, Support for JDBC in the CONNECT storage engine
         * CONNECT_MONGODB, Support for MongoDB in the CONNECT storage engine
        

      2. Optimize the Cmake code by:
        1. making Java and JNI modules used by default Cmake module path
        2. making Java and JNI required

      Attachments

        Issue Links

          Activity

            anel Anel Husakovic added a comment - - edited

            With the suggested fix we get the following outputs:

            1. No java installed, error reported

              CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
                Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE
                Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE)
                (Required is at least version "1.6")
              Call Stack (most recent call first):
                /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
                /usr/share/cmake-3.16/Modules/FindJava.cmake:332 (find_package_handle_standard_args)
                storage/connect/CMakeLists.txt:282 (FIND_PACKAGE)
              

            2. Install openjdk-11-jdk-headless (405MB), Java found, but not JNI:

              -- Found Java: /usr/bin/java (found suitable version "11.0.18", minimum required is "1.6") 
              CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
                Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_AWT_INCLUDE_PATH)
              Call Stack (most recent call first):
                /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
                /usr/share/cmake-3.16/Modules/FindJNI.cmake:372 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
                storage/connect/CMakeLists.txt:283 (FIND_PACKAGE)
              

            3. Here we need default-jdk (GUI based applications) only for building the package

              -- Found Java: /usr/bin/java (found suitable version "11.0.18", minimum required is "1.6") 
              -- Found JNI: /usr/lib/jvm/default-java/lib/libjawt.so  
               
              The following features have been enabled:
               * CONNECT_LIBXML2, Support for LIBXML2 in the CONNECT storage engine
               * CONNECT_ODBC, Support for ODBC in the CONNECT storage engine
               * CONNECT_JDBC, Support for JDBC in the CONNECT storage engine
              

            4. Feature Summary change

              -- The following REQUIRED packages have been found:
               
               * Curses
               * Java (required version >= 1.6)
               * JNI
              

            5. Appendix:
              I couldn't see the value of using user defined FindJava.cmake and FindJNI.cmake files instead of default modules, so removed it as stated in 2.1 of description of MDEV.
              • Without above files, without Java we get the error:

                -- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) 
                CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
                  Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE
                  Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE)
                  (Required is at least version "1.6")
                Call Stack (most recent call first):
                  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
                  /usr/share/cmake-3.16/Modules/FindJava.cmake:332 (find_package_handle_standard_args)
                  storage/connect/CMakeLists.txt:281 (FIND_PACKAGE)
                

              • With above files and no Java (additional file is checked as expected):

                CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
                  Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY
                  JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
                Call Stack (most recent call first):
                  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
                  /usr/share/cmake-3.16/Modules/FindJNI.cmake:372 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
                  cmake/FindJNI.cmake:12 (include)
                  storage/connect/CMakeLists.txt:283 (FIND_PACKAGE)
                

            anel Anel Husakovic added a comment - - edited With the suggested fix we get the following outputs: No java installed, error reported CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE) (Required is at least version "1.6") Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.16/Modules/FindJava.cmake:332 (find_package_handle_standard_args) storage/connect/CMakeLists.txt:282 (FIND_PACKAGE) Install openjdk-11-jdk-headless (405MB), Java found, but not JNI: -- Found Java: /usr/bin/java (found suitable version "11.0.18", minimum required is "1.6") CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_AWT_INCLUDE_PATH) Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.16/Modules/FindJNI.cmake:372 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) storage/connect/CMakeLists.txt:283 (FIND_PACKAGE) Here we need default-jdk (GUI based applications) only for building the package -- Found Java: /usr/bin/java (found suitable version "11.0.18", minimum required is "1.6") -- Found JNI: /usr/lib/jvm/default-java/lib/libjawt.so   The following features have been enabled: * CONNECT_LIBXML2, Support for LIBXML2 in the CONNECT storage engine * CONNECT_ODBC, Support for ODBC in the CONNECT storage engine * CONNECT_JDBC, Support for JDBC in the CONNECT storage engine Feature Summary change -- The following REQUIRED packages have been found:   * Curses * Java (required version >= 1.6) * JNI Appendix: I couldn't see the value of using user defined FindJava.cmake and FindJNI.cmake files instead of default modules, so removed it as stated in 2.1 of description of MDEV. Without above files, without Java we get the error: -- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE) (Required is at least version "1.6") Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.16/Modules/FindJava.cmake:332 (find_package_handle_standard_args) storage/connect/CMakeLists.txt:281 (FIND_PACKAGE) With above files and no Java (additional file is checked as expected): CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.16/Modules/FindJNI.cmake:372 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) cmake/FindJNI.cmake:12 (include) storage/connect/CMakeLists.txt:283 (FIND_PACKAGE)

            Pushed with 1d0e3d80d84c2. Thanks for review.

            anel Anel Husakovic added a comment - Pushed with 1d0e3d80d84c2 . Thanks for review.

            this broke compilation on kvm-bintar-freebsd123-amd64, kvm-bintar-freebsd130-amd64, kvm-bintar-trusty-amd64, kvm-bintar-trusty-x86, kvm-fulltest, kvm-fulltest2, kvm-rpm-rhel8-aarch64, kvm-rpm-rocky8-aarch64, winx64-debug. Additionally it broke srpm builds on kvm-rpm-rhel8-amd64, kvm-rpm-rhel8-ppc64le, kvm-rpm-rocky84-amd64, kvm-rpm-centos74-amd64-debug, kvm-rpm-centos74-amd64, kvm-rpm-alma84-amd64.

            serg Sergei Golubchik added a comment - this broke compilation on kvm-bintar-freebsd123-amd64, kvm-bintar-freebsd130-amd64, kvm-bintar-trusty-amd64, kvm-bintar-trusty-x86, kvm-fulltest, kvm-fulltest2, kvm-rpm-rhel8-aarch64, kvm-rpm-rocky8-aarch64, winx64-debug. Additionally it broke srpm builds on kvm-rpm-rhel8-amd64, kvm-rpm-rhel8-ppc64le, kvm-rpm-rocky84-amd64, kvm-rpm-centos74-amd64-debug, kvm-rpm-centos74-amd64, kvm-rpm-alma84-amd64.
            anel Anel Husakovic added a comment - - edited

            danblack it seems default-jdk (debian/ubuntu) and java-11-openjdk-devel (rhel) is not installed on builders, example of getting the compilation error on aarch

            -- Performing Test ODBC_OK - Success
            CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
              Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
              Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE) (found suitable version
              "1.8.0_372", minimum required is "1.6")
            Call Stack (most recent call first):
              /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
              /usr/share/cmake/Modules/FindJava.cmake:336 (find_package_handle_standard_args)
              storage/connect/CMakeLists.txt:280 (FIND_PACKAGE)
            

            And not sure do we need this :

               # Add file to populate CPACK_RPM_BUILDREQUIRES
                FIND_FILE(Libjni_h jni.h PATHS ${JAVA_INCLUDE_PATH})
                IF(NOT JAVA_JVM_LIBRARY_DEP)
                  MESSAGE(FATAL_ERROR "No JAVA_JVM_LIBRARY_DEP set by FIND_JAVA")
                ENDIF()
                CPACK_RPM_connect-engine_PACKAGE_REQUIRES(${JAVA_JVM_LIBRARY_DEP})
            

            serg, Daniel is off couple of days , should I revert the patch since I don't have access to buildbot machines?

            anel Anel Husakovic added a comment - - edited danblack it seems default-jdk (debian/ubuntu) and java-11-openjdk-devel (rhel) is not installed on builders, example of getting the compilation error on aarch -- Performing Test ODBC_OK - Success CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE) (found suitable version "1.8.0_372", minimum required is "1.6") Call Stack (most recent call first): /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake/Modules/FindJava.cmake:336 (find_package_handle_standard_args) storage/connect/CMakeLists.txt:280 (FIND_PACKAGE) And not sure do we need this : # Add file to populate CPACK_RPM_BUILDREQUIRES FIND_FILE(Libjni_h jni.h PATHS ${JAVA_INCLUDE_PATH}) IF(NOT JAVA_JVM_LIBRARY_DEP) MESSAGE(FATAL_ERROR "No JAVA_JVM_LIBRARY_DEP set by FIND_JAVA") ENDIF() CPACK_RPM_connect-engine_PACKAGE_REQUIRES(${JAVA_JVM_LIBRARY_DEP}) serg , Daniel is off couple of days , should I revert the patch since I don't have access to buildbot machines?

            revert of fix, whatever you prefer

            serg Sergei Golubchik added a comment - revert of fix, whatever you prefer
            anel Anel Husakovic added a comment - - edited

            Hi serg

             
            -- The following features have been disabled:
             * CONNECT_JDBC, Support for JDBC in the CONNECT storage engine - Missing JAVA/JNI
             
            -- The following OPTIONAL packages have not been found:
             * Java (required version >= 1.6)
             * JNI
            # Rerun:
            -- Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVADOC_EXECUTABLE) (found suitable version "11.0.19", minimum required is "1.6")
            -- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
            

            I would go with Option 4.

            anel Anel Husakovic added a comment - - edited Hi serg Option 1: Ideally we need bb dependency, so if possible we can disable default value https://github.com/MariaDB/server/commit/a4ad56de34cd7fd18535d21e3fa3f9f966187b52 ( bb-10.4-anel- MDEV-31230 -fix-missing-dependency-option-1) Option 2: just revert Option 3: Revert with update of feature summary: https://github.com/MariaDB/server/commit/40466199ae2d8f414ae011e442b9f287b944b90a (bb-10.4-anel- MDEV-31230 -option-3-revert-and-update-featuresummary) and here is additional explaination: - `CONNECT_JDBC` is by default set to ON, but since missing Java/JNI dependency it actually was never built properly on bb. - Additionally, all JDBC related tests in `mtr` are disabled by author Olivier. - Commit 1d0e3d8 introduced Java/JNI to be required, but dependecies are not installed in bb and we broke the tree with the change. - Introducing change of default value of cached cmake variable `CONNECT_JDBC` from `ON`->`OFF` is not forwards compatible change, and as such I cannot be accepted(?). - This commit reverts commit 1d0e3d8 but is updating description of missing Java/JNI dependency for cmake's feature summary. Option 4: Remove required package https://github.com/MariaDB/server/commit/bfdf26ba5f913fa7e8b75aed871bf13c6ec190a5 (bb-10.4-anel- MDEV-31230 -option-4-remove-required)   -- The following features have been disabled: * CONNECT_JDBC, Support for JDBC in the CONNECT storage engine - Missing JAVA/JNI   -- The following OPTIONAL packages have not been found: * Java (required version >= 1.6) * JNI # Rerun: -- Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVADOC_EXECUTABLE) (found suitable version "11.0.19", minimum required is "1.6") -- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) I would go with Option 4.

            removing FindJava and FindJNI wrappers was wrong too, they have a purpose (fix a specific issue in cmake's files) and this issue wasn't fixed in cmake yet (as of 3.26.3)

            serg Sergei Golubchik added a comment - removing FindJava and FindJNI wrappers was wrong too, they have a purpose (fix a specific issue in cmake's files) and this issue wasn't fixed in cmake yet (as of 3.26.3)

            and cmake was not "printing wrong information about variable CONNECT_JDBC", there is no variable CONNECT_JDBC. There is a user-configurable setting CONNECT_WITH_JDBC which convey's user intention to enable the feature. It is ON by default. And there's a feature tag CONNECT_JDBC that shows in the summary whether the feature was actually enabled.

            As such there's no bug here, so reverting.

            If you want CONNECT_WITH_JDBC=ON to mean "absolutely enable JDBC or abort", then you cannot have it ON by default. Then you change CONNECT_WITH_JDBC to be a 3-value variable ON/OFF/AUTO with the default to AUTO. We have many variables like that: WITH_NUMA, MYSQL_MAINTAINER_MODE, ENABLED_LOCAL_INFILE, WITH_SAFEMALLOC, TRASH_FREED_MEMORY, WITH_INNODB_xxx, WITH_ROCKSDB_xxx, PLUGIN_xxx

            serg Sergei Golubchik added a comment - and cmake was not "printing wrong information about variable CONNECT_JDBC", there is no variable CONNECT_JDBC. There is a user-configurable setting CONNECT_WITH_JDBC which convey's user intention to enable the feature. It is ON by default. And there's a feature tag CONNECT_JDBC that shows in the summary whether the feature was actually enabled. As such there's no bug here, so reverting. If you want CONNECT_WITH_JDBC=ON to mean "absolutely enable JDBC or abort", then you cannot have it ON by default. Then you change CONNECT_WITH_JDBC to be a 3-value variable ON/OFF/AUTO with the default to AUTO. We have many variables like that: WITH_NUMA, MYSQL_MAINTAINER_MODE, ENABLED_LOCAL_INFILE, WITH_SAFEMALLOC, TRASH_FREED_MEMORY, WITH_INNODB_xxx, WITH_ROCKSDB_xxx, PLUGIN_xxx

            People

              serg Sergei Golubchik
              anel Anel Husakovic
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.