-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to paho-mqtt-c 1.3.8 and paho-mqtt-cpp 1.2.0 #4096
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b7a59a9
Update to paho-mqtt-c 1.3.8 and paho-mqtt-cpp 1.2.0
bowb 083a154
Fix config.yml add version 1.2.0
bowb bd2076c
Fix FindPahMqttC.cmake for static on WIN32
bowb 3c5b689
Fix patch.
bowb 97518af
Add final newline to patch.
bowb 58739e0
some newlines.
bowb a62891c
bind upstream version requirements on deps
prince-chrismc 95f020f
Merge pull request #1 from prince-chrismc/update/paho-mqtt-cpp
bowb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/cmake/FindPahoMqttC.cmake b/cmake/FindPahoMqttC.cmake | ||
index 53f15a3..7e2d756 100644 | ||
--- a/cmake/FindPahoMqttC.cmake | ||
+++ b/cmake/FindPahoMqttC.cmake | ||
@@ -6,8 +6,10 @@ else() | ||
set(_PAHO_MQTT_C_LIB_NAME paho-mqtt3a) | ||
endif() | ||
# add suffix when using static Paho MQTT C library variant | ||
-if(PAHO_BUILD_STATIC) | ||
- set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) | ||
+if(WIN32) | ||
+ if(PAHO_BUILD_STATIC) | ||
+ set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) | ||
+ endif() | ||
endif() | ||
|
||
find_library(PAHO_MQTT_C_LIBRARIES NAMES ${_PAHO_MQTT_C_LIB_NAME}) |
17 changes: 17 additions & 0 deletions
17
recipes/paho-mqtt-cpp/all/patches/1.1/0003-fix-win32-static-config-cmake.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/cmake/FindPahoMqttC.cmake b/cmake/FindPahoMqttC.cmake | ||
index 53f15a3..7e2d756 100644 | ||
--- a/cmake/FindPahoMqttC.cmake | ||
+++ b/cmake/FindPahoMqttC.cmake | ||
@@ -6,8 +6,10 @@ else() | ||
set(_PAHO_MQTT_C_LIB_NAME paho-mqtt3a) | ||
endif() | ||
# add suffix when using static Paho MQTT C library variant | ||
-if(PAHO_BUILD_STATIC) | ||
- set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) | ||
+if(WIN32) | ||
+ if(PAHO_BUILD_STATIC) | ||
+ set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) | ||
+ endif() | ||
endif() | ||
|
||
find_library(PAHO_MQTT_C_LIBRARIES NAMES ${_PAHO_MQTT_C_LIB_NAME}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ versions: | |
folder: "all" | ||
"1.1": | ||
folder: "all" | ||
"1.2.0": | ||
folder: "all" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not match
conan-center-index/recipes/paho-mqtt-c/all/conanfile.py
Lines 123 to 124 in 85f47df
can you explain why you added this patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.3.8 paho-mqtt-c build is removing -static from the library name for non WIN32 builds.
Example 1.3.8
This patch is to be able to build older versions of paho-mqtt-cpp with version 1.3.8 of paho-mqtt-c and to make sure the library name is correct for non WIN32 platforms.
paho-mqtt-cpp FindPahoMqtt
The target concat with -static should still work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3903 leave's this in a grey zone....
I could not image there's an expectation from consumer that older
-cpp
s will work with newer-c
sInstead of a patch I would suggestion having a conditional requirements... and adding a
validate()
method to make sure the overrides are correctDoes not sound reasonable to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build for paho-mqtt-cpp was broken for non x86_64 platforms. The patch will also fix building on other architectures. I am a bit new to conan so I don't know the correct path forward to fix non x86_64 broken builds with older -cpp consumers.
Do you have an example where this has been done?
I also don't know how long the non x86_64 builds have been broken, as I was unable to build anything in the 1.3 series of paho-mqtt-c before 1.3.8 with paho-mqtt-cpp consuming it with the following exception with a specific recipe; paho-mqtt-c/1.3.5@#acc9376a7232c5a50ac898a9131c6c82, which caused conan to want to run with --update and I am wanting to pin versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would patching this be allowed under #3903 for the following:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 1.2.0 fixed the static suffix for non WIN32 builds shown here 1.2.0 fix -static suffix. The patches I added were to fix this for older versions. Non x86 builds do not have a downloadable binary from the conan index repo and have to be built from source. The static suffix for older versions was expected to be there but wasn't on non WIN32 builds so building from source was failing. See #3760
Creating a validate() method and fixing up requirements might be fairly straight forward, but a large majority of static build configuration not having a pre-built paho-mqtt-c library available on conan center would trigger ConanInvalidConfiguration.
Does the namespace handle this? https://github.com/eclipse/paho.mqtt.c/blame/e047e25d34d53b4b265649144a3cac3b01eee76c/src/CMakeLists.txt#L308
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should delete the file you are trying to patch. And change the call to
find_package
to use the official one you pointed toConan works replicated the standard files from build systems, for CMake using theses generators
conan-center-index/recipes/paho-mqtt-cpp/all/conanfile.py
Line 14 in 58739e0
Will create the correct
Find<Package>.cmake
filesconan-center-index/recipes/paho-mqtt-c/all/conanfile.py
Line 93 in 58739e0
➡️ But I do not like this either
The Problem
paho-mqtt-cpp
does not use official/correct cmake generated files frompaho-mqtt-c
No, the
-cpp
project is completely skipping the-c
files generation... the owner explained his reasoning .... sadly best practices have changedSolution
paho-mqtt-c
https://github.com/eclipse/paho.mqtt.c/blob/v1.3.8/src/CMakeLists.txt#L154
does not match the Code in this repository as I pointed our here #4096 (comment)
paho-mqtt-cpp
self.version < 1.2.0
-c
MUST be less then 1.3.8else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being a conan build newb, I am trying to understand how to know if the -cpp uses the correct -c cmake files. Is the following correct?
The -c package_info is being called by the -cpp build and the cmake Find file is being placed in the -cpp build directory. The -cpp build then uses those generated cmake find files to locate the eclipse-paho-mqtt-c library files.
Is it the generators in the -cpp recipe doing this? - generators = "cmake", "cmake_find_package"
I can get it to build with generators = "cmake", and this doesn't generate the Findeclipse-paho-mqtt-c.cmake file. Is there more going on?
My changes on the -cpp conanfile.py currently looks like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I am sorry for the delay, this is a complicated issue, and the solution is not trivial, just needed to have some free time to look at it.
Welcome to the club 🤣 💟
Yes.
I am not 100% sure that is the case 🙊 I think it's using the file included in the -cpp project not the conan ones
You're comments seem to confirm I suspicion!
Yes.
I am afraid so...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed by eclipse-paho/paho.mqtt.c@f875768
and eclipse-paho/paho.mqtt.c@c116b72
I think I found a solution....