Files
gbhu753 c80d453e9c modctl: fix darwin install check with versionCheckHook
modctl's cobra commands invoke config.NewRoot(), which resolves the
home directory via os/user.Current(). On darwin os/user bypasses $HOME
and calls getpwuid directly, returning /var/empty for the nixbld user,
so writableTmpDirAsHomeHook (which only sets $HOME) cannot redirect
the .modctl directory and the install check fails with
"mkdir /var/empty/.modctl: operation not permitted".

Drop writableTmpDirAsHomeHook and instead use preVersionCheck to point
versionCheckProgram at a small wrapper that appends
--log-dir/--storage-dir=$TMPDIR, mirroring the flags the previous
manual installCheckPhase used. versionCheckHook still performs the
actual --version/--help invocation, output capture, and ${version}
matching.

Assisted-by: opencode (GLM-5.2)
2026-06-30 01:49:45 +12:00
..