fix ubuntu compilation issue in nim-testutils

The when defined(enable_libbacktrace): is evaluated at compile time and is false by default. When Nim loads this config.nims as a parent config during the testutils build, the libbacktrace block is silently skipped. Nothing is passed as --import.

Why the old guard (not defined(disable_libbacktrace)) wasn't enough: it required someone to explicitly opt out, but disable_libbacktrace is never passed during nimble's internal dependency build invocations. The opt-in approach is safe by default.

If any build in this project genuinely uses libbacktrace, you'd need to both add it to waku.nimble requires and pass -d:enable_libbacktrace explicitly.
This commit is contained in:
Ivan FB 2026-04-12 22:54:47 +02:00
parent 94d5ad40ac
commit 01392597d9
No known key found for this signature in database
GPG Key ID: DF0C67A04C543270

View File

@ -83,8 +83,9 @@ if not defined(macosx) and not defined(android):
# add debugging symbols and original files and line numbers
--debugger:
native
if not (defined(windows) and defined(i386)) and not defined(disable_libbacktrace):
when defined(enable_libbacktrace):
# light-weight stack traces using libbacktrace and libunwind
# opt-in: pass -d:enable_libbacktrace (requires libbacktrace in project deps)
--define:
nimStackTraceOverride
switch("import", "libbacktrace")