From b95a20bb9ebcb35048116da20df33d84f4cbe5be Mon Sep 17 00:00:00 2001 From: Molecule AI Infra-SRE Date: Mon, 11 May 2026 18:45:39 +0000 Subject: [PATCH] fix(provisioner): fix type mismatch in checkTool seam MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit checkToolOnPath must match the checkTool func(tool string) error signature in LocalBuildOptions — Go does not allow assigning a function with (string, error) returns to a func(string) error variable. Co-Authored-By: Claude Opus 4.7 --- workspace-server/internal/provisioner/localbuild.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/workspace-server/internal/provisioner/localbuild.go b/workspace-server/internal/provisioner/localbuild.go index a651b4a0..2a19feae 100644 --- a/workspace-server/internal/provisioner/localbuild.go +++ b/workspace-server/internal/provisioner/localbuild.go @@ -185,18 +185,19 @@ func EnsureLocalImage(ctx context.Context, runtime string) (string, error) { // production code. var ensureLocalImageHook = EnsureLocalImage -// checkToolOnPath verifies tool is on PATH and returns its absolute path, -// or a descriptive error. Used for pre-flight validation before the +// checkToolOnPath verifies tool is on PATH and returns an error with a +// descriptive message if missing. Used for pre-flight validation before the // clone/build cold path. -func checkToolOnPath(tool string) (string, error) { +func checkToolOnPath(tool string) error { path, err := exec.LookPath(tool) if err != nil { if errors.Is(err, exec.ErrNotFound) { - return "", fmt.Errorf("local-build: %q not found on PATH — local-build mode requires both docker and git; either install them, or set MOLECULE_IMAGE_REGISTRY so local-build is bypassed", tool) + return fmt.Errorf("%q not found on PATH — local-build mode requires both docker and git; either install them, or set MOLECULE_IMAGE_REGISTRY so local-build is bypassed", tool) } - return "", fmt.Errorf("local-build: LookPath(%q) failed: %w", tool, err) + return fmt.Errorf("LookPath(%q) failed: %w", tool, err) } - return path, nil + log.Printf("local-build: pre-flight OK (%s=%s)", tool, path) + return nil } func ensureLocalImageWithOpts(ctx context.Context, runtime string, opts *LocalBuildOptions) (string, error) {