Skip to contentSkip to conversation

package/swupdate: fix build failure due to missing include

PATCH In review Giulio Benetti 2 participants 3 messages Nov 25, 2025 – Feb 10

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/swupdate: fix build failure due to missing include

Add local patch upstreamed to fix build failure due to missing unistd.h include.

---
 ...001-ipc-add-missing-unistd.h-include.patch | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 package/swupdate/0001-ipc-add-missing-unistd.h-include.patch
package/swupdate/0001-ipc-add-missing-unistd.h-include.patch new file +38 -0
new file mode 100644
index 0000000000..58ceab24ea
@@ -0,0 +1,38 @@
+From 0a936479ef45307cb92f020bbf74808754d07784 Mon Sep 17 00:00:00 2001
+From: AFIQE ANUAR <[email protected]>
+Date: Tue, 7 Jan 2025 11:20:07 +0900
+Subject: [PATCH] ipc: add missing unistd.h include
+
+musl requires unistd.h to be included for close() as specified by POSIX.
+
+This always printed a warning and has become and error since gcc 14:
+
+ipc/network_ipc-if.c: In function 'inst_wait_for_complete':
+ipc/network_ipc-if.c:74:17: error: implicit declaration of function 'close'; did you mean 'clone'? [-Wimplicit-function-declaration]
+   74 |                 close(*progressfd);
+      |                 ^~~~~
+      |                 clone
+
+Upstream: https://github.com/sbabic/swupdate/commit/0a936479ef45307cb92f020bbf74808754d07784
+Signed-off-by: AFIQE ANUAR <[email protected]>
+Signed-off-by: Dominique Martinet <[email protected]>
+Signed-off-by: Giulio Benetti <[email protected]>
+---
+ ipc/network_ipc-if.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/ipc/network_ipc-if.c b/ipc/network_ipc-if.c
+index 51a99357..7740d1dc 100644
+--- a/ipc/network_ipc-if.c
++++ b/ipc/network_ipc-if.c
+@@ -12,6 +12,7 @@
+ #include <signal.h>
+ #include <pthread.h>
+ #include <inttypes.h>
++#include <unistd.h>
+ #include "network_ipc.h"
+ #include "progress_ipc.h"
+ 
+-- 
+2.47.3
+
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello,

Quoted 4 lines · Giulio Benetti

Add local patch upstreamed to fix build failure due to missing unistd.h include.

I'm rather confused, because we have been using swupdate 2025.05 in Buildroot since commit d5826736d5aa63eb818a5d20338b7b698f66dad7, which was merged in May 2025, and this version already includes <unistd.h> in network_ipc-if.c.

So I'm rather confused. Also, I couldn't reproduce the issue, building swupdate with a musl toolchain.

Could you clarify? Also keep in mind that when fixing issues we need to indicate since when the issue exists so that our dear LTS maintainers can understand whether the fix needs to be backported or not.

I'll mark the patch as "Not Applicable", but feel free to send a new iteration with more details if you find out that the patch is actually still needed.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hello Thomas,

Quoted 16 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · Giulio Benetti

Add local patch upstreamed to fix build failure due to missing unistd.h include.

I'm rather confused, because we have been using swupdate 2025.05 in Buildroot since commit d5826736d5aa63eb818a5d20338b7b698f66dad7, which was merged in May 2025, and this version already includes <unistd.h> in network_ipc-if.c.

So I'm rather confused. Also, I couldn't reproduce the issue, building swupdate with a musl toolchain.

Quoted 8 lines

Could you clarify? Also keep in mind that when fixing issues we need to indicate since when the issue exists so that our dear LTS maintainers can understand whether the fix needs to be backported or not.

I'll mark the patch as "Not Applicable", but feel free to send a new iteration with more details if you find out that the patch is actually still needed.

here is my mistake, I've picked an autobuilder failure [1] without rebasing and thinking to fix it. That worked using br-reproduce script and I haven't retried to build using master branch.

Sorry for the noise

Best regards
Giulio

[1]: https://autobuild.buildroot.net/results/864/8640e0adaed4ec512c62dab73d2b3bb299cb7e9a//
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot