Skip to content

Commit

Permalink
Revert "buildutil: special case "appengine" and prefer arm64"
Browse files Browse the repository at this point in the history
This reverts commit 4ffa108.
  • Loading branch information
charlievieth committed Apr 30, 2022
1 parent 4ffa108 commit 325bbfd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
8 changes: 1 addition & 7 deletions buildutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ var preferredOSList = [...]string{
var preferredArchList = [...]string{
runtime.GOARCH,
"amd64",
"arm64",
"386",
"arm",
"arm64",
"ppc64",
}

Expand Down Expand Up @@ -509,12 +509,6 @@ func MatchContext(orig *build.Context, filename string, src interface{}) (*build
if cgo, ok := tags["cgo"]; ok {
ctxt.CgoEnabled = cgo
}
if tags["appengine"] {
ctxt.BuildTags = append(ctxt.BuildTags, "appengine")
if shouldBuild(ctxt, data, tags) {
return ctxt, nil
}
}

// find and match OS, Arch and other build tags

Expand Down
29 changes: 0 additions & 29 deletions buildutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,35 +275,6 @@ func TestMatchContext_BuildTags(t *testing.T) {
t.Errorf("MatchContext - BuildTags: want %s got: %s", expTags, ctx.BuildTags)
}
}

{
switch runtime.GOOS {
case "linux", "darwin", "freebsd", "openbsd", "netbsd":
src := "// +build appengine !linux,!darwin,!freebsd,!openbsd,!netbsd\n\n" +
"package main\n"

expTags := []string{"appengine"}
orig := &build.Context{}

ctx, err := MatchContext(orig, "file1", src)
if err != nil {
t.Error(err)
}

sort.Strings(ctx.BuildTags)
if !reflect.DeepEqual(ctx.BuildTags, expTags) {
t.Errorf("MatchContext - BuildTags: want %s got: %s", expTags, ctx.BuildTags)
}
if ctx.GOOS != runtime.GOOS {
t.Fatal("GOOS", ctx.GOOS)
}
if ctx.GOARCH != runtime.GOARCH {
t.Fatal("GOARCH", ctx.GOARCH)
}
default:
t.Logf("test cannot run on %q", runtime.GOOS)
}
}
}

func TestMatchContext_GOOS(t *testing.T) {
Expand Down

0 comments on commit 325bbfd

Please sign in to comment.