Skip to content

Conversation

@mverch67
Copy link
Collaborator

@mverch67 mverch67 commented Nov 2, 2025

The portduino native-xxx targets do not compile on Ubuntu 22.04 (arm64), I get the following compile error:

src/mqtt/MQTT.cpp: In member function ‘bool MQTT::publish(const char*, const uint8_t*, size_t, bool)’:
src/mqtt/MQTT.cpp:476:9: error: ‘strlcpy’ was not declared in this scope; did you mean ‘strncpy’?
  476 |         strlcpy(msg->topic, topic, sizeof(msg->topic));
      |         ^~~~~~~
      |         strncpy

This is due to strlcpy (introduced in PR #8320) is not a POSIX function and not part of glibc.

However, it is contained in libbsd so this PR modifies the build command line to optionally include this library if it is installed:

!pkg-config --cflags --libs libbsd-overlay --silence-errors

Install strlcpy with sudo apt install libbsd-dev on Ubuntu if affected by this same error.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)
      • native
      • native-tft
      • native-fb
      • native-tft-debug

@mverch67 mverch67 added the bugfix Pull request that fixes bugs label Nov 2, 2025
@mverch67 mverch67 requested a review from jp-bennett November 3, 2025 19:44
@jp-bennett
Copy link
Collaborator

@vidplace7 does this fix your compile error too?

@vidplace7
Copy link
Member

This needs to be added to debian/control and meshtasticd.spec.rpkg as well 👍

Copy link
Member

@vidplace7 vidplace7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is good to merge as-is along with it's cousin #8533
I'd love to get this included in a release before we cut a Beta, since Ubuntu 22.04 / Debian 12 are currently broken 🙏

@thebentern thebentern merged commit cf716fe into master Nov 3, 2025
77 of 78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants