Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mknyszek opened this issue Feb 3, 2023 · 3 comments
Assignees
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mknyszek
Copy link
Contributor

mknyszek commented Feb 3, 2023

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 mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 3, 2023
@mknyszek mknyszek added this to the Backlog milestone Feb 3, 2023
@gopherbot
Copy link

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

@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 3, 2023
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 3, 2023
@dmitshur
Copy link
Contributor

dmitshur commented Feb 3, 2023

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.

gopherbot pushed a commit to golang/build that referenced this issue Feb 3, 2023
The previous change added a StopAfterMake requirement so that the
misc-compile builders would only ever run make.bash. However, this
is a fairly big hammer as it skips everything after make.bash. Coming
up, we're going to want to runSubrepoTests.

However, we can't call into runTests because of golang/go#58297, so we
need a special exception for that. This change thus also adds the notion
of IsCrossCompileOnly defined by whether the host arch doesn't line up
with the target arch, and adds a test to make sure this only applies to
the misc-compile builders.

This change also removes some hard-coding of the misc-compile prefix in
favor of this new IsCrossCompileOnly notion.

For golang/go#58163.

Change-Id: I40ce91e13b45e8bbbb607aedd302f0ec0fbd608a
Reviewed-on: https://go-review.googlesource.com/c/build/+/464956
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
@dmitshur
Copy link
Contributor

dmitshur commented Aug 10, 2023

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 dmitshur modified the milestones: Backlog, Go1.21 Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
Archived in project
Development

No branches or pull requests

5 participants