Skip to content

fix(build): install Xorg into a staging root, not over the base rootfs - #678

Merged
Pryancito merged 1 commit into
masterfrom
claude/labwc-eclipse-desktop-08f1ft
Jul 29, 2026
Merged

fix(build): install Xorg into a staging root, not over the base rootfs#678
Pryancito merged 1 commit into
masterfrom
claude/labwc-eclipse-desktop-08f1ft

Conversation

@Pryancito

Copy link
Copy Markdown
Owner

The build-time apk add --root rootfs/x86_64 --initdb clobbered the base system: --initdb starts from an empty database, so to satisfy xorg-server apk pulls the ENTIRE dependency closure (musl, libc, ld-musl, base libs) and writes it over Eclipse's hand-staged busybox/musl. The result booted to every VT shell SIGSEGV'ing identically (jump to a garbage PC 0x6100 through the broken loader), one of which tripped the new descriptive panic "Thread::lock_linux(): ... has no LinuxThread ext" during teardown.

Fix: install into a throwaway staging root (ignored/xorg-stage), then copy ONLY the X-owned trees into the real rootfs — usr/bin, usr/lib, usr/libexec, usr/share, etc/fonts, etc/X11 — never bin/ lib/ sbin/ or base /etc. The base loader/libc/busybox are preserved; X is purely additive (musl lives in /lib, which is skipped, so usr/lib carries only the X + mesa libs). Also create the libc.musl-x86_64.so.1 -> ld-musl-x86_64.so.1 alias the Alpine X binaries link against, additively, so they resolve libc against the base's own musl.

xtask builds; fmt/clippy clean.

NOTE for anyone with an already-broken rootfs from the previous build: clear it (rm -rf rootfs/x86_64) before rebuilding so the base is re-staged fresh — the incremental build path does not restore a clobbered /lib/ld-musl.

Claude-Session: https://claude.ai/code/session_01MHCn5RNRcwR5PY1sYBHY2S

The build-time `apk add --root rootfs/x86_64 --initdb` clobbered the base
system: --initdb starts from an empty database, so to satisfy xorg-server apk
pulls the ENTIRE dependency closure (musl, libc, ld-musl, base libs) and writes
it over Eclipse's hand-staged busybox/musl. The result booted to every VT shell
SIGSEGV'ing identically (jump to a garbage PC 0x6100 through the broken loader),
one of which tripped the new descriptive panic "Thread::lock_linux(): ... has no
LinuxThread ext" during teardown.

Fix: install into a throwaway staging root (ignored/xorg-stage), then copy ONLY
the X-owned trees into the real rootfs — usr/bin, usr/lib, usr/libexec,
usr/share, etc/fonts, etc/X11 — never bin/ lib/ sbin/ or base /etc. The base
loader/libc/busybox are preserved; X is purely additive (musl lives in /lib,
which is skipped, so usr/lib carries only the X + mesa libs). Also create the
`libc.musl-x86_64.so.1 -> ld-musl-x86_64.so.1` alias the Alpine X binaries link
against, additively, so they resolve libc against the base's own musl.

xtask builds; fmt/clippy clean.

NOTE for anyone with an already-broken rootfs from the previous build: clear it
(`rm -rf rootfs/x86_64`) before rebuilding so the base is re-staged fresh — the
incremental build path does not restore a clobbered /lib/ld-musl.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MHCn5RNRcwR5PY1sYBHY2S
@Pryancito
Pryancito merged commit 7bad518 into master Jul 29, 2026
2 of 14 checks passed
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.

2 participants