Skip to content

Commit 72019cf

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 3e95c5b commit 72019cf

8 files changed

+27
-7
lines changed

src/cmd/dist/test.go

+12
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,18 @@ func (t *tester) registerTests() {
461461
})
462462
}
463463

464+
// Test the ios build tag on darwin/amd64 for the iOS simulator.
465+
if goos == "darwin" && !t.iOS() {
466+
t.tests = append(t.tests, distTest{
467+
name: "amd64ios",
468+
heading: "ios tag on darwin/amd64",
469+
fn: func(dt *distTest) error {
470+
t.addCmd(dt, "src", t.goTest(), t.timeout(300), "-tags=ios", "-run=SystemRoots", "crypto/x509")
471+
return nil
472+
},
473+
})
474+
}
475+
464476
if t.race {
465477
return
466478
}

src/crypto/x509/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
package x509
66

7-
//go:generate go run root_darwin_arm64_gen.go -version 55161.80.1
7+
//go:generate go run root_darwin_ios_gen.go -version 55161.80.1
88

99
import "sync"
1010

src/crypto/x509/root_cgo_darwin_amd64.go

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
// +build !ios
6+
57
package x509
68

79
// This cgo implementation exists only to support side-by-side testing by

src/crypto/x509/root_darwin_amd64.go

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
// +build !ios
6+
57
package x509
68

79
import (

src/crypto/x509/root_darwin_arm64.go renamed to src/crypto/x509/root_darwin_ios.go

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/crypto/x509/root_darwin_arm64_gen.go renamed to src/crypto/x509/root_darwin_ios_gen.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// +build ignore
66

7-
// Generates root_darwin_arm64.go.
7+
// Generates root_darwin_ios.go.
88
//
99
// As of iOS 13, there is no API for querying the system trusted X.509 root
1010
// certificates.
@@ -37,7 +37,7 @@ import (
3737
)
3838

3939
func main() {
40-
var output = flag.String("output", "root_darwin_arm64.go", "file name to write")
40+
var output = flag.String("output", "root_darwin_ios.go", "file name to write")
4141
var version = flag.String("version", "", "security_certificates version")
4242
flag.Parse()
4343
if *version == "" {
@@ -156,9 +156,10 @@ func main() {
156156
}
157157
}
158158

159-
const header = `// Code generated by root_darwin_arm64_gen.go -version %s; DO NOT EDIT.
159+
const header = `// Code generated by root_darwin_ios_gen.go -version %s; DO NOT EDIT.
160160
// Update the version in root.go and regenerate with "go generate".
161161
162+
// +build darwin,arm64 darwin,amd64,ios
162163
// +build !x509omitbundledroots
163164
164165
package x509

src/crypto/x509/root_omit.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build darwin,arm64,x509omitbundledroots
5+
// +build darwin,arm64 darwin,amd64,ios
6+
// +build x509omitbundledroots
67

78
// This file provides the loadSystemRoots func when the
89
// "x509omitbundledroots" build tag has disabled bundling a copy,

src/crypto/x509/root_omit_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build darwin,arm64,x509omitbundledroots
5+
// +build darwin,arm64 darwin,amd64,ios
6+
// +build x509omitbundledroots
67

78
package x509
89

0 commit comments

Comments
 (0)