You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/01/07 15:05:07 UTC

[GitHub] [nifi-minifi-cpp] arpadboda opened a new pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

arpadboda opened a new pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973


   Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced
        in the commit message?
   
   - [ ] Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically main)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   ### For code changes:
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the LICENSE file?
   - [ ] If applicable, have you updated the NOTICE file?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] fgerlits commented on a change in pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
fgerlits commented on a change in pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#discussion_r558012683



##########
File path: cmake/BundledOSSPUUID.cmake
##########
@@ -21,8 +21,8 @@ function(use_bundled_osspuuid SOURCE_DIR BINARY_DIR)
     message("Using bundled ossp-uuid")
 
     # Define patch step
-    set(PC "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
-           "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch")
+    set(PC "${Patch_EXECUTABLE}" -p1 -N -r- -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
+           "${Patch_EXECUTABLE}" -p1 -N -r- -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch" || :)

Review comment:
       I'm OK with a change that ignores "already applied" errors only and not all errors.  I would also be OK with reverting this part of the change, so we just live with the "already applied" errors until we figure out how to fix them properly.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
szaszm commented on pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#issuecomment-756763519


   Not debian, but I get this error when trying to build this PR with SQL enabled
   ```make[2]: *** No rule to make target 'extensions/sql/thirdparty/iodbc-install//lib64/libiodbc.a', needed by 'main/minifi'.  Stop.```
   on main I get a similar error, but for `libsoci_odbc.a` instead.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#discussion_r559617910



##########
File path: cmake/BundledOSSPUUID.cmake
##########
@@ -21,8 +21,11 @@ function(use_bundled_osspuuid SOURCE_DIR BINARY_DIR)
     message("Using bundled ossp-uuid")
 
     # Define patch step
-    set(PC "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
-           "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch")
+    set(PC "${Patch_EXECUTABLE}" -p1 -N -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
+            "${Patch_EXECUTABLE}" -p1 -N -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch" ||
+            # if already applied, reverse application should succeed
+            "${Patch_EXECUTABLE}" -p1 -R --dry-run -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
+            "${Patch_EXECUTABLE}" -p1 -R --dry-run -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch")

Review comment:
       https://github.com/szaszm/nifi-minifi-cpp/commit/fee00580740c578a64956d3e448c7729f9bb44b0




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] arpadboda commented on pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
arpadboda commented on pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#issuecomment-756765763


   > Not debian, but I get this error when trying to build this PR with SQL enabled
   > `make[2]: *** No rule to make target 'extensions/sql/thirdparty/iodbc-install//lib64/libiodbc.a', needed by 'main/minifi'. Stop.`
   > on main I get a similar error, but for `libsoci_odbc.a` instead.
   
   This PR was meant to address the latter, but cmake caching is so f... up that you never know when you have the good setup. Will tackle this a bit more. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] arpadboda commented on pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
arpadboda commented on pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#issuecomment-756765763


   > Not debian, but I get this error when trying to build this PR with SQL enabled
   > `make[2]: *** No rule to make target 'extensions/sql/thirdparty/iodbc-install//lib64/libiodbc.a', needed by 'main/minifi'. Stop.`
   > on main I get a similar error, but for `libsoci_odbc.a` instead.
   
   This PR was meant to address the latter, but cmake caching is so f... up that you never know when you have the good setup. Will tackle this a bit more. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#discussion_r557489283



##########
File path: cmake/BundledOSSPUUID.cmake
##########
@@ -21,8 +21,8 @@ function(use_bundled_osspuuid SOURCE_DIR BINARY_DIR)
     message("Using bundled ossp-uuid")
 
     # Define patch step
-    set(PC "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
-           "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch")
+    set(PC "${Patch_EXECUTABLE}" -p1 -N -r- -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
+           "${Patch_EXECUTABLE}" -p1 -N -r- -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch" || :)

Review comment:
       Note for @arpadboda: A clean build works on gentoo without the changes in this file.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] fgerlits commented on a change in pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
fgerlits commented on a change in pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#discussion_r559595576



##########
File path: cmake/BundledOSSPUUID.cmake
##########
@@ -21,8 +21,11 @@ function(use_bundled_osspuuid SOURCE_DIR BINARY_DIR)
     message("Using bundled ossp-uuid")
 
     # Define patch step
-    set(PC "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
-           "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch")
+    set(PC "${Patch_EXECUTABLE}" -p1 -N -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
+            "${Patch_EXECUTABLE}" -p1 -N -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch" ||
+            # if already applied, reverse application should succeed
+            "${Patch_EXECUTABLE}" -p1 -R --dry-run -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
+            "${Patch_EXECUTABLE}" -p1 -R --dry-run -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch")

Review comment:
       It would be nicer to have a `( ... )` around the `--dry-run` commands.  Otherwise, if the first two patch commands succeed, we skip the third command, but execute the fourth.  This is not a big problem, as the fourth command should succeed, but it isn't nice.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
szaszm commented on pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#issuecomment-756767879


   A bit more info after trying to build this PR:
   ```
   szaszm@szaszm-pc:~/nifi-minifi-cpp-2/cmake-build-relwithdebinfo-gcc-large$ find -name libsoci_odbc.a
   ./extensions/sql/soci-external-prefix/src/soci-external-build/lib/libsoci_odbc.a
   ./extensions/sql/thirdparty/soci-install/lib64/libsoci_odbc.a
   szaszm@szaszm-pc:~/nifi-minifi-cpp-2/cmake-build-relwithdebinfo-gcc-large$ find -name libiodbc.a
   ./extensions/sql/thirdparty/iodbc-install/lib/libiodbc.a
   ./extensions/sql/thirdparty/iodbc-src/iodbc/.libs/libiodbc.a
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] lordgamez commented on a change in pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
lordgamez commented on a change in pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#discussion_r557354361



##########
File path: extensions/sql/CMakeLists.txt
##########
@@ -89,11 +84,12 @@ find_package(Patch)
 set(PC "${Patch_EXECUTABLE}" -p1 -i "${CMAKE_CURRENT_SOURCE_DIR}/patch/soci.patch")
 
 # Define byproducts
-if(NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 8)
-	include(GNUInstallDirs)
-	set(LIBDIR "${CMAKE_INSTALL_LIBDIR}")
-else()
+# This should be based on GNUInstallDirs, but it's done wrong in Soci:
+# https://github.com/SOCI/soci/blob/release/4.0/CMakeLists.txt#L140
+if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)

Review comment:
       Shouldn't this be always "lib" for WIN32 as well?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm closed pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
szaszm closed pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
szaszm commented on pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#issuecomment-756763519






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] fgerlits commented on a change in pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
fgerlits commented on a change in pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#discussion_r557480936



##########
File path: cmake/BundledOSSPUUID.cmake
##########
@@ -21,8 +21,8 @@ function(use_bundled_osspuuid SOURCE_DIR BINARY_DIR)
     message("Using bundled ossp-uuid")
 
     # Define patch step
-    set(PC "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
-           "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch")
+    set(PC "${Patch_EXECUTABLE}" -p1 -N -r- -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
+           "${Patch_EXECUTABLE}" -p1 -N -r- -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch" || :)

Review comment:
       That `|| :` is not very nice -- is it there because of the "patch already applied" error we sometimes get?  I haven't seen that error too many times, and I'd rather do a clean rebuild (until we can fix the problem properly) than possibly ignore real errors thrown by `patch`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
arpadboda commented on a change in pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#discussion_r557356135



##########
File path: extensions/sql/CMakeLists.txt
##########
@@ -89,11 +84,12 @@ find_package(Patch)
 set(PC "${Patch_EXECUTABLE}" -p1 -i "${CMAKE_CURRENT_SOURCE_DIR}/patch/soci.patch")
 
 # Define byproducts
-if(NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 8)
-	include(GNUInstallDirs)
-	set(LIBDIR "${CMAKE_INSTALL_LIBDIR}")
-else()
+# This should be based on GNUInstallDirs, but it's done wrong in Soci:
+# https://github.com/SOCI/soci/blob/release/4.0/CMakeLists.txt#L140
+if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)

Review comment:
       This is now consistent with what the lib does internally (see the link in the comment above), so I assume this to be correct for Win as well. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #973: MINIFICPP-1446 - SQL extension doesn't compile on Debian

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#discussion_r557487939



##########
File path: cmake/BundledOSSPUUID.cmake
##########
@@ -21,8 +21,8 @@ function(use_bundled_osspuuid SOURCE_DIR BINARY_DIR)
     message("Using bundled ossp-uuid")
 
     # Define patch step
-    set(PC "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
-           "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch")
+    set(PC "${Patch_EXECUTABLE}" -p1 -N -r- -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
+           "${Patch_EXECUTABLE}" -p1 -N -r- -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch" || :)

Review comment:
       That was me, I admit it's not a nice solution. The intention was to stop patch from throwing errors when it has already been applied, but the only way was to stop it from throwing errors altogether.
   
   I got an idea that maybe instead of `|| :` at the end, we could try reverse applying with `--dry-run` to not actually change anything. This would verify that either we could apply the patch or it could be reverse applied, i.e. it has already been applied. Would this be a good enough workaround for you or do you want to revert the whole change?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org