* [PATCH master 1/2] scripts: sconfigpast: print panic message when nonnull fails
@ 2025-10-10 5:52 Ahmad Fatoum
2025-10-10 5:52 ` [PATCH master 2/2] kbuild: fix spurious CI failure around sconfig_names.h Ahmad Fatoum
2025-10-10 8:50 ` [PATCH master 1/2] scripts: sconfigpast: print panic message when nonnull fails Sascha Hauer
0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2025-10-10 5:52 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
Instead of just exiting with an error code of 2, print out to stderr,
when we abort due to an unexpected NULL pointer.
This helped tracked down a missing dependency in CI.
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
scripts/basic/sconfigpost.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/basic/sconfigpost.c b/scripts/basic/sconfigpost.c
index ddc0528773ff..38f5888865b6 100644
--- a/scripts/basic/sconfigpost.c
+++ b/scripts/basic/sconfigpost.c
@@ -49,13 +49,15 @@ static inline size_t str_has_prefix(const char *str, const char *prefix)
return strncmp(str, prefix, len) == 0 ? len : 0;
}
-static void *nonnull(void *ptr)
+static void *pnonnull(void *ptr, const char *ptrname)
{
if (!ptr)
- exit(2);
+ panic("%s is unexpectedly NULL\n", ptrname);
return ptr;
}
+#define nonnull(ptr) pnonnull(ptr, #ptr)
+
static FILE *xfopen(const char *path, const char *mode)
{
FILE *fp;
@@ -367,6 +369,8 @@ static void append_dependency(FILE *depfile, const char *path)
return;
}
+ debug("appending dependency for %s\n", path);
+
abspath = nonnull(realpath(path, NULL));
fprintf(depfile, "\t%s \\\n", abspath);
--
2.47.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH master 2/2] kbuild: fix spurious CI failure around sconfig_names.h
2025-10-10 5:52 [PATCH master 1/2] scripts: sconfigpast: print panic message when nonnull fails Ahmad Fatoum
@ 2025-10-10 5:52 ` Ahmad Fatoum
2025-10-10 8:50 ` [PATCH master 1/2] scripts: sconfigpast: print panic message when nonnull fails Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2025-10-10 5:52 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
include/generated/security_autconf.h must be available first, because
sconfigpost calls realpath on it.
Reflect this dependency in the Makefile.
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 2b846411cb85..78849535396f 100644
--- a/Makefile
+++ b/Makefile
@@ -1226,7 +1226,7 @@ quiet_cmd_sconfigpost = SCONFPP $@
include/generated/security_autoconf.h: .security_config scripts_basic FORCE
$(call if_changed_dep,sconfigpost,-e)
-include/generated/sconfig_names.h: .security_config scripts_basic FORCE
+include/generated/sconfig_names.h: .security_config scripts_basic include/generated/security_autoconf.h FORCE
$(call if_changed_dep,sconfigpost,-s)
archprepare: include/generated/security_autoconf.h include/generated/sconfig_names.h
--
2.47.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH master 1/2] scripts: sconfigpast: print panic message when nonnull fails
2025-10-10 5:52 [PATCH master 1/2] scripts: sconfigpast: print panic message when nonnull fails Ahmad Fatoum
2025-10-10 5:52 ` [PATCH master 2/2] kbuild: fix spurious CI failure around sconfig_names.h Ahmad Fatoum
@ 2025-10-10 8:50 ` Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2025-10-10 8:50 UTC (permalink / raw)
To: barebox, Ahmad Fatoum
On Fri, 10 Oct 2025 07:52:28 +0200, Ahmad Fatoum wrote:
> Instead of just exiting with an error code of 2, print out to stderr,
> when we abort due to an unexpected NULL pointer.
>
> This helped tracked down a missing dependency in CI.
>
>
Applied, thanks!
[1/2] scripts: sconfigpast: print panic message when nonnull fails
https://git.pengutronix.de/cgit/barebox/commit/?id=5527bb82fb20 (link may not be stable)
[2/2] kbuild: fix spurious CI failure around sconfig_names.h
https://git.pengutronix.de/cgit/barebox/commit/?id=030f0acc2308 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-10 8:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-10 5:52 [PATCH master 1/2] scripts: sconfigpast: print panic message when nonnull fails Ahmad Fatoum
2025-10-10 5:52 ` [PATCH master 2/2] kbuild: fix spurious CI failure around sconfig_names.h Ahmad Fatoum
2025-10-10 8:50 ` [PATCH master 1/2] scripts: sconfigpast: print panic message when nonnull fails Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox