Skip to content

Commit

Permalink
cmd/gomote: ignore some new paths for deleting in gomote push
Browse files Browse the repository at this point in the history
Since Go 1.9, the cmd/go tool has rearranged and the Go build now
writes some auto-generated files in different places. Don't delete
these auto-generated files in a "gomote push".

Otherwise you can't iteratively:

* hack locally
* gomote push
* test remotely

... without getting remote errors about missing files.

Change-Id: Iaf4d03f4a2cde46f5022b63066186495b3ae2c01
Reviewed-on: https://go-review.googlesource.com/53070
Reviewed-by: Andrew Bonventre <[email protected]>
  • Loading branch information
bradfitz committed Aug 3, 2017
1 parent 25c11ee commit f9342a3
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions cmd/gomote/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,30 @@ func push(args []string) error {
var toDel []string
for rel := range remote {
if rel == "VERSION" {
// Don't delete this. It's harmless, and necessary.
// Clients can overwrite it if they want.
// Don't delete this. It's harmless, and
// necessary. Clients can overwrite it if they
// want. But if there's no VERSION file there,
// make.bash/bat assumes there's a git repo in
// place, but there's not only not a git repo
// there with gomote, but there's no git tool
// available either.
continue
}
// Also don't delete the auto-generated files from cmd/dist.
// Otherwise gomote users can't gomote push + gomote run make.bash
// and then iteratively:
// -- hack locally
// -- gomote push
// -- gomote run go test -v ...
// Because the go test would fail remotely without
// these files if they were deleted by gomote push.
switch rel {
case "src/cmd/cgo/zdefaultcc.go",
"src/cmd/go/internal/cfg/zdefaultcc.go",
"src/cmd/go/internal/cfg/zosarch.go",
"src/cmd/internal/objabi/zbootstrap.go",
"src/go/build/zcgo.go",
"src/runtime/internal/sys/zversion.go":
continue
}
if isGitIgnored(rel) {
Expand Down

0 comments on commit f9342a3

Please sign in to comment.