Skip to content

fix(build): repair mk emuinstall on a clean clone - #507

Open
Ticed wants to merge 2 commits into
infernode-os:masterfrom
Ticed:libtk-emudirs
Open

fix(build): repair mk emuinstall on a clean clone#507
Ticed wants to merge 2 commits into
infernode-os:masterfrom
Ticed:libtk-emudirs

Conversation

@Ticed

@Ticed Ticed commented Aug 18, 2026

Copy link
Copy Markdown

mk emuinstall and mk install fail on a clean clone on macOS. There are two faults in the same command, so this PR has two commits.

1. libtk is missing from EMUDIRS

Everything compiles, then the emulator link fails:

clang: error: no such file or directory: '<root>/MacOSX/arm64/lib/libtk.a'

The root mkfile walks EMUDIRS to build the libraries and the emulator, but libtk is not in that list. emu/MacOSX/emu and emu/Linux/emu both declare tk in their lib section, so LIBFILES includes libtk.a and the link needs it. emu/Nt/emu does not declare tk, so this part only affects POSIX builds.

The first commit adds libtk to EMUDIRS, after libmemlayer and before emu. Its dependencies (libdraw, libmemdraw, libmemlayer) already come earlier in the list.

2. The macOS install path points at /sys

Fixing the link exposes the next failure. The build finishes, then the install step fails:

cp o.emu /sys/MacOSX/arm64/bin/emu
cp: /sys/MacOSX/arm64/bin/emu: No such file or directory

Eight platforms set INSTALLDIR=$ROOT/$SYSTARG/$OBJTYPE/bin. The three macOS mkfiles set a literal /sys/$SYSTARG/$OBJTYPE/bin, carrying the same trailing comment as the others. macOS has no /sys, so the copy has nowhere to go.

The second commit restores $ROOT in emu/MacOSX/mkfile, mkfile-g and mkfile-x. Only mkfile is used by the current build. The other two hold the same divergence and are corrected for consistency, but they are not exercised here.

Why CI passes today

The platform build scripts do not read EMUDIRS, and they do not run the install step. build-linux-amd64.sh:186 has its own library list, and that list already includes libtk:

for lib in lib9 libbio libmp libsec libmath libfreetype libmemdraw libmemlayer libdraw libtk; do

build-macos-headless.sh builds only the emulator and assumes the libraries already exist, so the gap stays hidden on any machine that has built before. It shows up on a fresh clone using the mk path, which CLAUDE.md offers alongside the scripts.

Verification

macOS arm64, fresh worktree at 585fbdba, these two commits only.

Before, from a clean tree: ./makemk.sh, then mk GUIBACK=headless emuinstall stops at the emulator link. No o.emu is produced.

After, from a clean tree (mk nuke, then ./makemk.sh, then mk GUIBACK=headless emuinstall): the command exits 0. libtk.a is built as part of the walk, the emulator links, MacOSX/arm64/bin/emu is installed, and the installed binary runs.

The emu configs for MacOSX and Linux declare tk, so the emulator links
libtk.a, but libtk was absent from the directory walk. mk emuinstall and
mk install therefore failed at the final link on a clean clone. The
platform build scripts carry their own library list including libtk,
which is why CI never saw this.
@Ticed
Ticed requested a review from pdfinn as a code owner August 18, 2026 11:19
Every other platform sets INSTALLDIR to $ROOT/$SYSTARG/$OBJTYPE/bin. The
macOS mkfiles set a literal /sys/$SYSTARG/$OBJTYPE/bin, so the install step
had nowhere to write and mk emuinstall failed after a successful build.
@Ticed Ticed changed the title fix(build): add libtk to EMUDIRS fix(build): repair mk emuinstall on a clean clone Aug 18, 2026
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