feat(cli): doctor check that surfaces placeholder sidecar JAR

Doctor flags a shipped binary that's still carrying the build-time
placeholder so `uatu test` won't silently fail trying to launch a
nonexistent sidecar. Makefile uatu target now copies the freshly
built fat JAR into the embed directory before `go build`.
This commit is contained in:
pj committed 2026-04-18 00:06:30 +07:00
1 parent 6a9fac7ec0
commit 8c6a3171d7
2 files changed
+15

No files matched your search

+13
View File
@@ -10,6 +10,8 @@ import (
"regexp"
"strconv"
"time"
"github.com/priyanshujain/uatu/internal/sidecar"
)
type doctorCheck struct {
@@ -22,9 +24,20 @@ func defaultDoctorChecks() []doctorCheck {
{Name: "adb on PATH", Run: checkExecutableOnPath("adb")},
{Name: "emulator on PATH or under ANDROID_HOME", Run: checkEmulator},
{Name: "java 17+ on PATH", Run: checkJavaVersion},
{Name: "sidecar JAR is real (not placeholder)", Run: checkSidecarJAR},
}
}
func checkSidecarJAR(_ context.Context) error {
if sidecar.IsPlaceholder() {
return fmt.Errorf("placeholder JAR embedded — run `make sidecar && make uatu` to embed the real fat JAR")
}
if sidecar.EmbeddedSize() == 0 {
return fmt.Errorf("embedded JAR is empty")
}
return nil
}
func runDoctorChecks(ctx context.Context, checks []doctorCheck, stdout io.Writer) error {
failures := 0
for _, check := range checks {