Update package mosquitto
cover Update package mosquitto
This patchset extend the mosquitto integration with Buildroot's build system and other packages, thanks to configuration options that have been introduced in mosquitto 1.5; and bump mosquitto to the latest version (1.6.3).
Interesting new features in mosquitto 1.6 include:
* Explicit support for TLS v1.3 (and drop support for TLS v1.0)
* Support for new mqttv5 protocol
* Remove dependency on libuuid
Titouan Christophe (3):
package/mosquitto: allow to build as static lib package/mosquitto: Switch systemd unit to Type=notify and depend on
network
package/mosquitto: bump to v1.6.3
package/mosquitto/Config.in | 4 ---- package/mosquitto/mosquitto.hash | 2 +- package/mosquitto/mosquitto.mk | 19 +++++++++++-------- package/mosquitto/mosquitto.service | 3 +++ 4 files changed, 15 insertions(+), 13 deletions(-)
Signature · 1 line
2.21.0
PATCH 1/3 package/mosquitto: allow to build as static lib
--- package/mosquitto/Config.in | 4 ---- package/mosquitto/mosquitto.mk | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-)
package/mosquitto/Config.in +0 -4
@@ -1,6 +1,5 @@ config BR2_PACKAGE_MOSQUITTO bool "mosquitto" - depends on !BR2_STATIC_LIBS # builds .so help Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and
@@ -22,6 +21,3 @@ config BR2_PACKAGE_MOSQUITTO_BROKER comment "mosquitto broker needs a system with MMU" depends on BR2_PACKAGE_MOSQUTTO && !BR2_USE_MMU - -comment "mosquitto needs a toolchain w/ dynamic library" - depends on BR2_STATIC_LIBS
package/mosquitto/mosquitto.mk +6 -0
@@ -17,6 +17,12 @@ MOSQUITTO_MAKE_OPTS = \ WITH_WRAP=no \ WITH_DOCS=no +ifeq ($(BR2_STATIC_LIBS),y) +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes WITH_SHARED_LIBRARIES=no +else +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes +endif + # adns uses getaddrinfo_a ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y) MOSQUITTO_MAKE_OPTS += WITH_ADNS=yes
Signature · 1 line
2.21.0
PATCH 1/3 package/mosquitto: allow to build as static lib
Quoted 31 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Titouan" == Titouan Christophe <[email protected]> writes:
Signed-off-by Titouan Christophe <[email protected]>--- package/mosquitto/Config.in | 4 ---- package/mosquitto/mosquitto.mk | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-)package/mosquitto/Config.in +0
-4@@ -1,6 +1,5 @@ config BR2_PACKAGE_MOSQUITTO bool "mosquitto" - depends on !BR2_STATIC_LIBS # builds .so help Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and@@ -22,6 +21,3 @@ config BR2_PACKAGE_MOSQUITTO_BROKER comment "mosquitto broker needs a system with MMU" depends on BR2_PACKAGE_MOSQUTTO && !BR2_USE_MMU - -comment "mosquitto needs a toolchain w/ dynamic library" - depends on BR2_STATIC_LIBSpackage/mosquitto/mosquitto.mk +0
-0
package/mosquitto/mosquitto.mk MOSQUITTO_MAKE_OPTS = \ · line 24
Quoted 8 lines
package/mosquitto/mosquitto.mk +5
-0@@ -17,6 +17,12 @@ MOSQUITTO_MAKE_OPTS = \ WITH_WRAP=no \ WITH_DOCS=no +ifeq ($(BR2_STATIC_LIBS),y) +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes WITH_SHARED_LIBRARIES=no +else +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes +endif
We actually have 3 variants:
- static only (BR2_STATIC_LIBS)
- shared only (BR2_SHARED_LIBS)
- shared and static (BR2_SHARED_STATIC_LIBS)
So I reworked it to take that into consideration and committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/3 package/mosquitto: allow to build as static lib
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Korsgaard <[email protected]> writes:
Hi,
Quoted 8 lines
package/mosquitto/mosquitto.mk MOSQUITTO_MAKE_OPTS = \ · line 24
Quoted 5 lines
package/mosquitto/mosquitto.mk +5
-0+ifeq ($(BR2_STATIC_LIBS),y) +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes WITH_SHARED_LIBRARIES=no +else +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes +endifWe actually have 3 variants:
Quoted 5 lines
- static only (
BR2_STATIC_LIBS)
- shared only (BR2_SHARED_LIBS)
- shared and static (BR2_SHARED_STATIC_LIBS)So I reworked it to take that into consideration and committed, thanks.
Sorry, I will have to take that back. I did a test compilation with a completely static (BR2_STATIC_LIBS) setup, which failed:
In file included from security.c:25:
lib_load.h:23:11: fatal error: dlfcn.h: No such file or directory
# include <dlfcn.h>
^~~~~~~~~
compilation terminated.The loadable plugin logic in security.c seems to be built unconditionally, so that cannot work in a completely static setup.
Care to bring up this issue upstream?
In the mean time I have marked your patch as changes requested. For reference, the changes I did in mosquitto.mk look like this:
feq ($(BR2_SHARED_LIBS),y)MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no
elseMOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes
endif
ifeq ($(BR2_STATIC_LIBS),y)MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=no
elseMOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=yes
endif
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/3 package/mosquitto: allow to build as static lib
Hello Peter,
Thank you for reviewing this series !
Quoted 12 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Korsgaard <[email protected]> writes:
Hi,
Quoted 7 lines
package/mosquitto/mosquitto.mk MOSQUITTO_MAKE_OPTS = \ · line 24
Quoted 5 lines
package/mosquitto/mosquitto.mk +5
-0+ifeq ($(BR2_STATIC_LIBS),y) +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes WITH_SHARED_LIBRARIES=no +else +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes +endifWe actually have 3 variants:
Quoted 8 lines
Quoted 5 lines
- static only (
BR2_STATIC_LIBS)
- shared only (BR2_SHARED_LIBS)
- shared and static (BR2_SHARED_STATIC_LIBS)So I reworked it to take that into consideration and committed, thanks.
Sorry, I will have to take that back. I did a test compilation with a completely static (
BR2_STATIC_LIBS) setup, which failed:
Could you share the defconfig you have used to obtain that result ?
When I run test-pkg with BR2_PACKAGE_MOSQUITTO=y (and BR2_PACKAGE_MOSQUITTO_BROKER defaults to y), I see:
"""br-arm-full-static [5/6]: OK""".
Quoted 11 lines
In file included from security.c:25:
lib_load.h:23:11: fatal error:dlfcn.h: No such file or directory# include <dlfcn.h> ^~~~~~~~~ compilation terminated.The loadable plugin logic in
security.cseems to be built unconditionally, so that cannot work in a completely static setup.Care to bring up this issue upstream?
As soon as I understand the conditions to reproduce, I will do so.
Quoted 10 lines
In the mean time I have marked your patch as changes requested. For reference, the changes I did in mosquitto.mk look like this:
feq ($(BR2_SHARED_LIBS),y)
MOSQUITTO_MAKE_OPTS+= WITH_STATIC_LIBRARIES=no
elseMOSQUITTO_MAKE_OPTS+= WITH_STATIC_LIBRARIES=yes
endif
Quoted 6 lines
ifeq ($(BR2_STATIC_LIBS),y)
MOSQUITTO_MAKE_OPTS+= WITH_SHARED_LIBRARIES=no
elseMOSQUITTO_MAKE_OPTS+= WITH_SHARED_LIBRARIES=yes
endif
Thanks for sharing !
Best regards,
Titouan
PATCH 1/3 package/mosquitto: allow to build as static lib
Quoted 22 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Titouan" == Titouan Christophe <[email protected]> writes:
Hello Peter,
Thank you for reviewing this series !Quoted 16 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Korsgaard <[email protected]> writes:
Hi,
Quoted 11 lines
package/mosquitto/mosquitto.mk MOSQUITTO_MAKE_OPTS = \ · line 24
Quoted 5 lines
package/mosquitto/mosquitto.mk +5
-0+ifeq ($(BR2_STATIC_LIBS),y) +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes WITH_SHARED_LIBRARIES=no +else +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes +endifWe actually have 3 variants:
- static only (
BR2_STATIC_LIBS)
- shared only (BR2_SHARED_LIBS)
- shared and static (BR2_SHARED_STATIC_LIBS)
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
So I reworked it to take that into consideration and committed, thanks.
Sorry, I will have to take that back. I did a test compilation with a completely static (
BR2_STATIC_LIBS) setup, which failed:Could you share the defconfig you have used to obtain that result ?
It was afaik just the default arm variant with BR2_STATIC_LIBS enabled.
Quoted 3 lines
When I run test-pkg with BR2_PACKAGE_MOSQUITTO=y (and
BR2_PACKAGE_MOSQUITTO_BROKERdefaults to y), I see:
"""br-arm-full-static [5/6]: OK""".
Hmm, very odd. With current git HEAD and this patch 1/3 applied and the following config:
BR2_arm=y
BR2_STATIC_LIBS=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-static-2019.02-rc1.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_7=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_4=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_PACKAGE_MOSQUITTO=y
(E.G. support/config-fragments/autobuild/br-arm-full-static.config + mosquitto)
I get the expected failure:
In file included from security.c:25:0:
lib_load.h:23:11: fatal error: dlfcn.h: No such file or directory
# include <dlfcn.h>
^~~~~~~~~
compilation terminated.
Makefile:189: recipe for target 'security.o' failedbr-arm-full-static-2019.02-rc1.tar.bz2 does not contain a dlfcn.h file, so that makes sense.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/3 package/mosquitto: allow to build as static lib
Hello,
Quoted 10 lines · Peter Korsgaard
It was afaik just the default arm variant with
BR2_STATIC_LIBSenabled.Quoted 3 lines
When I run test-pkg with BR2_PACKAGE_MOSQUITTO=y (and
BR2_PACKAGE_MOSQUITTO_BROKERdefaults to y), I see:
"""br-arm-full-static [5/6]: OK""".Hmm, very odd. With current git HEAD and this patch 1/3 applied and the following config:
Quoted 12 lines
BR2_arm=y
BR2_STATIC_LIBS=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-static-2019.02-rc1.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_7=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_4=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
#BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUGis not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_PACKAGE_MOSQUITTO=y
Indeed, when doing a regular make (and not test-pkg) with this defconfig I can reproduce the aforementioned failure.
Quoted 6 lines
(E.G.
support/config-fragments/autobuild/br-arm-full-static.config+ mosquitto)I get the expected failure:
In file included from security.c:25:0:
lib_load.h:23:11: fatal error:dlfcn.h: No such file or directory
Quoted 8 lines
# include <dlfcn.h> ^~~~~~~~~ compilation terminated. Makefile:189: recipe for target 'security.o' failedbr-arm-full-static-2019.02-rc1.tar.bz2 does not contain a
dlfcn.hfile, so that makes sense.
Now, when looking at mosquitto, I understand that WITH_SHARED_LIBRARY=no implies that libmosquitto.so won't be created (and linked against).
However, the failure over here is due to some code in the broker which is intended to dynamically load modules at runtime, no matter if mosquitto is running inside a statically linked executable or from a dylib.
As such, I suggest then to only make the broker depend on BR2_SHARED_LIBS, while still allowing the client lib to be built statically, which in my opinion makes sense for embedded targets. What do you think ?
Kind regards,
Titouan
PATCH 1/3 package/mosquitto: allow to build as static lib
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Titouan" == Titouan Christophe <[email protected]> writes:
Hi,
Quoted 2 lines
Indeed, when doing a regular make (and not test-pkg) with this defconfig I can reproduce the aforementioned failure.
Funky, but OK.
Quoted 9 lines
Now, when looking at mosquitto, I understand that WITH_SHARED_LIBRARY=no implies that libmosquitto.so won't be created (and linked against).
However, the failure over here is due to some code in the broker which is intended to dynamically load modules at runtime, no matter if mosquitto is running inside a statically linked executable or from a dylib.
Quoted 4 lines
As such, I suggest then to only make the broker depend on
BR2_SHARED_LIBS, while still allowing the client lib to be built statically, which in my opinion makes sense for embedded targets. What do you think ?
Yes, that could work. Will you send a patch for that?
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/3 package/mosquitto: Switch systemd unit to Type=notify and depend on network
In reply to Titouan Christophe---
RFC: Would it be better to use the mosquitto.service file provided upstream ?
https://github.com/eclipse/mosquitto/blob/master/service/systemd/mosquitto.service.notify
--- package/mosquitto/mosquitto.mk | 4 ++++ package/mosquitto/mosquitto.service | 3 +++ 2 files changed, 7 insertions(+)
package/mosquitto/mosquitto.mk +4 -0
@@ -23,6 +23,10 @@ else MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes endif +ifeq ($(BR2_PACKAGE_SYSTEMD),y) +MOSQUITTO_MAKE_OPTS += WITH_SYSTEMD=yes +endif + # adns uses getaddrinfo_a ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y) MOSQUITTO_MAKE_OPTS += WITH_ADNS=yes
package/mosquitto/mosquitto.service +3 -0
@@ -1,7 +1,10 @@ [Unit] Description=Mosquitto MQTT broker +After=network-online.target +Wants=network-online.target [Service] +Type=notify ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf ExecReload=/bin/kill -HUP $MAINPID Restart=always
Signature · 1 line
2.21.0
PATCH 2/3 package/mosquitto: Switch systemd unit to Type=notify and depend on network
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Titouan" == Titouan Christophe <[email protected]> writes:
Signed-off-by Titouan Christophe <[email protected]>
It would be great if your commit message would explain _WHY_ this is done, not just _WHAT_ the change is - E.G. what is the advantage of type=notify?
Quoted 3 lines
---
RFC: Would it be better to use the mosquitto.service file provided upstream ?
https://github.com/eclipse/mosquitto/blob/master/service/systemd/mosquitto.service.notify
Not knowing much about systemd, but I think so. The differences look quite small.
Quoted 10 lines
--- package/mosquitto/mosquitto.mk | 4 ++++ package/mosquitto/mosquitto.service | 3 +++ 2 files changed, 7 insertions(+)package/mosquitto/mosquitto.mk +0
-0
package/mosquitto/mosquitto.mk else · line 27
Quoted 5 lines
package/mosquitto/mosquitto.mk +2
-0@@ -23,6 +23,10 @@ else MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes endif +ifeq ($(BR2_PACKAGE_SYSTEMD),y) +MOSQUITTO_MAKE_OPTS += WITH_SYSTEMD=yes
This is not mentioned in the commit message. I see this causes mosquitto to link with -lsystemd, so you need to add systemd to MOSQUITTO_DEPENDENCIES.
Care to send an updated patch with a more descriptive commit message, reusing the upstream service file and adding systemd to _DEPENDENCIES?
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/3 package/mosquitto: Switch systemd unit to Type=notify and depend on network
Hello Peter,
Quoted 6 lines · Peter Korsgaard
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Titouan" == Titouan Christophe <[email protected]> writes:
Signed-off-by Titouan Christophe <[email protected]>It would be great if your commit message would explain _WHY_ this is done, not just _WHAT_ the change is - E.G. what is the advantage of type=notify?
Sure !
Quoted 7 lines
Quoted 4 lines
---
RFC: Would it be better to use the mosquitto.service file provided upstream ?
https://github.com/eclipse/mosquitto/blob/master/service/systemd/mosquitto.service.notifyNot knowing much about systemd, but I think so. The differences look quite small.
Yes, that's why I think it would be better to use the upstreamed one for that. I'm not sure of Buildroot's policy regarding config files provided by the packages themselves, hence the question.
Quoted 14 lines
Quoted 13 lines
--- package/mosquitto/mosquitto.mk | 4 ++++ package/mosquitto/mosquitto.service | 3 +++ 2 files changed, 7 insertions(+)package/mosquitto/mosquitto.mk +0
-0@@ -23,6 +23,10 @@ else MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes endif
Quoted 6 lines
package/mosquitto/mosquitto.mk else · line 27
Quoted 2 lines
package/mosquitto/mosquitto.mk +2
-0+ifeq ($(BR2_PACKAGE_SYSTEMD),y) +MOSQUITTO_MAKE_OPTS += WITH_SYSTEMD=yesThis is not mentioned in the commit message. I see this causes mosquitto to link with -lsystemd, so you need to add systemd to
MOSQUITTO_DEPENDENCIES.
Ok
Quoted 4 lines
Care to send an updated patch with a more descriptive commit message, reusing the upstream service file and adding systemd to
_DEPENDENCIES?
Sure, I'll respin that one
Regards,
Titouan
PATCH 3/3 package/mosquitto: bump to v1.6.3
In reply to Titouan Christophe* Drop dependency on libuuid
--- package/mosquitto/mosquitto.hash | 2 +- package/mosquitto/mosquitto.mk | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-)
package/mosquitto/mosquitto.hash +1 -1
@@ -1,5 +1,5 @@ # Locally calculated after checking gpg signature -sha256 78d7e70c3794dc3a1d484b4f2f8d3addebe9c2da3f5a1cebe557f7d13beb0da4 mosquitto-1.5.8.tar.gz +sha256 9ef5cc75f4fe31d7bf50654ddf4728ad9e1ae2e5609a4b42ecbbcb4a209ed17e mosquitto-1.6.3.tar.gz # License files sha256 cc77e25bafd40637b7084f04086d606f0a200051b61806f97c93405926670bc1 LICENSE.txt
package/mosquitto/mosquitto.mk +1 -8
@@ -4,7 +4,7 @@ # ################################################################################ -MOSQUITTO_VERSION = 1.5.8 +MOSQUITTO_VERSION = 1.6.3 MOSQUITTO_SITE = https://mosquitto.org/files/source MOSQUITTO_LICENSE = EPL-1.0 or EDLv1.0 MOSQUITTO_LICENSE_FILES = LICENSE.txt epl-v10 edl-v10
@@ -54,13 +54,6 @@ else MOSQUITTO_MAKE_OPTS += WITH_SRV=no endif -ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y) -MOSQUITTO_DEPENDENCIES += util-linux -MOSQUITTO_MAKE_OPTS += WITH_UUID=yes -else -MOSQUITTO_MAKE_OPTS += WITH_UUID=no -endif - ifeq ($(BR2_PACKAGE_LIBWEBSOCKETS),y) MOSQUITTO_DEPENDENCIES += libwebsockets MOSQUITTO_MAKE_OPTS += WITH_WEBSOCKETS=yes
Signature · 1 line
2.21.0
PATCH 3/3 package/mosquitto: bump to v1.6.3
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Titouan" == Titouan Christophe <[email protected]> writes:
* Drop dependency on libuuid
It would be good to explain why this can be removed.
Committed with an extended commit message, thanks.
Signature · 1 line
Bye, Peter Korsgaard