Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/asterisk: fix build caused by libjwt bump
@ 2025-08-29 17:05 Thomas Petazzoni via buildroot
  2025-08-29 20:47 ` Waldemar Brodkorb
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-08-29 17:05 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Petazzoni

In commit 770f9154978c40ce5b7718174108b37c5310869d, libjwt was bumped
from 1.17.2 to 3.2.0, which is a big bump. And the libjwt website
states "Version 3 of LibJWT is a complete overhaul of the code. Please
see documentation for usage."

And indeed, this version bump breaks the build of Asterisk:

res_stir_shaken/attestation.c: In function 'pack_payload':
res_stir_shaken/attestation.c:357:9: error: implicit declaration of function 'jwt_add_grants_json' [-Wimplicit-function-declaration]
  357 |         jwt_add_grants_json(jwt, payload_str);
      |         ^~~~~~~~~~~~~~~~~~~
In file included from /home/autobuild/autobuild/instance-11/output-1/build/asterisk-22.3.0/include/asterisk/module.h:39,
                 from res_stir_shaken/attestation.c:24:
res_stir_shaken/attestation.c: In function '_dtor_jwt':
res_stir_shaken/attestation.c:367:38: error: implicit declaration of function 'jwt_free'; did you mean 'jwks_free'? [-Wimplicit-function-declaration]
  367 |         RAII_VAR(jwt_t *, jwt, NULL, jwt_free);
      |                                      ^~~~~~~~

To fix this, let's use the bundled version of libjwt in Asterisk,
since even Asterisk master hasn't been fixed to be compatible with
libjwt 3.x.

Of course, this raises the question of whether the separate libjwt
package should be removed, as it is anyway only used by Asterisk.

Fixes:

  http://autobuild.buildroot.net/results/2d39791c65c5b71b0533d4b2bce5f073f5919552/

Cc: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
Waldemar: you did the bump of libjwt. Are you using this library?
Independently of Asterisk?
---
 package/asterisk/Config.in     | 1 -
 package/asterisk/asterisk.hash | 2 ++
 package/asterisk/asterisk.mk   | 7 ++++---
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/package/asterisk/Config.in b/package/asterisk/Config.in
index 71c741acfd..c7101d70f4 100644
--- a/package/asterisk/Config.in
+++ b/package/asterisk/Config.in
@@ -10,7 +10,6 @@ config BR2_PACKAGE_ASTERISK
 	select BR2_PACKAGE_LIBCURL
 	select BR2_PACKAGE_LIBEDIT
 	select BR2_PACKAGE_LIBILBC
-	select BR2_PACKAGE_LIBJWT
 	select BR2_PACKAGE_LIBPJSIP
 	select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC
 	select BR2_PACKAGE_LIBXML2
diff --git a/package/asterisk/asterisk.hash b/package/asterisk/asterisk.hash
index 7b28624921..f11ed08ef4 100644
--- a/package/asterisk/asterisk.hash
+++ b/package/asterisk/asterisk.hash
@@ -3,6 +3,8 @@ sha256  4cc403c8885d4aed3956dfb75d315d3e5bcc129eb9cd47c156d3b12ecceed1ba  asteri
 
 # Locally computed
 sha256  58bb83cec4d431f48d006e455d821668450f8cf6b6c95f090def47062fa3a60c  pjproject-2.15.1.tar.bz2
+sha256  6775095bcd417d375faddc1f17cdd7706ad8aa9b9b02404990c4b0ee218ee379  libjwt-1.15.3.tar.gz
+
 # sha1 from: http://downloads.asterisk.org/pub/telephony/sounds/releases
 # sha256 locally computed
 sha1  721c512feaea102700d5bdce952fdc0bb29dc640  asterisk-core-sounds-en-gsm-1.6.1.tar.gz
diff --git a/package/asterisk/asterisk.mk b/package/asterisk/asterisk.mk
index 6d682f161d..ce8e5823ce 100644
--- a/package/asterisk/asterisk.mk
+++ b/package/asterisk/asterisk.mk
@@ -13,11 +13,13 @@ ASTERISK_SITE = $(call github,asterisk,asterisk,$(ASTERISK_VERSION))
 # segfaults. The reason behind this is unclear.
 # https://github.com/asterisk/asterisk/issues/671
 ASTERISK_PJSIP_URL = https://raw.githubusercontent.com/asterisk/third-party/master/pjproject/2.15.1/
+ASTERISK_LIBJWT_URL = https://raw.githubusercontent.com/asterisk/third-party/master/libjwt/1.15.3/
 ASTERISK_SOUNDS_BASE_URL = http://downloads.asterisk.org/pub/telephony/sounds/releases
 ASTERISK_EXTRA_DOWNLOADS = \
 	$(ASTERISK_SOUNDS_BASE_URL)/asterisk-core-sounds-en-gsm-1.6.1.tar.gz \
 	$(ASTERISK_SOUNDS_BASE_URL)/asterisk-moh-opsound-wav-2.03.tar.gz \
-	$(ASTERISK_PJSIP_URL)/pjproject-2.15.1.tar.bz2
+	$(ASTERISK_PJSIP_URL)/pjproject-2.15.1.tar.bz2 \
+	$(ASTERISK_LIBJWT_URL)/libjwt-1.15.3.tar.gz
 
 ASTERISK_LICENSE = GPL-2.0, BSD-3-Clause (SHA1, resample), BSD-4-Clause (db1-ast)
 ASTERISK_LICENSE_FILES = \
@@ -40,7 +42,6 @@ ASTERISK_DEPENDENCIES = \
 	jansson \
 	libcurl \
 	libedit \
-	libjwt \
 	libpjsip \
 	libxml2 \
 	sqlite \
@@ -95,7 +96,7 @@ ASTERISK_CONF_OPTS = \
 	--with-jansson \
 	--with-libcurl \
 	--with-ilbc \
-	--with-libjwt="$(STAGING_DIR)/usr" \
+	--with-libjwt-bundled \
 	--with-libxml2 \
 	--with-libedit="$(STAGING_DIR)/usr" \
 	--with-pjproject-bundled \
-- 
2.50.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/asterisk: fix build caused by libjwt bump
  2025-08-29 17:05 [Buildroot] [PATCH] package/asterisk: fix build caused by libjwt bump Thomas Petazzoni via buildroot
@ 2025-08-29 20:47 ` Waldemar Brodkorb
  2025-08-29 21:51   ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 5+ messages in thread
From: Waldemar Brodkorb @ 2025-08-29 20:47 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

Hi Thomas,
Thomas Petazzoni wrote,

> Waldemar: you did the bump of libjwt. Are you using this library?
> Independently of Asterisk?

No, I am fine with that change.

best regards
 Waldemar

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/asterisk: fix build caused by libjwt bump
  2025-08-29 20:47 ` Waldemar Brodkorb
@ 2025-08-29 21:51   ` Thomas Petazzoni via buildroot
  2025-08-30  5:00     ` Waldemar Brodkorb
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-08-29 21:51 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: buildroot

On Fri, 29 Aug 2025 22:47:39 +0200
Waldemar Brodkorb <wbx@openadk.org> wrote:

> > Waldemar: you did the bump of libjwt. Are you using this library?
> > Independently of Asterisk?  
> 
> No, I am fine with that change.

Sorry, but that doesn't really answer my question. You are both the
maintainer of package/libjwt and package/asterisk, and you bumped
package/libjwt, which is only used by package/asterisk, without testing
that it doesn't break asterisk.

Now that asterisk uses a bundled libjwt, do we need to keep the
separate libjwt package?

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/asterisk: fix build caused by libjwt bump
  2025-08-29 21:51   ` Thomas Petazzoni via buildroot
@ 2025-08-30  5:00     ` Waldemar Brodkorb
  2025-08-30  6:51       ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 5+ messages in thread
From: Waldemar Brodkorb @ 2025-08-30  5:00 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

Hi Thomas,
Thomas Petazzoni wrote,

> On Fri, 29 Aug 2025 22:47:39 +0200
> Waldemar Brodkorb <wbx@openadk.org> wrote:
> 
> > > Waldemar: you did the bump of libjwt. Are you using this library?
> > > Independently of Asterisk?  
> > 
> > No, I am fine with that change.
> 
> Sorry, but that doesn't really answer my question. You are both the
> maintainer of package/libjwt and package/asterisk, and you bumped
> package/libjwt, which is only used by package/asterisk, without testing
> that it doesn't break asterisk.

That is not true. I tested it. At least a basic test as always:
buildroot$ git checkout f11b9db0b5f150d73e10a0c25989e2ec6300588e
buildroot$ make raspberrypi5_defconfig 
buildroot$ make menuconfig <- choose asterisk
buildroot$ make
buildroot$ file output/target/usr/sbin/asterisk
output/target/usr/sbin/asterisk: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, stripped
buildroot$ ./output/host/bin/aarch64-linux-gcc --version
aarch64-linux-gcc.br_real (Buildroot 2021.11-12449-g1bef613319) 13.3.0

The reason for the failures might be a newer gcc.
 
> Now that asterisk uses a bundled libjwt, do we need to keep the
> separate libjwt package?

No, for me it is okay to use the bundled one and remove the separate
package.

best regards
 Waldemar
 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/asterisk: fix build caused by libjwt bump
  2025-08-30  5:00     ` Waldemar Brodkorb
@ 2025-08-30  6:51       ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-08-30  6:51 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: buildroot

On Sat, 30 Aug 2025 07:00:11 +0200
Waldemar Brodkorb <wbx@openadk.org> wrote:

> That is not true. I tested it. At least a basic test as always:
> buildroot$ git checkout f11b9db0b5f150d73e10a0c25989e2ec6300588e
> buildroot$ make raspberrypi5_defconfig 
> buildroot$ make menuconfig <- choose asterisk
> buildroot$ make
> buildroot$ file output/target/usr/sbin/asterisk
> output/target/usr/sbin/asterisk: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, stripped
> buildroot$ ./output/host/bin/aarch64-linux-gcc --version
> aarch64-linux-gcc.br_real (Buildroot 2021.11-12449-g1bef613319) 13.3.0
> 
> The reason for the failures might be a newer gcc.

That is very odd because the failure is jwt_free() doesn't exist, and
indeed it doesn't exist in libjwt 3.2.0.

> No, for me it is okay to use the bundled one and remove the separate
> package.

OK.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2025-08-30  6:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29 17:05 [Buildroot] [PATCH] package/asterisk: fix build caused by libjwt bump Thomas Petazzoni via buildroot
2025-08-29 20:47 ` Waldemar Brodkorb
2025-08-29 21:51   ` Thomas Petazzoni via buildroot
2025-08-30  5:00     ` Waldemar Brodkorb
2025-08-30  6:51       ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox