OKLMdocumentation v1.0.3
On this page

ADR-0014: nilorea-library used as a source tree

Records how OKLM consumes nilorea-library: by compiling the source files of the modules it needs, not by linking a prebuilt library or vendoring a submodule.

Status: accepted (2026-10-29).

Context

nilorea-library is OKLM's mandatory base. It is developed alongside OKLM by the same author, and OKLM may add code to it (the persistent worker team of ADR-0016 was added for OKLM). A git submodule pins a commit and makes changes made for OKLM a two-step publish; linking an installed libnilorea.a couples OKLM to however nilorea was configured and built.

Decision

  • The Makefile takes the nilorea tree from NILOREA_DIR, defaulting to external/nilorea-library when present and to ../../nilorea-library otherwise.
  • OKLM compiles only the nilorea modules it uses (NILOREA_SRCS in the Makefile: currently n_log, n_list, n_time, n_thread_pool) into its own build directory, and archives them into liboklm.a.
  • They are compiled with nilorea's own dialect (-std=gnu17), without -Werror, and with OKLM's sanitizer flags so ASan/TSan builds are consistent. nilorea headers are included with -isystem so OKLM's -pedantic -Werror does not apply to them.
  • Improvements needed by OKLM are made in nilorea itself, with nilorea's tests and conventions, never patched locally.

Consequences

OKLM always builds against the nilorea tree it is pointed at; a release must record the nilorea commit it was built with. Adding a nilorea module is a one-line Makefile change (plus its own nilorea dependencies).