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: test should not rebuild by default #12064

Closed
davecheney opened this issue Aug 7, 2015 · 8 comments
Closed

cmd/dist: test should not rebuild by default #12064

davecheney opened this issue Aug 7, 2015 · 8 comments
Milestone

Comments

@davecheney
Copy link
Contributor

@davecheney davecheney commented Aug 7, 2015

go tool dist test -list rebuilds the standard library

pi@raspberrypi ~/go/src $ go tool dist test -list 

##### Building packages and commands.
runtime
^C

-list won't run any tests, so it shouldn't kick of an expensive rebuild.

@davecheney davecheney added this to the Go1.6 milestone Aug 7, 2015
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Aug 7, 2015

Perhaps. This isn't really a user-visible tool. It's just used by the test infrastructure in the build coordinator.

This is easy enough to fix but a) it would preclude listing or omitting any tests that are only known about after a build (none currently, but I'd like to omit stdlib packages from the list if they didn't have test files or test files with the right +build tags), and b) once we do this, then people will file bugs about go tool dist test <testname> also rebuilding probably.

I'd kinda prefer to do nothing.

@davecheney
Copy link
Contributor Author

@davecheney davecheney commented Aug 7, 2015

Counter proposal, -list enables -no-rebuild, which is what you need to pass
to make the tool do what you want.

I agree that it's an internal tool, but today I needed to use -list to
figure out the name of the test group I wanted to run. I don't think it'll
take much effort to make -list more user friendly.

On Fri, Aug 7, 2015 at 5:01 PM, Brad Fitzpatrick notifications@github.com
wrote:

Perhaps. This isn't really a user-visible tool. It's just used by the test
infrastructure in the build coordinator.

This is easy enough to fix but a) it would preclude listing or omitting
any tests that are only known about after a build (none currently, but I'd
like to omit stdlib packages from the list if they didn't have test files
or test files with the right +build tags), and b) once we do this, then
people will file bugs about go tool dist test also rebuilding
probably.

I'd kinda prefer to do nothing.


Reply to this email directly or view it on GitHub
#12064 (comment).

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Aug 7, 2015

That doesn't address either of my a) or b) comments.

How about just failing immediately if you use -list and things aren't already built. That would address both my concerns.

@davecheney
Copy link
Contributor Author

@davecheney davecheney commented Aug 7, 2015

Everything was built, passing -list wanted to build them again before it
would tell me the names of the test groups.

On Fri, 7 Aug 2015 17:43 Brad Fitzpatrick notifications@github.com wrote:

That doesn't address either of my a) or b) comments.

How about just failing immediately if you use -list and things aren't
already built. That would address both my concerns.


Reply to this email directly or view it on GitHub
#12064 (comment).

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Aug 7, 2015

I am talking about the case where things are NOT built. You're discussing one specific set of cases. I'm considering all the states that the world might be in when you run said command, making sure the command does consistent things.

My counter-counter proposal was:

  • a) (world built + -list) => automatically set -no-rebuild to true.
  • b) (world not built + -list) => fail, saying you need to build first.

You want a). I am proposing that a) is only acceptable if we also do b).

@rsc
Copy link
Contributor

@rsc rsc commented Nov 5, 2015

The problem here is "rebuild by default". We should make test not rebuild by default, rename the flag to -rebuild, and pass -rebuild from run.{bash,bat,rc} where we need it.

@rsc rsc changed the title cmd/dist: test -list subcommand rebuilds stdlib cmd/dist: test should not rebuild by default Nov 5, 2015
@rsc rsc modified the milestones: Unplanned, Go1.6 Nov 5, 2015
@iWdGo
Copy link
Contributor

@iWdGo iWdGo commented Dec 22, 2018

While searching for some issue, this issue can apparently be closed as no build occurs w/o specific flags.

go\src>go tool dist version
go1.11.4
go\src>go version
go version go1.11.4 windows/amd64
go\src>git checkout master
go\src>go tool dist test -list
go_test:archive/tar
go_test:archive/zip
...

Using a build.

go\src>cd ..
go>set GOROOT=%CD%
go>cd src
go\src>go tool dist version
devel +b8043024cf Sat Dec 22 15:07:58 2018 +0100
go\src>go tool dist test -list
go_test:archive/tar
go_test:archive/zip
...
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jan 2, 2019

@iWdGo, thanks.

@bradfitz bradfitz closed this Jan 2, 2019
@golang golang locked and limited conversation to collaborators Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.