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

gobin does not work at all on Windows #9

Open
tssajo opened this issue Nov 3, 2017 · 26 comments
Open

gobin does not work at all on Windows #9

tssajo opened this issue Nov 3, 2017 · 26 comments
Labels

Comments

@tssajo
Copy link

tssajo commented Nov 3, 2017

This is a very useful program! It works perfectly on Linux. But it does not work at all on Windows 7 x64 :(

Can you please fix it?

Please let me know if you need any specific info from me or if you want me to test something for you on Windows. Thanks!

@rjeczalik
Copy link
Owner

But it does not work at all on Windows 7 x64 :(

Do you have any error messages, screencasts etc. which demonstrate the problem?

@tssajo
Copy link
Author

tssajo commented Nov 3, 2017

@rjeczalik No screencast and no error messages. Here is what's happening. I go to the CMD prompt and then: CD %GOPATH%\bin
I got into the directory where gobin.exe is installed. On my PC it is: C:\gocode\bin
then I run the program: gobin and it immediately returns with no output at all. But there are a bunch of binaries in my bin directory. Please see this screenshot:

image

Here is the output of go env :

image

Please let me know what do you want me to test. Thanks!

@rjeczalik
Copy link
Owner

@tssajo Thanks, it's enough for me.

@rjeczalik rjeczalik added the bug label Nov 3, 2017
@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

Hello,
Did you manage to fix this bug?
Please let me know!
Thanks!

@rjeczalik
Copy link
Owner

@tssajo No, sorry - I was overwhelmed with other activities and in the meantime I lost access to my only windows box. Maybe you could troubleshoot this for me?

  • what does gobin C:\gocode\bin output?
  • add the following line after this line, build gobin again, run it and paste the output
fmt.Println(path, canwrite, fi.IsDir, fi.Mode().Regular(), IsExecutable(path), IsBinary(path))

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

Yes, I'll troubleshoot! That's what I wanted to offer, actually.

I add that line now and I get back to you in a few minutes.

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

hm. the quick result is:
image
But I fix this, do not worry.
I get back to you in a moment

@rjeczalik
Copy link
Owner

Typo - should be:

fmt.Println(path, canwrite, fi.IsDir, fi.Mode().IsRegular(), IsExecutable(path), IsBinary(path))

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

Yes, I just fixed that line to this:
fmt.Println(path, canwrite, fi.IsDir, fi.Mode().IsRegular(), IsExecutable(path), IsBinary(path))

It compiles now.

However, the Go 1.10 build command does not place the gobin program into my bin directory... I do not know why. I investigate...

@rjeczalik
Copy link
Owner

However, the Go 1.10 build command does not place the gobin program into my bin directory

Try go install.

@rjeczalik
Copy link
Owner

Oh, please ensure you install .\cmd\gobin - this is where main lives.

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

Well, I tried that already but nothing! :(

See:

image

So go build runs with no errors, same for go install but the binary file is nowhere to be found... :(

I've never seen this before. But maybe I am doing something wrong...

Or the freshly installed Go 1.10 just doesn't work for some reason. (I installed it less than an hour ago.)

Any ideas?

@rjeczalik
Copy link
Owner

Any ideas?

See my second comment, run go install in ...\rjeczalik\bin\cmd\gobin.

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

OK, It got installed when I ran go install from that sub-directory

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

Here is the output:

image

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

I have no idea why it is looking at my nodejs ( installed via npm ) binaries....

@rjeczalik
Copy link
Owner

It looks for every executable file in %PATH%.

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

OK

Anyhow, for all go binary files the results are:
true 0x60f4a0 true true true

as you can see

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

one thing I can think of: in Windows the directory separator is "\" while on *nix it is "/"
could this difference cause this problem?
see: https://golang.org/pkg/os/#PathSeparator

@rjeczalik
Copy link
Owner

Oh sorry, another typo - it's a middle of a night for me. Could you try this line instead:

fmt.Println(path, canwrite, fi.IsDir(), fi.Mode().IsRegular(), IsExecutable(path), IsBinary(path))

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

Sure. Results:

image

Middle of night here, too. I'm in Hungary.

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

I ran it with your suggested CLI arg, see:

image

Now it only checks that directory for binaries. But the output for those files are the same as above.

@rjeczalik
Copy link
Owner

rjeczalik commented Mar 4, 2018

Ok, so file modes are ok, most likely the thing that fails is reading import path from a binary. Could you:

  • add the line below here
fmt.Printf("which.NewExec(%q) failed: %#v\n", path, err)
  • and one here below
fmt.Printf("importpkg(%q) failed: %#v\n", p.path, err)

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

Sure. Results are:

C:\Users\User\AppData\Roaming\npm\cleancss true false true false false
C:\Users\User\AppData\Roaming\npm\cleancss.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\css-beautify true false true false false
C:\Users\User\AppData\Roaming\npm\css-beautify.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\csslint true false true false false
C:\Users\User\AppData\Roaming\npm\csslint.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\etc true true false false false
C:\Users\User\AppData\Roaming\npm\gulp true false true false false
C:\Users\User\AppData\Roaming\npm\gulp.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\html-beautify true false true false false
C:\Users\User\AppData\Roaming\npm\html-beautify.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\html-minifier true false true false false
C:\Users\User\AppData\Roaming\npm\html-minifier.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\html2jade true false true false false
C:\Users\User\AppData\Roaming\npm\html2jade.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\js-beautify true false true false false
C:\Users\User\AppData\Roaming\npm\js-beautify.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\jshint true false true false false
C:\Users\User\AppData\Roaming\npm\jshint.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\jsxhint true false true false false
C:\Users\User\AppData\Roaming\npm\jsxhint.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\minjson true false true false false
C:\Users\User\AppData\Roaming\npm\minjson.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\node-gyp true false true false false
C:\Users\User\AppData\Roaming\npm\node-gyp.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\nodemon true false true false false
C:\Users\User\AppData\Roaming\npm\nodemon.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\node_modules true true false false false
C:\Users\User\AppData\Roaming\npm\pakmanager true false true false false
C:\Users\User\AppData\Roaming\npm\pakmanager.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\svgo true false true false false
C:\Users\User\AppData\Roaming\npm\svgo.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\uglifycss true false true false false
C:\Users\User\AppData\Roaming\npm\uglifycss.cmd true false true false false
C:\Users\User\AppData\Roaming\npm\uglifyjs true false true false false
C:\Users\User\AppData\Roaming\npm\uglifyjs.cmd true false true false false
C:\gocode\bin\benchcmp.exe true false true true true
C:\gocode\bin\bundle.exe true false true true true
C:\gocode\bin\callgraph.exe true false true true true
C:\gocode\bin\compilebench.exe true false true true true
C:\gocode\bin\cover.exe true false true true true
C:\gocode\bin\digraph.exe true false true true true
C:\gocode\bin\eg.exe true false true true true
C:\gocode\bin\fiximports.exe true false true true true
C:\gocode\bin\getgo.exe true false true true true
C:\gocode\bin\go-contrib-init.exe true false true true true
C:\gocode\bin\gobin.exe true false true true true
C:\gocode\bin\gocode.exe true false true true true
C:\gocode\bin\godef.exe true false true true true
which.NewExec("C:\\gocode\\bin\\benchcmp.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\benchcmp.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\godex.exe true false true true true
C:\gocode\bin\godoc.exe true false true true true
C:\gocode\bin\goimports.exe true false true true true
C:\gocode\bin\golint.exe true false true true true
C:\gocode\bin\gomvpkg.exe true false true true true
which.NewExec("C:\\gocode\\bin\\compilebench.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\compilebench.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\bundle.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\bundle.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\digraph.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\digraph.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\gorename.exe true false true true true
which.NewExec("C:\\gocode\\bin\\fiximports.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\fiximports.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\gotype.exe true false true true true
which.NewExec("C:\\gocode\\bin\\callgraph.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\callgraph.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\gobin.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\gobin.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\go-contrib-init.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\go-contrib-init.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\goyacc.exe true false true true true
which.NewExec("C:\\gocode\\bin\\eg.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\eg.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\guru.exe true false true true true
which.NewExec("C:\\gocode\\bin\\cover.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\cover.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\gocode.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\gocode.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\heapview.exe true false true true true
which.NewExec("C:\\gocode\\bin\\godex.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\godex.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\golint.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\golint.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\getgo.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\getgo.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\html2article.exe true false true true true
which.NewExec("C:\\gocode\\bin\\goimports.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\goimports.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\gorename.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\gorename.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\present.exe true false true true true
which.NewExec("C:\\gocode\\bin\\godef.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\godef.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\ssadump.exe true false true true true
which.NewExec("C:\\gocode\\bin\\gomvpkg.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\gomvpkg.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\html2article.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\html2article.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\goyacc.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\goyacc.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\stress.exe true false true true true
C:\gocode\bin\stringer.exe true false true true true
which.NewExec("C:\\gocode\\bin\\godoc.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\godoc.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\tip.exe true false true true true
which.NewExec("C:\\gocode\\bin\\heapview.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\heapview.exe") failed: &errors.errorString{s:"which: not a Go executable"}
C:\gocode\bin\toolstash.exe true false true true true
C:\gocode\bin\_err.txt true false true false false
which.NewExec("C:\\gocode\\bin\\gotype.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\gotype.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\guru.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\guru.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\stress.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\stress.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\present.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\present.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\toolstash.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\toolstash.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\ssadump.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\ssadump.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\stringer.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\stringer.exe") failed: &errors.errorString{s:"which: not a Go executable"}
which.NewExec("C:\\gocode\\bin\\tip.exe") failed: &errors.errorString{s:"which: not a Go executable"}
importpkg("C:\\gocode\\bin\\tip.exe") failed: &errors.errorString{s:"which: not a Go executable"}

@rjeczalik
Copy link
Owner

That is what I was afraid of, something here fails, and that would not be easy to debug remotely.

You could give it a shot, if you want, just log all the errors there and see what we may get. My hunch is something in debug/pe package changed which is not backward-compatible, and this is why it fails.

@tssajo
Copy link
Author

tssajo commented Mar 4, 2018

OK, I will check it out. But only tomorrow, not tonight.

I'll report you back what I've found.

If I manage to fix it, I'll submit a PR.

Thanks for trying to help tonight!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants