feat: COR_HTTP_SERVER — select the HTTP server at build time - #7
Merged
Conversation
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
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Emitted as a 0/1 pair rather than one flag, so the source reads
#if COR_HTTP_SERVER_MHDand-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
CFLAGSand notDFLAGS: a caller who passesDFLAGSon the command line replaces it and would drop these along with every other default. That is already recorded in the note aboveCFLAGS, because it has cost a wrong build once.builtinis 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
libmicrohttpdfrom the link when it is notmhd, and reports it asbuild.httpServeronGET /build. No merge-order dependency: an older copy of this library simply ignores the variable.🤖 Generated with Claude Code
https://claude.ai/code/session_01TGatXwrHx1CreL49sCuS37