Skip to content

Makefile: make lint invokes BSD install when host Go exists #694

Description

@nnunley

Problem

On a clean lint cache with a host go already on PATH, make lint leaves the Make variable GO unset. The golangci-lint bootstrap recipe expands $(GO) install ... to BSD install ..., which exits 64 instead of installing the pinned linter.

Both fresh validators for PR #677 reproduced this independently. The same conditional structure exists on current main@upstream, so this is not a regression in PR #677.

Reproduction

rm -f .cache/local/bin/golangci-lint
which go
make lint

Observed command shape/error: BSD install ...@v2.12.2, exit 64.

make lint GO-VERSION=1.26.5 bootstraps the pinned Go/linter and then passes with zero issues.

Cause

The Makefile includes $M/go.mk only when host Go is absent or GO-VERSION is explicitly provided. With host Go present, neither GO nor the go helper rules are defined, but the lint install recipe still invokes $(GO) install.

Expected

make lint should use the discovered host go or otherwise define the Go command consistently, while retaining the pinned golangci-lint version and cache paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions