Add ulfius webserver support to macos native target#10366
Conversation
There was a problem hiding this comment.
Pull request overview
Adds optional Ulfius-based HTTP API (PiWebServer) support to the macOS native/Portduino target, aligning Portduino’s webserver compilation guards and build flags so macOS users can enable the feature via Homebrew.
Changes:
- Update macOS native PlatformIO env to optionally pick up Ulfius (and deps) via
pkg-config, and add an ASan-enablednative-macos-debugenv. - Generalize PiWebServer compilation guards from Linux-only to Portduino-wide (
ARCH_PORTDUINO) while still gating on__has_include(<ulfius.h>). - Add a macOS fallback MAC-address derivation path using
getifaddrs()/en0.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| variants/native/portduino/platformio.ini | Adds optional pkg-config flags for Ulfius deps on native-macos and introduces an ASan native-macos-debug env. |
| src/platform/portduino/PortduinoGlue.cpp | Adds macOS-specific MAC address fallback using getifaddrs() on en0. |
| src/mesh/raspihttp/PiWebServer.h | Switches PiWebServer guard to ARCH_PORTDUINO so it can build on macOS when Ulfius headers exist. |
| src/mesh/raspihttp/PiWebServer.cpp | Mirrors the updated Portduino-wide guard and clarifies conditional compilation intent. |
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/3ce82582-23e0-4afe-b22f-b24f81721488 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
Done in 51f6168:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Portduino/macOS native build so the optional Ulfius-based HTTP API (PiWebServer) can be enabled on macOS when the required headers/libs are installed, aligning the existing Portduino webserver gating logic with the macOS native target.
Changes:
- Update
native-macosPlatformIO environment to optionally pick up Ulfius (and deps) viapkg-config, and add an ASan-enablednative-macos-debugenvironment. - Add a macOS (
__APPLE__) fallback for deriving a MAC address fromen0when BlueZ is unavailable. - Broaden PiWebServer compilation guards from Linux-only to
ARCH_PORTDUINO+__has_include(<ulfius.h>), enabling builds on macOS when Ulfius is present.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| variants/native/portduino/platformio.ini | Adds optional Ulfius pkg-config flags for native-macos and introduces native-macos-debug (ASan) env. |
| src/platform/portduino/PortduinoGlue.cpp | Adds macOS MAC-address fallback using getifaddrs() / AF_LINK for en0. |
| src/mesh/raspihttp/PiWebServer.h | Switches guard to ARCH_PORTDUINO so PiWebServer can be built on macOS when Ulfius headers are available. |
| src/mesh/raspihttp/PiWebServer.cpp | Updates documentation and switches guard to ARCH_PORTDUINO to allow macOS builds when Ulfius headers are present. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/1a6c59aa-4393-4134-8cee-61eeee0e9127 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
* Add ulfius webserver support to macos native target * fix: update PiWebServer docs for macOS and add explicit cstring include Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/3ce82582-23e0-4afe-b22f-b24f81721488 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: add --cflags to openssl@3 pkg-config and fix apt package name Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/1a6c59aa-4393-4134-8cee-61eeee0e9127 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Add ulfius webserver support to macos native target * fix: update PiWebServer docs for macOS and add explicit cstring include Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/3ce82582-23e0-4afe-b22f-b24f81721488 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: add --cflags to openssl@3 pkg-config and fix apt package name Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/1a6c59aa-4393-4134-8cee-61eeee0e9127 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
No description provided.