From: Filippo Valsorda Date: Wed, 24 Jun 2020 16:59:10 +0000 (-0400) Subject: crypto/x509: restore support for ios tag on darwin/amd64 X-Git-Tag: go1.15rc1~69 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=72019cf3128af1b8f48f7ec5f04bc04a98c23131;p=gostls13.git crypto/x509: restore support for ios tag on darwin/amd64 Fixes #38710 Change-Id: I9b210e95fd997ff53ec704c5f61110045aaa94bb Reviewed-on: https://go-review.googlesource.com/c/go/+/239559 Run-TryBot: Filippo Valsorda TryBot-Result: Gobot Gobot Reviewed-by: Dmitri Shuralyov --- diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index e1cd4965c3..2dc9459215 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -461,6 +461,18 @@ func (t *tester) registerTests() { }) } + // Test the ios build tag on darwin/amd64 for the iOS simulator. + if goos == "darwin" && !t.iOS() { + t.tests = append(t.tests, distTest{ + name: "amd64ios", + heading: "ios tag on darwin/amd64", + fn: func(dt *distTest) error { + t.addCmd(dt, "src", t.goTest(), t.timeout(300), "-tags=ios", "-run=SystemRoots", "crypto/x509") + return nil + }, + }) + } + if t.race { return } diff --git a/src/crypto/x509/root.go b/src/crypto/x509/root.go index 8606a0f547..da5e91b91c 100644 --- a/src/crypto/x509/root.go +++ b/src/crypto/x509/root.go @@ -4,7 +4,7 @@ package x509 -//go:generate go run root_darwin_arm64_gen.go -version 55161.80.1 +//go:generate go run root_darwin_ios_gen.go -version 55161.80.1 import "sync" diff --git a/src/crypto/x509/root_cgo_darwin_amd64.go b/src/crypto/x509/root_cgo_darwin_amd64.go index bec57eb836..15c72cc0c8 100644 --- a/src/crypto/x509/root_cgo_darwin_amd64.go +++ b/src/crypto/x509/root_cgo_darwin_amd64.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build !ios + package x509 // This cgo implementation exists only to support side-by-side testing by diff --git a/src/crypto/x509/root_darwin_amd64.go b/src/crypto/x509/root_darwin_amd64.go index 8ad5a9607d..ccc37b8ec5 100644 --- a/src/crypto/x509/root_darwin_amd64.go +++ b/src/crypto/x509/root_darwin_amd64.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build !ios + package x509 import ( diff --git a/src/crypto/x509/root_darwin_arm64.go b/src/crypto/x509/root_darwin_ios.go similarity index 99% rename from src/crypto/x509/root_darwin_arm64.go rename to src/crypto/x509/root_darwin_ios.go index 4d9af12c38..5ecc4911b3 100644 --- a/src/crypto/x509/root_darwin_arm64.go +++ b/src/crypto/x509/root_darwin_ios.go @@ -1,6 +1,7 @@ -// Code generated by root_darwin_arm64_gen.go -version 55161.80.1; DO NOT EDIT. +// Code generated by root_darwin_ios_gen.go -version 55161.80.1; DO NOT EDIT. // Update the version in root.go and regenerate with "go generate". +// +build darwin,arm64 darwin,amd64,ios // +build !x509omitbundledroots package x509 diff --git a/src/crypto/x509/root_darwin_arm64_gen.go b/src/crypto/x509/root_darwin_ios_gen.go similarity index 94% rename from src/crypto/x509/root_darwin_arm64_gen.go rename to src/crypto/x509/root_darwin_ios_gen.go index baad8a2b02..7a42466e5f 100644 --- a/src/crypto/x509/root_darwin_arm64_gen.go +++ b/src/crypto/x509/root_darwin_ios_gen.go @@ -4,7 +4,7 @@ // +build ignore -// Generates root_darwin_arm64.go. +// Generates root_darwin_ios.go. // // As of iOS 13, there is no API for querying the system trusted X.509 root // certificates. @@ -37,7 +37,7 @@ import ( ) func main() { - var output = flag.String("output", "root_darwin_arm64.go", "file name to write") + var output = flag.String("output", "root_darwin_ios.go", "file name to write") var version = flag.String("version", "", "security_certificates version") flag.Parse() if *version == "" { @@ -156,9 +156,10 @@ func main() { } } -const header = `// Code generated by root_darwin_arm64_gen.go -version %s; DO NOT EDIT. +const header = `// Code generated by root_darwin_ios_gen.go -version %s; DO NOT EDIT. // Update the version in root.go and regenerate with "go generate". +// +build darwin,arm64 darwin,amd64,ios // +build !x509omitbundledroots package x509 diff --git a/src/crypto/x509/root_omit.go b/src/crypto/x509/root_omit.go index b757ea81c2..175d71643b 100644 --- a/src/crypto/x509/root_omit.go +++ b/src/crypto/x509/root_omit.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin,arm64,x509omitbundledroots +// +build darwin,arm64 darwin,amd64,ios +// +build x509omitbundledroots // This file provides the loadSystemRoots func when the // "x509omitbundledroots" build tag has disabled bundling a copy, diff --git a/src/crypto/x509/root_omit_test.go b/src/crypto/x509/root_omit_test.go index 2a9fb3f0c3..5ab6c931de 100644 --- a/src/crypto/x509/root_omit_test.go +++ b/src/crypto/x509/root_omit_test.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin,arm64,x509omitbundledroots +// +build darwin,arm64 darwin,amd64,ios +// +build x509omitbundledroots package x509