go icon indicating copy to clipboard operation
go copied to clipboard

cmd/dist: make `--compile-only` actually only compile test binaries and not run them

Open mknyszek opened this issue 2 years ago • 2 comments

Currently the --compile-only flag mostly prevents tests from running, but still runs all compiled test binaries. This means that our cross-compiling builders don't have an easy way to build test packages, so we're missing some coverage there on the trybots.

CC @aclements @golang/release

mknyszek avatar Feb 03 '23 16:02 mknyszek

Change https://go.dev/cl/464956 mentions this issue: dashboard: remove StopAfterMake from misc-compile builders

gopherbot avatar Feb 03 '23 17:02 gopherbot

For additional context, this comment thread captures some of the reasons why -run=^$ was chosen over test -c at the time, before we considered this use case.

dmitshur avatar Feb 03 '23 17:02 dmitshur

There were a lot of internal refactors and clean up work done as part of being able to add proper -json flag support to cmd/dist (#37486), and that lead up to making -compile-only flag do as its name suggests, rather than stopping just short of that. See CL 492986 and the rest of the CLs in the great dist test cleanup of 2023.

So this is done in Go 1.21.

dmitshur avatar Aug 10 '23 15:08 dmitshur