From 607e020150f1bba84beec11aceadbc42abf33986 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 2 Nov 2023 08:15:44 -0400 Subject: cmd/cgo: disable #cgo noescape/nocallback until Go 1.23 Go 1.21 and earlier do not understand this line, causing "go mod vendor" of //go:build go1.22-tagged code that uses this feature to fail. The solution is to include the go/build change to skip over the line in Go 1.22 (making "go mod vendor" from Go 1.22 onward work with this change) and then wait to deploy the cgo change until Go 1.23, at which point Go 1.21 and earlier will be unsupported. For #56378. Fixes #63293. Change-Id: Ifa08b134eac5a6aa15d67dad0851f00e15e1e58b Reviewed-on: https://go-review.googlesource.com/c/go/+/539235 LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui Reviewed-by: Bryan Mills --- src/runtime/testdata/testprogcgo/cgonocallback.go | 3 +-- src/runtime/testdata/testprogcgo/cgonoescape.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/runtime/testdata') diff --git a/src/runtime/testdata/testprogcgo/cgonocallback.go b/src/runtime/testdata/testprogcgo/cgonocallback.go index 8cbbfd1957..c13bf271a4 100644 --- a/src/runtime/testdata/testprogcgo/cgonocallback.go +++ b/src/runtime/testdata/testprogcgo/cgonocallback.go @@ -8,8 +8,7 @@ package main // But it do callback to go in this test, Go should crash here. /* -#cgo nocallback runCShouldNotCallback - +// TODO(#56378): #cgo nocallback runCShouldNotCallback extern void runCShouldNotCallback(); */ import "C" diff --git a/src/runtime/testdata/testprogcgo/cgonoescape.go b/src/runtime/testdata/testprogcgo/cgonoescape.go index 056be44889..f5eebac677 100644 --- a/src/runtime/testdata/testprogcgo/cgonoescape.go +++ b/src/runtime/testdata/testprogcgo/cgonoescape.go @@ -13,7 +13,7 @@ package main // 2. less than 100 new allocated heap objects after invoking withoutNoEscape 100 times. /* -#cgo noescape runCWithNoEscape +// TODO(#56378): #cgo noescape runCWithNoEscape void runCWithNoEscape(void *p) { } -- cgit v1.3-5-g9baa