From: Bryan C. Mills Date: Thu, 25 Mar 2021 01:51:44 +0000 (-0400) Subject: test: skip fixedbugs/issue36705 on Windows X-Git-Tag: go1.17beta1~988 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a95e2ae2804becdda6c265c6d589ae8184a34160;p=gostls13.git test: skip fixedbugs/issue36705 on Windows This test is verifying that setting or unsetting an environment variable in Go via the "os" package makes that change visible to the C getenv function. The test has been failing on Windows since CL 304569; it isn't clear to me whether it was running at all before that point. On Windows the getenv and _putenv C functions are not thread-safe, so Go's os.Setenv and os.Getenv use the SetEnvironmentVariable and GetEnvironmentVariable system calls instead. That seems to work fine in practice; however, changes via SetEnvironmentVariable are empirically not visible to the C getenv function on certain versions of Windows. The MSDN getenv documentation¹ states that ‘getenv operates only on the data structures accessible to the run-time library and not on the environment “segment” created for the process by the operating system. Therefore, programs that use the envp argument to main or wmain may retrieve invalid information.’ That may be related to what we're seeing here. (https://github.com/curl/curl/issues/4774 describes this same behavior observed in the curl project.) ¹https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/getenv-wgetenv?view=msvc-160#remarks Updates #36705 Change-Id: I222792f75c650f32c5025b0fa3edab232ff66353 Reviewed-on: https://go-review.googlesource.com/c/go/+/304669 Trust: Bryan C. Mills Run-TryBot: Bryan C. Mills Reviewed-by: Matthew Dempsky TryBot-Result: Go Bot --- diff --git a/test/fixedbugs/issue36705.go b/test/fixedbugs/issue36705.go index d5a0e7fade..b0485c6335 100644 --- a/test/fixedbugs/issue36705.go +++ b/test/fixedbugs/issue36705.go @@ -1,4 +1,4 @@ -// +build cgo +// +build cgo,!windows // run fake-arg-to-force-use-of-go-run // Copyright 2020 The Go Authors. All rights reserved.