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

Not working on Windows (MingW) #3

Open
Revertron opened this issue Jul 10, 2021 · 10 comments
Open

Not working on Windows (MingW) #3

Revertron opened this issue Jul 10, 2021 · 10 comments

Comments

@Revertron
Copy link

Describe the bug
It starts without -password, and seems to work, but I can't send messages from Thunderbird, as yggmail doesn't want connections without password.
If I try to run yggmail with -password, I get this:

[  Yggmail  ] Using database file "yggmail.db"
[  Yggmail  ] Generated new server identity
[  Yggmail  ] Mail address: 8fedf643a96bb837b36e796bf21924bd33cd27021b6092186ccecde320e8c9f9@yggmail
[  Yggmail  ] Please enter your new password:
panic: The handle is invalid.

goroutine 1 [running]:
main.main()
        C:/msys64/home/Revertron/go/pkg/mod/github.com/neilalexander/yggmail@v0.0.0-20210709230215-4c07013a1397/cmd/yggmail/main.go:91 +0x1255

To Reproduce
Steps to reproduce the behavior:

  1. Make go install github.com/neilalexander/yggmail/cmd/yggmail@latest in MingW64.
  2. Run go/bin/yggmail.exe -peer <some peer> -password.
  3. See the error.

Expected behavior
It should get password from stdin.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Win10, MingW64 (latest)
  • Version: 20210709230215
@neilalexander
Copy link
Owner

neilalexander commented Jul 10, 2021

Should hopefully be fixed in 63de5e8, can you please give the latest main commit a try?

@Revertron
Copy link
Author

Am I doing something wrong?

$ go install github.com/neilalexander/yggmail/cmd/yggmail@63de5e81e477ba08734b7cf02b8b278e45f0c19c
go: downloading github.com/neilalexander/yggmail v0.0.0-20210710104255-63de5e81e477
# github.com/neilalexander/yggmail/cmd/yggmail
go\pkg\mod\github.com\neilalexander\yggmail@v0.0.0-20210710104255-63de5e81e477\cmd\yggmail\main.go:89:38: cannot use syscall.Stdin (type syscall.Handle) as type int in argument to term.ReadPassword
go\pkg\mod\github.com\neilalexander\yggmail@v0.0.0-20210710104255-63de5e81e477\cmd\yggmail\main.go:95:38: cannot use syscall.Stdin (type syscall.Handle) as type int in argument to term.ReadPassword

@neilalexander
Copy link
Owner

Which version of Go are you using?

@neilalexander
Copy link
Owner

Give 90b02ba a try — this might fix it.

@Revertron
Copy link
Author

Which version of Go are you using?

go 1.16

@Revertron
Copy link
Author

Give 90b02ba a try — this might fix it.

[  Yggmail  ] Using database file "yggmail.db"
[  Yggmail  ] Mail address: 8fedf643a96bb837b36e796bf21924bd33cd27021b6092186ccecde320e8c9f9@yggmail
[  Yggmail  ] Please enter your new password:
panic: The handle is invalid.

goroutine 1 [running]:
main.main()
        C:/msys64/home/Revertron/go/pkg/mod/github.com/neilalexander/yggmail@v0.0.0-20210710105511-90b02ba0d636/cmd/yggmail/main.go:90 +0x1435

@neilalexander
Copy link
Owner

Can you try this not under mingw?

@Revertron
Copy link
Author

Can you try this not under mingw?

There is no gcc for Windows without MingW:

go: downloading github.com/neilalexander/yggmail v0.0.0-20210710105511-90b02ba0d636
# github.com/mattn/go-sqlite3
cgo: exec gcc: exec: "gcc": executable file not found in %PATH%

@neilalexander
Copy link
Owner

I mean try running it under a regular Command Prompt or PowerShell after building the .exe. I’m wondering if there’s something special about the mingw terminal.

@Revertron
Copy link
Author

Aha, that works. But escape symbols for coloring do not work. Isn't there a better logging library in Go to handle different terminals?
image

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

2 participants