Skip to content

Add ulfius webserver support to macos native target#10366

Merged
thebentern merged 4 commits into
masterfrom
feat/native-macos-tier-a
May 1, 2026
Merged

Add ulfius webserver support to macos native target#10366
thebentern merged 4 commits into
masterfrom
feat/native-macos-tier-a

Conversation

@thebentern

Copy link
Copy Markdown
Contributor

No description provided.

@thebentern thebentern requested review from Copilot and vidplace7 May 1, 2026 12:24
@github-actions github-actions Bot added needs-review Needs human review hardware-support Hardware related: new devices or modules, problems specific to hardware labels May 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-enabled native-macos-debug env.
  • 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.

Comment thread src/mesh/raspihttp/PiWebServer.cpp
Comment thread src/platform/portduino/PortduinoGlue.cpp
@thebentern

Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Copilot AI commented May 1, 2026

Copy link
Copy Markdown
Contributor

@copilot apply changes based on the comments in this thread

Done in 51f6168:

  1. PiWebServer.cpp – Updated the file-level comment to document both Linux (apt) and macOS (Homebrew) setup steps, replacing the Linux-only documentation.
  2. PortduinoGlue.cpp – Added an explicit #include <cstring> inside the #ifdef __APPLE__ block to make the strcmp/memcpy dependency self-contained rather than relying on transitive includes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-macos PlatformIO environment to optionally pick up Ulfius (and deps) via pkg-config, and add an ASan-enabled native-macos-debug environment.
  • Add a macOS (__APPLE__) fallback for deriving a MAC address from en0 when 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.

Comment thread variants/native/portduino/platformio.ini
Comment thread src/mesh/raspihttp/PiWebServer.cpp Outdated
Comment thread src/mesh/raspihttp/PiWebServer.cpp Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@thebentern thebentern merged commit 55f40ec into master May 1, 2026
67 of 68 checks passed
jp-bennett pushed a commit that referenced this pull request May 4, 2026
* 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>
@caveman99 caveman99 deleted the feat/native-macos-tier-a branch June 7, 2026 20:56
Evil8it pushed a commit to Evil8it/ME4TACTNK that referenced this pull request Jun 10, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hardware-support Hardware related: new devices or modules, problems specific to hardware needs-review Needs human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants