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

golang.org/x/sys/windows: Can't compile windows app #54462

Closed
stranger-inthenight opened this issue Aug 15, 2022 · 5 comments
Closed

golang.org/x/sys/windows: Can't compile windows app #54462

stranger-inthenight opened this issue Aug 15, 2022 · 5 comments

Comments

@stranger-inthenight
Copy link

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

$ go version
go version go1.10.8 windows/amd64

Does this issue reproduce with the latest release?

Yes, since 1.13.0

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

go env Output
$ go env
set GOARCH=amd64
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows

What did you do?

What did you expect to see?

No errors and warnings. Backward compatibility exists

What did you see instead?

../../../go/src/golang.org/x/sys/windows/syscall_windows.go:1791:11: invalid operation: 1 << pos (shift count type int, must be unsigned integer)
../../../go/src/golang.org/x/sys/windows/syscall_windows.go:1795:23: invalid operation: masked >> start (shift count type int, must be unsigned integer)

@ianlancetaylor
Copy link
Contributor

Sorry, Go 1.10 is no longer supported. You'll need to use at least Go 1.13. And you may need to set go 1.13 or later in your go.mod file.

@ianlancetaylor ianlancetaylor closed this as not planned Won't fix, can't repro, duplicate, stale Aug 15, 2022
@stranger-inthenight
Copy link
Author

ianlancetaylor But what happened with golang.org/x/sys?
A couple of months ago it worked

@seankhliao
Copy link
Member

Backwards compatibility means old code will run with newer language versions. Here you're trying to run new code with older language versions. This isn't covered by any compatibility promises.

@ianlancetaylor
Copy link
Contributor

@stranger-inthenight To put it another way, what happened is that somebody committed a change to x/sys/windows that uses a language feature that was added in Go 1.13. This is permitted as the current version of x/sys/windows is only expected to be used with currently supported versions of Go.

@stranger-inthenight
Copy link
Author

Got it! Thank you for the comments

@golang golang locked and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants