fix(build): bootstrap libraries before compiling emu#163
fix(build): bootstrap libraries before compiling emu#163Ticed wants to merge 1 commit intoNERVsystems:masterfrom
Conversation
On a fresh clone, macOS build scripts fail because the emulator is compiled without first building the required libraries. The linker cannot find the .a files and the build exits with "no such file or directory" errors. Add the library build loop and mk/limbo pre-checks to build-macos-headless.sh, build-macos-sdl3.sh, and build_test.sh. Export SYSTARG in the macOS and Linux ARM64 build scripts. Add the devprof.$O on $RUNT dependency in portmkfile. Without it ,mk does not generate runt.h before compiling devprof.c, causing a missing-header failure on build. Fix path typo in QUICKSTART.md.
|
pdfinn
left a comment
There was a problem hiding this comment.
Hey @Ticed, thanks for this — really appreciate you taking the time to dig into the build system and put together a fix. This is a real problem: the macOS build scripts aren't self-contained like the Linux one, and a fresh clone + ./build-macos-headless.sh shouldn't leave someone staring at linker errors.
Two of these fixes are clean and I'd like to get them merged right away:
- QUICKSTART.md typo — good catch,
X/arm64/bin→MacOSX/arm64/bin devprof.$O: $RUNTin portmkfile —devprof.cincludesrunt.hbut was missing the dependency. Correct fix.
For the library bootstrap, I have a few suggestions before we merge that part:
-
libfreetypedoesn't need to be built. If you look at theemu/MacOSX/emuconfig, freetype is commented out in thelibsection — it's not linked into either headless or SDL3 builds. Building it is harmless but unnecessary. -
The
SYSTARGexport is redundant.mkconfigalready setsSYSTARG=$SYSHOST, so the build system picks it up automatically. No harm done, but it's not needed. -
The library loop is duplicated across three files. Identical 23-line blocks in
build-macos-headless.sh,build-macos-sdl3.sh, andbuild_test.shwill be a maintenance headache. Would you be open to extracting that into a shared script (something likescripts/bootstrap-libs.sh) that all three source? Our CI already handles this as discrete steps — take a look at themacos-arm64job in.github/workflows/ci.ymlfor how we structure the build order.
Suggestion: Would you be up for splitting this into two PRs? I can merge the QUICKSTART + portmkfile fixes right now, and we can iterate on the bootstrap work separately. That way the good stuff lands immediately. Happy to help with the shared-script approach if you want to pair on it.
One more thing — the QUICKSTART and portmkfile fixes are really upstream improvements that would benefit all InferNode users. Would you consider submitting those to infernode-os/infernode as well? That's the canonical repo; our fork here carries product-specific changes. Totally fine to keep the bootstrap PR here since it's about our macOS build scripts specifically.
Thanks again for contributing — finding the devprof dependency and the QUICKSTART typo shows you were reading carefully.



Summary
On a fresh clone, the macOS build scripts fail because the required libraries
are not built before the emulator is compiled. The linker then cannot find the
.afiles, and the build exits withno such file or directoryerrors.Changes
mk/Limbo pre-checks tobuild-macos-headless.sh,build-macos-sdl3.sh, andtests/host/build_test.sh.SYSTARG=MacOSXin the macOS build scripts andtests/host/build_test.sh, andSYSTARG=Linuxinbuild-linux-arm64.sh.devprof.$O: $RUNTdependency inemu/port/portmkfileso it isrecompiled when
runt.hchanges.MacOSX/arm64/bininstead ofX/arm64/bin) inQUICKSTART.md.Why
The macOS build scripts skip the library build and directory creation steps, so
they fail on a clean checkout where the
.afiles have not yet been generated.This creates inconsistent behavior across platforms, since the self-contained
Linux build scripts already handle this correctly.
Verification