Skip to content

cmd/go: test -c rebuilds even when target is up to date #15799

Closed
@rsc

Description

@rsc
cd $GOROOT/src/expvar
go test -c
go test -x -c

shows that the second command does rebuild the test package from the test sources and then rebuild the test binary. If the target test binary exists and has the right build ID, it should be possible to avoid that. This causes headaches for Kubernetes (for example kubernetes/kubernetes#24850) and likely other large projects.

The exact package doesn't matter much; I am using expvar in the example because I know that the testing package does not depend on expvar, which might complicate the analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions