Skip to content

feat: COR_HTTP_SERVER — select the HTTP server at build time - #7

Merged
kzangeli merged 1 commit into
mainfrom
feat/http-server-switch
Sep 5, 2026
Merged

feat: COR_HTTP_SERVER — select the HTTP server at build time#7
kzangeli merged 1 commit into
mainfrom
feat/http-server-switch

Conversation

@kzangeli

@kzangeli kzangeli commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

libmicrohttpd is an external shared library, built from source in the broker's Dockerfile at a pinned version, and mapped by every process. The HTTP server lives in this library, so this is where the choice has to be made.

make COR_HTTP_SERVER=mhd        # libmicrohttpd (default)
make COR_HTTP_SERVER=builtin    # the epoll server in this repo

Emitted as a 0/1 pair rather than one flag, so the source reads #if COR_HTTP_SERVER_MHD and -Wundef — now on for this library, and it builds clean — turns a misspelling into a compile error instead of silently selecting the other implementation.

In CFLAGS and not DFLAGS: a caller who passes DFLAGS on the command line replaces it and would drop these along with every other default. That is already recorded in the note above CFLAGS, because it has cost a wrong build once.

builtin is refused with a message rather than built — the flags are right, the backend they select does not exist here yet, and a build would fail at link with a pile of missing MHD symbols and nothing to say why.

Paired with SEAMWARE/coraine, which passes the same variable to both cmake and this library's make, drops libmicrohttpd from the link when it is not mhd, and reports it as build.httpServer on GET /build. No merge-order dependency: an older copy of this library simply ignores the variable.

Note, not part of this change: obj/debug/.flags and obj/coverage/.flags are tracked in this repo, so the recorded compile line shows up as a diff whenever flags change (as here). That looks accidental — obj/ in .gitignore and a git rm --cached would stop it — but it predates this branch and I left it alone.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TGatXwrHx1CreL49sCuS37

libmicrohttpd is an external shared library, built from source in the broker's
Dockerfile at a pinned version, and mapped by every process. This library is
where the HTTP server lives, so this is where the choice has to be made.

    make COR_HTTP_SERVER=mhd        # libmicrohttpd (default)
    make COR_HTTP_SERVER=builtin    # the epoll server in this repo

Emitted as a 0/1 PAIR rather than one flag, so the source reads
`#if COR_HTTP_SERVER_MHD` and -Wundef - now on for this library - turns a
misspelling into a compile error instead of silently selecting the other
implementation.

In CFLAGS and not DFLAGS: a caller who passes DFLAGS on the command line
REPLACES it, and would drop these along with every other default. That is
recorded in the note above CFLAGS because it has already cost a wrong build once.

`builtin` is refused with a message rather than built: the flags are right and
the backend they select does not exist here yet, so a build would fail at link
with a pile of missing MHD symbols and nothing to say why.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TGatXwrHx1CreL49sCuS37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant