Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/sys/windows: compile error with Go 1.11 #34742

Closed
mtolman opened this issue Oct 7, 2019 · 7 comments
Closed

x/sys/windows: compile error with Go 1.11 #34742

mtolman opened this issue Oct 7, 2019 · 7 comments
Milestone

Comments

@mtolman
Copy link

@mtolman mtolman commented Oct 7, 2019

What version of Go are you using (go version)?

$ go version go1.11.1 windows/amd64

Does this issue reproduce with the latest release?

not sure

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\mtolman\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\release-trunk\liveconsole-agent;C:\Users\mtolman\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\mtolman\AppData\Local\Temp\go-build937983166=/tmp/go-build -gno-record-gcc-switches

What did you do?

Using x/sys/windows in my project now causes compilation errors when it did not previously.

Here is a sample source file:

package main

import (
	"fmt"
	"golang.org/x/sys/windows"
)

var dll windows.DLL

func main() {
	fmt.Println("help")
}

This used to compile but no longer does. It fails with these errors:

..\golang.org\x\sys\windows\dll_windows.go:21:6: missing function body
..\golang.org\x\sys\windows\dll_windows.go:24:6: missing function body

The issue looks to be caused by this merge:

https://go.googlesource.com/sys/+/ef33b2fb2c414dca4bfcf6ca59cbd1d9ad00703d

@gopherbot gopherbot added this to the Unreleased milestone Oct 7, 2019
mtolman referenced this issue in golang/sys Oct 7, 2019
This is a bit cleaner and makes it more explicit what's happening, along
with a documenting comment.

Change-Id: I30c92f8576c72b05ebdb4634c68023237bde3cbf
Reviewed-on: https://go-review.googlesource.com/c/sys/+/199519
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented Oct 7, 2019

Does the issue disappear with Go 1.12 or 1.13?

@bradfitz Is 1.11 still supported?

@mdempsky mdempsky changed the title x/sys/windows compile error x/sys/windows: compile error with Go 1.11 Oct 7, 2019
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Oct 7, 2019

No, it isn't.

For certain low-level or important packages, though, we try not to unnecessarily break old users. At least in some sort of best effort untested fashion, which is kinda lame. I think we should be definitive about saying "no, we don't support that" or actually make it tested.

But the current situation is somewhere in between: we don't test Go 1.11 at all, but at the same time this kinda sucks, breaking Go 1.11 users for something like this.

So maybe it's time to just say that Go 1.11 users should use an older version of this package, or something on the Go 1.11 branch (release-branch.go1.11).

@mtolman
Copy link
Author

@mtolman mtolman commented Oct 7, 2019

1.12.1 and 1.13.1 are working for me. I guess now is a good time to upgrade :) Thanks!

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Oct 7, 2019

Okay, we'll close this then. Sorry about that.

@bradfitz bradfitz closed this Oct 7, 2019
@Shagrat2
Copy link

@Shagrat2 Shagrat2 commented Oct 10, 2019

Bat win32 XP work only with golang 1.11

@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented Oct 10, 2019

Windows XP has been unsupported by Microsoft for over 5 years.

carolynvs added a commit to getporter/azure-plugins that referenced this issue Oct 18, 2019
They dropped support for Go 1.11

golang/go#34742
carolynvs added a commit to getporter/azure-plugins that referenced this issue Oct 18, 2019
They dropped support for Go 1.11

golang/go#34742
@trinhhunganh
Copy link

@trinhhunganh trinhhunganh commented Oct 30, 2019

@bradfitz
I am using go1.9.3 windows/amd64 and get the same
golang.org\x\sys\windows\dll_windows.go:21:6: missing function body
golang.org\x\sys\windows\dll_windows.go:24:6: missing function body

Do I have to upgrade go to newer version or is there a workaround?
Thank you and sorry to comment on a closed issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.