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/exp/shiny/driver/windriver: zsyscall_windows.go generation is broken #14254

Closed
alexbrainman opened this issue Feb 8, 2016 · 2 comments
Closed

Comments

@alexbrainman
Copy link
Member

Steps to reproduce the problem

# pwd                                                                   
/root/src/golang.org/x/exp/shiny/driver/windriver                                     
# git diff                                                              
# GOOS=windows go install                                               
# GOOS=windows go generate                                              
# git diff                                                              
diff --git a/shiny/driver/windriver/zsyscall_windows.go b/shiny/driver/windriver/zsyscall_windows.go
index 7a70f4f..2b2aa95 100644
--- a/shiny/driver/windriver/zsyscall_windows.go
+++ b/shiny/driver/windriver/zsyscall_windows.go
@@ -4,7 +4,6 @@ package windriver

 import "unsafe"
 import "syscall"
-import "golang.org/x/exp/shiny/driver/internal/win32"

 var _ unsafe.Pointer

# GOOS=windows go install                                               
# golang.org/x/exp/shiny/driver/windriver                                             
./zsyscall_windows.go:39: undefined: win32 in win32.HDC                               
./zsyscall_windows.go:41: undefined: win32                                            
./zsyscall_windows.go:52: undefined: win32 in win32.HDC                               
./zsyscall_windows.go:64: undefined: win32 in win32.HDC                               
./zsyscall_windows.go:77: undefined: win32 in win32.HDC                               
./zsyscall_windows.go:89: undefined: win32 in win32.HDC                               
./zsyscall_windows.go:115: undefined: win32 in win32.HDC                              
./zsyscall_windows.go:41: too many errors                                             
#                                                                       

This issue was introduced in CL 17676. @crawshaw must have changed zsyscall_windows.go by hand, and I didn't reilized that during review.

We can just change all win32.HDC in zsyscall_windows.go (and, probably, in exp/shiny/driver/internal/win32/zsyscall_windows.go) into syscall.Handle.

Alternatively we can teach $GOROOT/src/syscall/mksyscall_windows.go to include 'import "golang.org/x/exp/shiny/driver/internal/win32"'. But that means some sort of new convention here. mksyscall_windows.go would have to be able to resolve win32 into golang.org/x/exp/shiny/driver/internal/win32. Maybe it can deduce this by looking at imports in syscall_windows.go. But current syscall_windows.go does not import golang.org/x/exp/shiny/driver/internal/win32, so we would have to change that. I am not convinced it is a good approach.

Maybe do something different.

What do you think, David?

/cc @crawshaw for comments

Alex

@crawshaw
Copy link
Member

crawshaw commented Feb 9, 2016

Sorry, I recall thinking I should resolve this before sending out the win32 CLs, but then it slipped my mind.

While I think it's a bit sad to lose the HDC type, I'm not up for any further changes to mksyscall_windows.go, and maintaining a fork sounds not fun at all. So reverting to syscall.Handle is fine by me as the least bad option..

@gopherbot
Copy link

CL https://golang.org/cl/20186 mentions this issue.

@golang golang locked and limited conversation to collaborators Mar 13, 2017
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

3 participants