All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/2] package/mosquitto: bump to v1.6.11
@ 2020-08-19 12:05 Titouan Christophe
  2020-08-19 12:05 ` [Buildroot] [PATCH v2 2/2] package/{collectd, domoticz, shairport-sync}: fix mosquitto dependencies Titouan Christophe
  2020-08-27 21:32 ` [Buildroot] [PATCH v2 1/2] package/mosquitto: bump to v1.6.11 Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Titouan Christophe @ 2020-08-19 12:05 UTC (permalink / raw)
  To: buildroot

Mosquitto 1.6.11 is a bugfix release, read the whole announcement on
http://mosquitto.org/blog/2020/08/version-1-6-11-released/

From the changelog of the client library:
mosquitto_loop_start() now sets a thread name on Linux, FreeBSD, NetBSD,
and OpenBSD. Closes #1777.
This is done with pthread_setname_np; so mosquitto now requires
BR2_TOOLCHAIN_HAS_THREADS_NPTL when built with threading support.

Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
Changes v1 -> v2:
* Only depend on NPTL when compiling with threading support, introduce
  BR2_PACKAGE_MOSQUITTO_WITH_THREADING
---
 ...thread-when-compiling-without-thread.patch | 40 +++++++++++++++++++
 package/mosquitto/Config.in                   |  5 +++
 package/mosquitto/mosquitto.hash              |  4 +-
 package/mosquitto/mosquitto.mk                |  4 +-
 4 files changed, 49 insertions(+), 4 deletions(-)
 create mode 100644 package/mosquitto/0001-do-not-include-pthread-when-compiling-without-thread.patch

diff --git a/package/mosquitto/0001-do-not-include-pthread-when-compiling-without-thread.patch b/package/mosquitto/0001-do-not-include-pthread-when-compiling-without-thread.patch
new file mode 100644
index 0000000000..3bdd73a629
--- /dev/null
+++ b/package/mosquitto/0001-do-not-include-pthread-when-compiling-without-thread.patch
@@ -0,0 +1,40 @@
+From 6904a7a6e2e0835eda2dcd62fb982f302d7a8ba0 Mon Sep 17 00:00:00 2001
+From: Titouan Christophe <titouan.christophe@railnova.eu>
+Date: Tue, 18 Aug 2020 01:26:58 +0200
+Subject: do not include pthread when compiling without threading support
+
+This fixes the following error, when compiling for systems without
+pthread support, and when passing WITH_THREADING=no to make:
+
+    thread_mosq.c:24:12: fatal error: pthread.h: No such file or directory
+     #  include <pthread.h>
+                 ^~~~~~~~~~~
+    compilation terminated.
+
+[Upstream status: https://github.com/eclipse/mosquitto/pull/1794]
+Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
+---
+ lib/thread_mosq.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/lib/thread_mosq.c b/lib/thread_mosq.c
+index b05c1d2a..46e19807 100644
+--- a/lib/thread_mosq.c
++++ b/lib/thread_mosq.c
+@@ -20,11 +20,13 @@ Contributors:
+ #include <time.h>
+ #endif
+ 
++#if defined(WITH_THREADING)
+ #if defined(__linux__) || defined(__NetBSD__)
+ #  include <pthread.h>
+ #elif defined(__FreeBSD__) || defined(__OpenBSD__)
+ #  include <pthread_np.h>
+ #endif
++#endif
+ 
+ #include "mosquitto_internal.h"
+ #include "net_mosq.h"
+-- 
+2.25.3
+
diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
index b4effa36be..078d6ad151 100644
--- a/package/mosquitto/Config.in
+++ b/package/mosquitto/Config.in
@@ -1,3 +1,8 @@
+config BR2_PACKAGE_MOSQUITTO_WITH_THREADING
+	bool
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL  # pthread_setname_np
+	default y if BR2_TOOLCHAIN_HAS_THREADS
+
 config BR2_PACKAGE_MOSQUITTO
 	bool "mosquitto"
 	help
diff --git a/package/mosquitto/mosquitto.hash b/package/mosquitto/mosquitto.hash
index 482962490e..1470a93aa7 100644
--- a/package/mosquitto/mosquitto.hash
+++ b/package/mosquitto/mosquitto.hash
@@ -1,6 +1,6 @@
 # Locally calculated after checking gpg signature
-# from https://mosquitto.org/files/source/mosquitto-1.6.10.tar.gz.asc
-sha256  92d1807717f0f6d57d1ac1207ffdb952e8377e916c7b0bb4718f745239774232  mosquitto-1.6.10.tar.gz
+# from https://mosquitto.org/files/source/mosquitto-1.6.11.tar.gz.asc
+sha256  b02d8f1368c40d5779ee125c37daf9003608eb47d7fbb04c5b938c76c1230a1f  mosquitto-1.6.11.tar.gz
 
 # License files
 sha256  cc77e25bafd40637b7084f04086d606f0a200051b61806f97c93405926670bc1  LICENSE.txt
diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
index cdd515e1a4..3718a0721a 100644
--- a/package/mosquitto/mosquitto.mk
+++ b/package/mosquitto/mosquitto.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-MOSQUITTO_VERSION = 1.6.10
+MOSQUITTO_VERSION = 1.6.11
 MOSQUITTO_SITE = https://mosquitto.org/files/source
 MOSQUITTO_LICENSE = EPL-1.0 or EDLv1.0
 MOSQUITTO_LICENSE_FILES = LICENSE.txt epl-v10 edl-v10
@@ -41,7 +41,7 @@ else
 MOSQUITTO_MAKE_OPTS += WITH_ADNS=no
 endif
 
-ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+ifeq ($(BR2_PACKAGE_MOSQUITTO_WITH_THREADING),y)
 MOSQUITTO_MAKE_OPTS += WITH_THREADING=yes
 else
 MOSQUITTO_MAKE_OPTS += WITH_THREADING=no
-- 
2.25.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/{collectd, domoticz, shairport-sync}: fix mosquitto dependencies
  2020-08-19 12:05 [Buildroot] [PATCH v2 1/2] package/mosquitto: bump to v1.6.11 Titouan Christophe
@ 2020-08-19 12:05 ` Titouan Christophe
  2020-08-27 21:36   ` Thomas Petazzoni
  2020-08-27 21:32 ` [Buildroot] [PATCH v2 1/2] package/mosquitto: bump to v1.6.11 Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: Titouan Christophe @ 2020-08-19 12:05 UTC (permalink / raw)
  To: buildroot

In 4fc62e1eb6b3adbfc3d3eb7f841275ae8cd1b424, we removed arch/toolchain
dependencies from the mosquitto library (MMU, !STATIC, SYNC4), and moved
them to the mosquitto broker only.

All the packages modified here only need the mosquitto library, so they
shouldn't have those depends anymore; but this was never done before.

Moreover, domoticz and shairport-sync both use the mosquitto threaded
API, so we make them dependent on the newly introduced symbol
BR2_PACKAGE_MOSQUITTO_WITH_THREADING.

Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
Changes v1 -> v2:
* Fix reverse dependencies
---
 package/collectd/Config.in       | 1 -
 package/domoticz/Config.in       | 4 +---
 package/shairport-sync/Config.in | 1 +
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/collectd/Config.in b/package/collectd/Config.in
index 4f54944cbc..ddf64015bd 100644
--- a/package/collectd/Config.in
+++ b/package/collectd/Config.in
@@ -607,7 +607,6 @@ comment "grpc needs a toolchain w/ C++, gcc >= 4.8"
 
 config BR2_PACKAGE_COLLECTD_MQTT
 	bool "mqtt"
-	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # mosquitto
 	select BR2_PACKAGE_MOSQUITTO
 	help
 	  Sends metrics to and/or receives metrics from an MQTT broker.
diff --git a/package/domoticz/Config.in b/package/domoticz/Config.in
index c713ac58b1..545137a087 100644
--- a/package/domoticz/Config.in
+++ b/package/domoticz/Config.in
@@ -1,8 +1,6 @@
 config BR2_PACKAGE_DOMOTICZ
 	bool "domoticz"
-	depends on BR2_USE_MMU # mosquitto
-	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # mosquitto
-	depends on !BR2_STATIC_LIBS # mosquitto
+	depends on BR2_PACKAGE_MOSQUITTO_WITH_THREADING
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # sleep_for
 	# pthread_condattr_setclock
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
diff --git a/package/shairport-sync/Config.in b/package/shairport-sync/Config.in
index 528767ba9c..df8a39ceb1 100644
--- a/package/shairport-sync/Config.in
+++ b/package/shairport-sync/Config.in
@@ -57,6 +57,7 @@ config BR2_PACKAGE_SHAIRPORT_SYNC_MQTT
 	depends on BR2_USE_MMU # avahi
 	depends on BR2_TOOLCHAIN_HAS_THREADS # avahi
 	depends on !BR2_STATIC_LIBS # avahi
+	depends on BR2_PACKAGE_MOSQUITTO_WITH_THREADING
 	select BR2_PACKAGE_AVAHI
 	select BR2_PACKAGE_AVAHI_DAEMON
 	select BR2_PACKAGE_DBUS
-- 
2.25.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2 1/2] package/mosquitto: bump to v1.6.11
  2020-08-19 12:05 [Buildroot] [PATCH v2 1/2] package/mosquitto: bump to v1.6.11 Titouan Christophe
  2020-08-19 12:05 ` [Buildroot] [PATCH v2 2/2] package/{collectd, domoticz, shairport-sync}: fix mosquitto dependencies Titouan Christophe
@ 2020-08-27 21:32 ` Thomas Petazzoni
  2020-08-28  9:12   ` Titouan Christophe
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2020-08-27 21:32 UTC (permalink / raw)
  To: buildroot

On Wed, 19 Aug 2020 14:05:05 +0200
Titouan Christophe <titouan.christophe@railnova.eu> wrote:

> diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
> index b4effa36be..078d6ad151 100644
> --- a/package/mosquitto/Config.in
> +++ b/package/mosquitto/Config.in
> @@ -1,3 +1,8 @@
> +config BR2_PACKAGE_MOSQUITTO_WITH_THREADING
> +	bool
> +	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL  # pthread_setname_np
> +	default y if BR2_TOOLCHAIN_HAS_THREADS

This looks awkward. Why are you not just doing:

-ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS_NPTL),y)
 MOSQUITTO_MAKE_OPTS += WITH_THREADING=yes
 else
 MOSQUITTO_MAKE_OPTS += WITH_THREADING=no

in the .mk file ?

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/{collectd, domoticz, shairport-sync}: fix mosquitto dependencies
  2020-08-19 12:05 ` [Buildroot] [PATCH v2 2/2] package/{collectd, domoticz, shairport-sync}: fix mosquitto dependencies Titouan Christophe
@ 2020-08-27 21:36   ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2020-08-27 21:36 UTC (permalink / raw)
  To: buildroot

On Wed, 19 Aug 2020 14:05:06 +0200
Titouan Christophe <titouan.christophe@railnova.eu> wrote:

> In 4fc62e1eb6b3adbfc3d3eb7f841275ae8cd1b424, we removed arch/toolchain
> dependencies from the mosquitto library (MMU, !STATIC, SYNC4), and moved
> them to the mosquitto broker only.
> 
> All the packages modified here only need the mosquitto library, so they
> shouldn't have those depends anymore; but this was never done before.
> 
> Moreover, domoticz and shairport-sync both use the mosquitto threaded
> API, so we make them dependent on the newly introduced symbol
> BR2_PACKAGE_MOSQUITTO_WITH_THREADING.
> 
> Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>

I think this mixes two different things. One is dropping the
dependencies that are no longer needed following
4fc62e1eb6b3adbfc3d3eb7f841275ae8cd1b424. This should be the first
patch in the series.

Also, regarding the threading, nothing needs to be done: both
shairport-sync and domoticz already have a dependency on
BR2_TOOLCHAIN_HAS_THREADS_NPTL. The only thing that could be worthwhile
doing, is *within* the 1.6.11 version bump patch, update the
BR2_TOOLCHAIN_HAS_THREADS_NPTL comments in domoticz and shairport-sync
packages. Like:

-  	# pthread_condattr_setclock
+	# pthread_condattr_setclock, and threading support needed in
+	# mosquitto
  	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL

and something similar for shairport-sync.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2 1/2] package/mosquitto: bump to v1.6.11
  2020-08-27 21:32 ` [Buildroot] [PATCH v2 1/2] package/mosquitto: bump to v1.6.11 Thomas Petazzoni
@ 2020-08-28  9:12   ` Titouan Christophe
  0 siblings, 0 replies; 5+ messages in thread
From: Titouan Christophe @ 2020-08-28  9:12 UTC (permalink / raw)
  To: buildroot

Hello Thomas,

On 27/08/20 23:32, Thomas Petazzoni wrote:
> On Wed, 19 Aug 2020 14:05:05 +0200
> Titouan Christophe <titouan.christophe@railnova.eu> wrote:
> 
>> diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
>> index b4effa36be..078d6ad151 100644
>> --- a/package/mosquitto/Config.in
>> +++ b/package/mosquitto/Config.in
>> @@ -1,3 +1,8 @@
>> +config BR2_PACKAGE_MOSQUITTO_WITH_THREADING
>> +	bool
>> +	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL  # pthread_setname_np
>> +	default y if BR2_TOOLCHAIN_HAS_THREADS
> 
> This looks awkward. Why are you not just doing:
> 
> -ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
> +ifeq ($(BR2_TOOLCHAIN_HAS_THREADS_NPTL),y)
>   MOSQUITTO_MAKE_OPTS += WITH_THREADING=yes
>   else
>   MOSQUITTO_MAKE_OPTS += WITH_THREADING=no

The underlying idea was to "provide a config option for a package to 
depend on, if it uses the mosquitto threading API" which might indeed 
sound overkill. Plus I did not pay attention that HAS_THREADS_NPTL 
implies HAS_THREADS.

> 
> in the .mk file ?

Yes, I'll do jut that

> 
> Thomas
> 

Thank you,

Titouan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-28  9:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19 12:05 [Buildroot] [PATCH v2 1/2] package/mosquitto: bump to v1.6.11 Titouan Christophe
2020-08-19 12:05 ` [Buildroot] [PATCH v2 2/2] package/{collectd, domoticz, shairport-sync}: fix mosquitto dependencies Titouan Christophe
2020-08-27 21:36   ` Thomas Petazzoni
2020-08-27 21:32 ` [Buildroot] [PATCH v2 1/2] package/mosquitto: bump to v1.6.11 Thomas Petazzoni
2020-08-28  9:12   ` Titouan Christophe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.