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" no longer includes the required "golang.org/x/sys/windows" on the windows operating system #63902

Closed
StephanVerbeeck opened this issue Nov 2, 2023 · 4 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@StephanVerbeeck
Copy link

StephanVerbeeck commented Nov 2, 2023

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

go version go1.21.3 windows/amd64

Does this issue reproduce with the latest release?

yes

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

windows 11

What did you do?

use windows API functions
compilation error occurs in source "advapi32.go" of module "github.com/lxn/win".

What did you expect to see?

compiles OK

What did you see instead?

compiler automatically adds an import for the package "golang.org/x/sys/windows" but DOES NOT INSTALL this package.
In earlier versions of GO this did work and packages that were specific for the windows operating system were installed correctly.
Motivation = this did work before and now doesn't work anymore (existing code that has compiled for 3 years now is not compiling anymore).

@seankhliao
Copy link
Member

please fill out the report form properly and provide a reproducer

@seankhliao seankhliao added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Nov 2, 2023
@Goclipse27
Copy link
Contributor

@StephanVerbeeck as @seankhliao mentioned Please fill out form. But when I tried high level both below commands worked.

  • go install github.com/lxn/win
  • go build or go mod tidy is good too.

@seankhliao seankhliao added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Nov 3, 2023
@StephanVerbeeck
Copy link
Author

StephanVerbeeck commented Nov 6, 2023

Wait a bit, why would you "go install" a module, install is for executables, "go get" is for modules.

Please don't ask for more information as what I have provided is sufficient to reproduce the problem and there is not added value in describing a more complex setup (my project) than is needed to reproduce the problem.

What you told generates this error

    go: 'go install' requires a version when current directory is not in a module
    Try 'go install github.com/lxn/win@latest' to install the latest version

To test whether the command is successful look for any of these (newly created as listed below) directories and see if they contain the subdirectory "golang.org\x\sys\windows". On older versions of GO this was the case but on the latest version this OS-dependent module is not installed as somehow the code that detects the OS uses for compiling "got broken".

 C:\Users\*\go\golang.org\x\sys
 C:\Users\*\go\pkg\mod\cache\download\golang.org\x\sys
 C:\Users\*\go\pkg\mod\github.com\cilium\ebpf@v0.11.0\internal\sys 
 

@seankhliao
Copy link
Member

Without more information, we don't think this is an error in go, rather how you're using it.

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2023
@golang golang locked and limited conversation to collaborators Nov 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants