kowainik / stan

πŸ•΅οΈ Haskell STatic ANalyser
https://kowainik.github.io/projects/stan
Mozilla Public License 2.0
565 stars 48 forks source link

WIN10: commitAndReleaseBuffer: invalid argument #312

Closed tuomohopia closed 4 years ago

tuomohopia commented 4 years ago

I'm getting the following error when running the freshly compiled stan on Windows 10 Powershell:

stan.exe: <stdout>: commitAndReleaseBuffer: invalid argument (invalid character)

I simply run stan in my project's folder. stan report gives the same output. Running stan --version outputs this:

Stan v0.0.0.0
 stan.exe: <stdout>: commitBuffer: invalid argument (invalid character)

stan --help displays the help normally, however.

System:

nxths commented 4 years ago

Am seeing identical behavior in Windows 10 powershell and WSL (calling stan.exe), with GHC-8.10.1 and stack-2.3.1

vrom911 commented 4 years ago

This seems to be a systems error rather than the tool itself.

I was reading this thread, and there is a lot of useful stuff in here: https://gitlab.haskell.org/ghc/ghc/-/issues/8118 And also this one: https://techoverflow.net/2014/06/23/solving-haskell-commitandreleasebuffer-invalid-argument-invalid-character/

I will add setLocaleEncoding utf8 in Stan meanwhile, though it may or may not resolve the issue.

Btw, we have a CI check for Windows and it works and outputs everything as it should, that is why this issue was not possible to catch beforehand β€” see Dogfooding section on our CI https://github.com/kowainik/stan/runs/794528335

vrom911 commented 4 years ago

@tuomohopia @nxths I have set it to utf8. It should work for you now. Additionally, you can try to set env vars locally. All changes are in master now, and you can check it out and let us know if it helps.

nxths commented 4 years ago

@vrom911 thanks for the explanation + fix, this is working on my machine now

tuomohopia commented 4 years ago

I confirm it works now on my PC too. Just the pretty printing a bit haywire:

           Stan's Summary:
ÔâÅÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâ│ÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâô
ÔâÒ Analysed modules            ÔâÒ 2      ÔâÒ
ÔâúÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔòïÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâ½
ÔâÒ Analysed Lines of Code      ÔâÒ 141    ÔâÒ
ÔâúÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔòïÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâ½
ÔâÒ Total Haskel2010 extensions ÔâÒ 4      ÔâÒ
ÔâúÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔòïÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâ½
ÔâÒ Total SafeHaskel extensions ÔâÒ 0      ÔâÒ
ÔâúÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔòïÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâ½
ÔâÒ Total checked inspections   ÔâÒ 44     ÔâÒ
ÔâúÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔòïÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâ½
ÔâÒ Total found observations    ÔâÒ 1      ÔâÒ
ÔâúÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔòïÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâ½
ÔâÒ Total ignored observations  ÔâÒ 0      ÔâÒ
ÔâúÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔòïÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâ½
ÔâÒ Project health              ÔâÒ 97.73% ÔâÒ
ÔâùÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâ╗ÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâüÔâø