Skip to contentSkip to conversation

libwebsockets: Support building for native

PATCH Superseded Peter Kjellerstedt 4 participants 7 messages Oct 26, 2023 – Oct 27, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libwebsockets: Support building for native

This is needed to be able to build mosquitto-native.

The dependency on libcap when building for native is needed because cmake will pick up the existence of libcap from the host, but then the build fails if it is not available in the sysroot. Unfortunately, there does not seem to be any way to explicitly tell cmake to not build with libcap.

---
 .../recipes-connectivity/libwebsockets/libwebsockets_4.3.2.bb  | 3 +++
 1 file changed, 3 insertions(+)
meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.2.bb +3 -0
index 5e6069fb8..b80c31a1e 100644
@@ -4,6 +4,7 @@ LICENSE = "MIT & Zlib & BSD-3-Clause & Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=382bfdf329e774859fd401eaf850d29b"
 
 DEPENDS = "zlib"
+DEPENDS:append:class-native = " libcap"
 
 S = "${WORKDIR}/git"
 SRCREV = "b0a749c8e7a8294b68581ce4feac0e55045eb00b"
@@ -61,3 +62,5 @@ RDEPENDS:${PN}-dev += " ${@bb.utils.contains('PACKAGECONFIG', 'static', '${PN}-s
 
 # Avoid absolute paths to end up in the sysroot.
 SSTATE_SCAN_FILES += "*.cmake"
+
+BBCLASSEXTEND = "native"
#1 lore raw

PATCH 2/2 mosquitto: Support building for native again

Support for building from native was removed in commit e1b332f2e (meta-networking: Drop broken BBCLASSEXTEND variants), most likely due to no support for building libwebsockets-native. That support has now been added, so it is now possible to build mosquitto-native again.

---
 .../recipes-connectivity/mosquitto/mosquitto_2.0.18.bb          | 2 ++
 1 file changed, 2 insertions(+)
meta-networking/recipes-connectivity/mosquitto/mosquitto_2.0.18.bb +2 -0
index 7685cc928..ea9eb4857 100644
@@ -88,3 +88,5 @@ INITSCRIPT_PARAMS = "defaults 30"
 USERADD_PACKAGES = "${PN}"
 USERADD_PARAM:${PN} = "--system --no-create-home --shell /bin/false \
                        --user-group mosquitto"
+
+BBCLASSEXTEND = "native"
#2 lore raw

Re: [oe] [meta-networking][PATCH 2/2] mosquitto: Support building for native again

Quoted 9 lines · Peter Kjellerstedt

Support for building from native was removed in commit e1b332f2e (meta-networking: Drop broken BBCLASSEXTEND variants), most likely due to no support for building libwebsockets-native. That support has now been added, so it is now possible to build mosquitto-native again.

---
 .../recipes-connectivity/mosquitto/mosquitto_2.0.18.bb          | 2 ++
 1 file changed, 2 insertions(+)

I'm a little curious how this was being used given that libwebsockets- native was missing? Local changes?

Cheers,

Richard

#3 lore raw

RE: [oe] [meta-networking][PATCH 2/2] mosquitto: Support building for native again

Quoted 14 lines

-----Original Message-----
From: Richard Purdie <[email protected]>
Sent: den 26 oktober 2023 22:13
To: Peter Kjellerstedt <[email protected]>; openembedded- [email protected]
Subject: Re: [oe] [meta-networking][PATCH 2/2] mosquitto: Support building for native again

Quoted 5 lines · Peter Kjellerstedt

Support for building from native was removed in commit e1b332f2e (meta-networking: Drop broken BBCLASSEXTEND variants), most likely due to no support for building libwebsockets-native. That support has now been added, so it is now possible to build mosquitto-native again.

Quoted 7 lines
Quoted 4 lines
---
 .../recipes-connectivity/mosquitto/mosquitto_2.0.18.bb          | 2 ++
 1 file changed, 2 insertions(+)

I'm a little curious how this was being used given that libwebsockets- native was missing? Local changes?

We do not have the "websockets" PACKAGECONFIG enabled.

Quoted 3 lines

Cheers,

Richard

//Peter

#4 lore raw

Re: [oe] [meta-networking][PATCH 2/2] mosquitto: Support building for native again

Quoted 24 lines · Peter Kjellerstedt
Quoted 24 lines

-----Original Message-----
From: Richard Purdie <[email protected]>
Sent: den 26 oktober 2023 22:13
To: Peter Kjellerstedt <[email protected]>; openembedded- [email protected]
Subject: Re: [oe] [meta-networking][PATCH 2/2] mosquitto: Support building
for native again

Quoted 13 lines · Peter Kjellerstedt

Support for building from native was removed in commit e1b332f2e (meta-networking: Drop broken BBCLASSEXTEND variants), most likely due
to no support for building libwebsockets-native. That support has now
been added, so it is now possible to build mosquitto-native again.

---
 .../recipes-connectivity/mosquitto/mosquitto_2.0.18.bb | 2 ++

 1 file changed, 2 insertions(+)
Quoted 5 lines
Quoted 3 lines

I'm a little curious how this was being used given that libwebsockets-
native was missing? Local changes?

We do not have the "websockets" PACKAGECONFIG enabled.

That explains things, thanks.

In some ways a better fix might have been to change the native PACKAGECONFIG and reduce dependencies and build time? That assumes you don't need the native config to enable the target one which I have no idea about though.

Cheers,

Richard

#5 lore raw

RE: [oe] [meta-networking][PATCH 2/2] mosquitto: Support building for native again

Quoted 37 lines

-----Original Message-----
From: Richard Purdie <[email protected]>
Sent: den 27 oktober 2023 10:47
To: Peter Kjellerstedt <[email protected]>; openembedded- [email protected]
Subject: Re: [oe] [meta-networking][PATCH 2/2] mosquitto: Support building for native again

Quoted 28 lines · Peter Kjellerstedt
Quoted 27 lines

-----Original Message-----
From: Richard Purdie <[email protected]>
Sent: den 26 oktober 2023 22:13
To: Peter Kjellerstedt <[email protected]>; openembedded- [email protected]
Subject: Re: [oe] [meta-networking][PATCH 2/2] mosquitto: Support building
for native again

Quoted 8 lines · Peter Kjellerstedt

Support for building from native was removed in commit e1b332f2e (meta-networking: Drop broken BBCLASSEXTEND variants), most likely due
to no support for building libwebsockets-native. That support has now
been added, so it is now possible to build mosquitto-native again.

Quoted 5 lines

---
 .../recipes-connectivity/mosquitto/mosquitto_2.0.18.bb | 2 ++

 1 file changed, 2 insertions(+)

I'm a little curious how this was being used given that libwebsockets-
native was missing? Local changes?

Quoted 8 lines
Quoted 1 line

We do not have the "websockets" PACKAGECONFIG enabled.

That explains things, thanks.

In some ways a better fix might have been to change the native PACKAGECONFIG and reduce dependencies and build time? That assumes you don't need the native config to enable the target one which I have no idea about though.

Unfortunately, I have no idea what we or anyone else use mosquitto for. I just make it build. ;) So while reducing the dependencies is generally a good idea, I do not know what the consequences would be.

Quoted 3 lines

Cheers,

Richard

//Peter

#6 lore raw
In reply to Peter Kjellerstedt
Quoted 19 lines · Peter Kjellerstedt

This is needed to be able to build mosquitto-native.

The dependency on libcap when building for native is needed because cmake will pick up the existence of libcap from the host, but then the build fails if it is not available in the sysroot. Unfortunately, there does not seem to be any way to explicitly tell cmake to not build with libcap.

---
 .../recipes-connectivity/libwebsockets/libwebsockets_4.3.2.bb  | 3 +++
 1 file changed, 3 insertions(+)
meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.2.bb +0 -0
index 5e6069fb8..b80c31a1e 100644

meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.2.bb LICENSE = "MIT & Zlib & BSD-3-Clause & Apache-2.0" · line 7

Quoted 4 lines
meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.2.bb +1 -0
@@ -4,6 +4,7 @@ LICENSE = "MIT & Zlib & BSD-3-Clause & Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=382bfdf329e774859fd401eaf850d29b"
 
 DEPENDS = "zlib"
+DEPENDS:append:class-native = " libcap"

it will expand to native automatically but it might be better to be explicit here and use libcap-native

Quoted 18 lines
meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.2.bb +2 -1
 S = "${WORKDIR}/git"
 SRCREV = "b0a749c8e7a8294b68581ce4feac0e55045eb00b"
@@ -61,3 +62,5 @@ RDEPENDS:${PN}-dev += " ${@bb.utils.contains('PACKAGECONFIG', 'static', '${PN}-s
 
 # Avoid absolute paths to end up in the sysroot.
 SSTATE_SCAN_FILES += "*.cmake"
+
+BBCLASSEXTEND = "native"
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#105748): https://lists.openembedded.org/g/openembedded-devel/message/105748
Mute This Topic: https://lists.openembedded.org/mt/102199463/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-