mirror of
https://github.com/meshtastic/firmware.git
synced 2026-10-07 05:32:00 -04:00
fix(portduino): stop the libnotify probe swallowing native-tft's link flags
The docker arm64 builds failed to link native-tft:
libmeshtastic-device-ui.a(CURLService.cpp.o): undefined reference to symbol
'curl_easy_reset@@CURL_GNUTLS_3'
/lib/aarch64-linux-gnu/libcurl-gnutls.so.4: DSO missing from command line
-lcurl was never on the link line. The libnotify probe was the last line of
[native_base].build_flags, and an env extending it writes
build_flags = ${native_base.build_flags} -Os -lcurl -lX11 ...
so the interpolation appended those flags to the probe's own line. The result is
a single shell command ending in `... && echo -D HAS_LIBNOTIFY=1 || : -Os -lcurl
-lX11 -linput -lxkbcommon -ffunction-sections -fdata-sections -Wl,--gc-sections`,
where the trailing flags are arguments to echo when the probe succeeds and to `:`
when it fails. They never reach the compiler, and nothing reports it.
Three envs lost flags this way: native-tft and native-tft-debug (-lcurl -lX11
-linput -lxkbcommon), and native-fb (-lcurl, --gc-sections). env:native appends
nothing on that line, which is why the native test suite stayed green and this
stayed hidden until the module compiled and something actually tried to link.
Move the probe above `-I /usr/include` so a plain flag line ends the value, and
record the constraint so the next flag added here does not re-break it.
Verified with `pio project config --json-output`: before, the three envs carried
the flags inside the probe's command string; after, all three carry them as
build flags and no env still swallows any.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EZstXBJtzRyBmUD1h2FLs
This commit is contained in:
1 file changed
+6
-1
@@ -1,12 +1,17 @@
|
||||
[native_base]
|
||||
extends = portduino_base
|
||||
build_flags = ${portduino_base.build_flags} -I variants/native/portduino
|
||||
-I /usr/include
|
||||
; Optional desktop-notification support (see ExternalNotificationModule::portduinoNotify).
|
||||
; Emit libnotify's flags *and* HAS_LIBNOTIFY=1 only when the .pc file is actually present,
|
||||
; so a native build on a machine without libnotify-dev still configures and links - it just
|
||||
; compiles the feature out. `|| :` keeps a failed probe from returning a non-zero exit code.
|
||||
;
|
||||
; Keep this off the last line. An env extending native_base writes
|
||||
; `build_flags = ${native_base.build_flags} -Os -lcurl ...`, and the interpolation appends those
|
||||
; flags to whatever line ends this value. Landing them on a `!` line makes them trailing
|
||||
; arguments to echo or to `:` instead of compiler flags, and they vanish with no error.
|
||||
!pkg-config --exists --silence-errors libnotify && pkg-config --cflags --libs libnotify && echo -D HAS_LIBNOTIFY=1 || :
|
||||
-I /usr/include
|
||||
board = cross_platform
|
||||
board_level = extra
|
||||
lib_deps =
|
||||
|
||||
Reference in new issue
Block a user