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/06/01 16:32:52 UTC

[GitHub] [nifi-minifi-cpp] lordgamez commented on a change in pull request #1086: MINIFICPP-1570 fix Azure SDK transient cmake patch failure

lordgamez commented on a change in pull request #1086:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1086#discussion_r643266738



##########
File path: cmake/BundledAzureSdkCpp.cmake
##########
@@ -16,7 +16,7 @@
 # under the License.
 
 function(use_bundled_libazure SOURCE_DIR BINARY_DIR)
-    set(PC "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/azure-sdk-cpp-for-cpp/azure-sdk-for-cpp-old-compiler.patch")
+    set(PC git reset --hard HEAD && "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/azure-sdk-cpp-for-cpp/azure-sdk-for-cpp-old-compiler.patch")

Review comment:
       It seems to be a problem now that when Minifi is built with the Azure extension and `make` command is called again with no change, because of the `git reset` the Azure extension is rebuilt. It's also a problem when `make package` is called because the preinstall target of CPack reruns the build command. For example we use it in docker image builds and the CPack phase takes considerably more time after. I tried and alternative command that seems to be working, which checks if the patch has already been applied and only applies it when needed:
   
   ```cmake
   set(PATCH_FILE "${SOURCE_DIR}/thirdparty/azure-sdk-cpp-for-cpp/azure-sdk-for-cpp-old-compiler.patch")
   set(PC "${Patch_EXECUTABLE}" -R -p1 -s -f --dry-run -i "${PATCH_FILE}" || "${Patch_EXECUTABLE}" -p1 -i "${PATCH_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