nkanaev / yarr

yet another rss reader
MIT License
3.02k stars 225 forks source link

Issues on Windows #80

Closed dufferzafar closed 3 years ago

dufferzafar commented 3 years ago

I've been using yarr on Windows and am facing few problems:

  1. There is no logging on stdout. I ran yarr.exe from command line and saw no logs. Running yarr.exe -h / --help prints nothing either.

  2. I'm unable to bind on any other host/port. When I run yarr.exe -addr 127.0.0.1:7080, the process starts and exits in a moment. Again, there are no logs so I can't see what happened.

  3. Once 2 works, I would like to bind to 0.0.0.0:7070 so I can access yarr from other devices on LAN. That will work, right?

dufferzafar commented 3 years ago

I actually setup a Go dev environment on Windows and tried to figure out what is happening.

  1. First things first, loglines are definitely visible when running via go run (full command : go run -tags "sqlite_foreign_keys" src/main.go -db local.db) and cli usage is visible as well (go run -tags "sqlite_foreign_keys" src/main.go -h)

  2. Running with -addr 127.0.0.1:7080 also works correctly. (full command: go run -tags "sqlite_foreign_keys" src/main.go -db local.db -addr 127.0.0.1:7080)

  3. Running with -addr 0.0.0.0:7070 works as well!

❯ go run -tags "sqlite_foreign_keys" src/main.go -db local.db -addr 0.0.0.0:7070

2021/11/06 18:45:16 main.go:86: using db file local.db
2021/11/06 18:45:16 main.go:133: starting server at http://0.0.0.0:7070
  1. So I built an exe for Windows from source and found that there's not output in released binaries: -h doesn't work, no logs are visible etc.
dufferzafar commented 3 years ago

Apparently, no output with windowsgui is a known issue: https://stackoverflow.com/a/23744350

nkanaev commented 3 years ago

thanks for the report.

the solution you've provided works only for Windows (and breaks it for other architectures). I'll try to incorporate the solution from https://github.com/apenwarr/fixconsole.

nkanaev commented 3 years ago

fixed & tested on master branch