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

Cant install on windows #626

Closed
StarpTech opened this issue Aug 18, 2017 · 8 comments
Closed

Cant install on windows #626

StarpTech opened this issue Aug 18, 2017 · 8 comments

Comments

@StarpTech
Copy link

go get github.com/sirupsen/logrus
# golang.org/x/crypto/ssh/terminal
..\..\..\golang.org\x\crypto\ssh\terminal\util_windows.go:42: undefined: windows.ENABLE_ECHO_INPUT
..\..\..\golang.org\x\crypto\ssh\terminal\util_windows.go:42: undefined: windows.ENABLE_PROCESSED_INPUT
..\..\..\golang.org\x\crypto\ssh\terminal\util_windows.go:42: undefined: windows.ENABLE_LINE_INPUT
..\..\..\golang.org\x\crypto\ssh\terminal\util_windows.go:42: undefined: windows.ENABLE_PROCESSED_OUTPUT
..\..\..\golang.org\x\crypto\ssh\terminal\util_windows.go:43: undefined: windows.SetConsoleMode
..\..\..\golang.org\x\crypto\ssh\terminal\util_windows.go:62: undefined: windows.SetConsoleMode
..\..\..\golang.org\x\crypto\ssh\terminal\util_windows.go:67: undefined: windows.ConsoleScreenBufferInfo
..\..\..\golang.org\x\crypto\ssh\terminal\util_windows.go:68: undefined: windows.GetConsoleScreenBufferInfo
..\..\..\golang.org\x\crypto\ssh\terminal\util_windows.go:91: undefined: windows.ENABLE_ECHO_INPUT
..\..\..\golang.org\x\crypto\ssh\terminal\util_windows.go:92: undefined: windows.ENABLE_PROCESSED_INPUT
..\..\..\golang.org\x\crypto\ssh\terminal\util_windows.go:92: too many errors
@dmathieu
Copy link
Contributor

Do you have an old version of x/crypto/ssh/terminal? Could you try updating it?

@sudo-suhas
Copy link

I also faced this issue after updating to logrus v1.0.3. I am also able to reproduce the issue in a fresh project:

glide.yaml:

package: playground
import:
- package: github.com/Sirupsen/logrus
  version: ^1.0.3

glide.lock:

hash: 63379b39e56eb058f5db6ba5e8a6fdba655701f90c3f11e6b7651d089cf31556
updated: 2017-08-21T15:35:36.2560978+05:30
imports:
- name: github.com/Sirupsen/logrus
  version: f006c2ac4710855cf0f916dd6b77acf6b048dc6e
- name: golang.org/x/crypto
  version: eb71ad9bd329b5ac0fd0148dd99bd62e8be8e035
  subpackages:
  - ssh/terminal
- name: golang.org/x/sys
  version: c4489faa6e5ab84c0ef40d6ee878f7a030281f0f
  subpackages:
  - unix
  - windows
testImports: []

main.go:

package main

import log "github.com/Sirupsen/logrus"

func main() {
	log.WithFields(log.Fields{
		"animal": "walrus",
	}).Info("A walrus appears")
}

Error:

$ go build .
# playground/vendor/golang.org/x/crypto/ssh/terminal
vendor\golang.org\x\crypto\ssh\terminal\util_windows.go:42: undefined: windows.ENABLE_ECHO_INPUT
vendor\golang.org\x\crypto\ssh\terminal\util_windows.go:42: undefined: windows.ENABLE_PROCESSED_INPUT
vendor\golang.org\x\crypto\ssh\terminal\util_windows.go:42: undefined: windows.ENABLE_LINE_INPUT
vendor\golang.org\x\crypto\ssh\terminal\util_windows.go:42: undefined: windows.ENABLE_PROCESSED_OUTPUT
vendor\golang.org\x\crypto\ssh\terminal\util_windows.go:43: undefined: windows.SetConsoleMode
vendor\golang.org\x\crypto\ssh\terminal\util_windows.go:62: undefined: windows.SetConsoleMode
vendor\golang.org\x\crypto\ssh\terminal\util_windows.go:67: undefined: windows.ConsoleScreenBufferInfo
vendor\golang.org\x\crypto\ssh\terminal\util_windows.go:68: undefined: windows.GetConsoleScreenBufferInfo
vendor\golang.org\x\crypto\ssh\terminal\util_windows.go:91: undefined: windows.ENABLE_ECHO_INPUT
vendor\golang.org\x\crypto\ssh\terminal\util_windows.go:92: undefined: windows.ENABLE_PROCESSED_INPUT
vendor\golang.org\x\crypto\ssh\terminal\util_windows.go:92: too many errors

@dmathieu
Copy link
Contributor

Again (especially since you can't reproduce this on a new project), does the project you're updating has the latest crypto library?

@sudo-suhas
Copy link

sudo-suhas commented Aug 21, 2017

@dmathieu This is in a completely new project. Additionally, from the glide.lock file, you can see that the version for crypto library is eb71ad9bd329b5ac0fd0148dd99bd62e8be8e035 which is the latest. I apologise for wrongly assuming that you would be familiar with glide. All I have done in the project is glide init and glide up. The contents of the main.go included is above is the only source code present in the project.

@dmathieu
Copy link
Contributor

Looking further into this, it appears to be error only within the terminal package, when calling the windows one.
Do you have the latest version of that package? What version of Go are you using?

Are you able to use that terminal package outside of logrus?
Sorry for all the questions. But I don't have any windows system available, and therefore cannot test this myself.

@sudo-suhas
Copy link

No problem and no need to apologise 😄. Turns out I did not have the latest version for package golang.org/x/sys/windows. The version that glide installed automatically for me was c4489faa6e5ab84c0ef40d6ee878f7a030281f0f. Not entirely sure why glide installed this particular version. However, there has been activity in the package after the issue was reported here. Now if I do a fresh install for logrus, the latest version is fetched which fixes the build/run errors. Furthermore, I can also fix the issue by manually updating the lock file to the latest version(07c182904dbd53199946ba614a412c61d3c548f5).

Just for completeness,

λ go version
go version go1.8.3 windows/amd64

If @StarpTech can confirm the same, the issue can be closed.

@StarpTech
Copy link
Author

It also fixed it. Thanks all.

@dmathieu
Copy link
Contributor

🎉

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

No branches or pull requests

3 participants