container: enter init path early
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 3m0s
Test / Hakurei (push) Successful in 4m48s
Test / Sandbox (race detector) (push) Successful in 6m6s
Test / Hakurei (race detector) (push) Successful in 7m32s
Test / ShareFS (push) Successful in 7m54s
Test / Flake checks (push) Successful in 1m19s

There is generally no use case where any setup is required before init, and requiring the explicit function call is error-prone and unnecessary. It also causes trouble with packages using a similar trick. This change moves argv0 check early and makes it an import side effect. The stub will be removed in v0.5.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
cat
2026-08-25 14:53:29 +09:00
parent ac7abbbe3f
commit 1c3761bb53
22 changed files with 32 additions and 72 deletions
-4
View File
@@ -2,12 +2,10 @@ package ldd_test
import (
"errors"
"os"
"os/exec"
"testing"
"hakurei.app/check"
"hakurei.app/container"
"hakurei.app/ldd"
"hakurei.app/message"
)
@@ -42,5 +40,3 @@ func TestExec(t *testing.T) {
}
})
}
func TestMain(m *testing.M) { container.TryArgv0(nil); os.Exit(m.Run()) }