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

Get working on Windows #1

Closed
bradrn opened this issue Apr 1, 2019 · 19 comments
Closed

Get working on Windows #1

bradrn opened this issue Apr 1, 2019 · 19 comments

Comments

@bradrn
Copy link
Contributor

bradrn commented Apr 1, 2019

Is there any way to get this working on Windows? Here's what I've tried so far:

  1. The first problem is the unix dependency, which oddly enough doesn't actually seem to be used anywhere. After removing it I was able to build reanimate fine.
  2. After building I tried to run the provided latex_color.hs example, but got the following output (with other actions I did in [indented square brackets]):
> stack .\latex_color.hs
Failed to open browser. Manually visit: C:\Users\bradn\Documents\Haskell\reanimate\.stack-work\install\b7328101\share\x86_64-windows-ghc-8.2.2\reanimate-0.1.4.1\viewer/build/index.html
  [Here I manually visited the given location]
Server pending.
Found self. Listening.
Kill and respawn.
  [Here I refreshed the page on my web browser]
Server pending.
latex_color.hs: CloseRequest 1001 ""
Found self. Listening.
Kill and respawn.
latex_color.hs: DeleteFile "C:\\Users\\bradn\\AppData\\Local\\Temp\\reanimate-XXXXXX35312-1.exe": permission denied (Access is denied.)
latex_color.hs: C:\Users\bradn\AppData\Local\Temp\reanimate-XXXXXX35312-2.exe: runInteractiveProcess: invalid argument (Exec format error)
  1. After the permission denied error above, I tried running as an administator, and got the following output instead:
> stack .\latex_color.hs
Failed to open browser. Manually visit: C:\Users\bradn\Documents\Haskell\reanimate\.stack-work\install\b7328101\share\x86_64-windows-ghc-8.2.2\reanimate-0.1.4.1\viewer/build/index.html
Server pending.
Found self. Listening.
Kill and respawn.
  [Here I manually visited the given location]
Server pending.
Found self. Listening.
Kill and respawn.
latex_color.hs: C:\Users\bradn\AppData\Local\Temp\reanimate-XXXXXX30972-2.exe: runInteractiveProcess: invalid argument (Exec format error)
@bradrn
Copy link
Contributor Author

bradrn commented Apr 1, 2019

Actually, it seems that I was a bit hasty in my last try. It turns out that if you wait a bit longer and ignore the errors, the Playground works just fine, including the live code update. There's still lots of errors though; it would be nice to get rid of them. There's also still the problem of the unix dependency which prevents Windows compilation; is there any reason why that cannot be removed?

@bradrn
Copy link
Contributor Author

bradrn commented Apr 2, 2019

Well, I've done a bit of digging, and it looks like most of the 'errors' above were just normal messages which I misinterpreted as errors. (Suggestion: rephrase these messages to make this more obvious so other people don't make that same mistake.) However, there are some genuine problems on Windows:

  • Unused unix dependency prevents Windows compilation. Fix: remove dependency, since it doesn't appear to be doing anything.
  • Browser isn't opening on Windows. Fix: use the open-browser package, or add "start" (the Windows command) to Reanimate.Driver.openBrowser.
  • Weird errors with DeleteFile and runInteractiveProcess (see above for exact error messages). Fix: I'm really not sure, actually. I think it's a problem with a dependency (possibly fsnotify), not with reanimate itself.

@bradrn
Copy link
Contributor Author

bradrn commented May 13, 2019

Since #2 has been merged the HEAD of reanimate now compiles and works on Windows. However, the weird file errors are still there, so I won't close this issue just yet.

@lemmih
Copy link
Member

lemmih commented Jul 8, 2019

Do you know why the errors happen? Is it something we can test for?

@lemmih
Copy link
Member

lemmih commented Jul 8, 2019

For me, it happens when I reload the browser window but not when changes are detected via fsnotify. No idea why this is so, though.

@lemmih
Copy link
Member

lemmih commented Sep 11, 2019

Hi @bradrn. I've fixed a few race conditions in the driver and now everything works smoothly for me on Windows. If it also works for you then I'd like to close this issue.

@bradrn
Copy link
Contributor Author

bradrn commented Sep 11, 2019

Hi @lemmih, thanks so much for fixing this! Unfortunately I don’t have enough time just right now to test it, but in a few hours when I get home I will definitely try it out.

@lemmih
Copy link
Member

lemmih commented Sep 11, 2019

Sigh, I spoke too early. I still see the same errors.

@lemmih
Copy link
Member

lemmih commented Sep 12, 2019

Ok, now I've fixed the last issues (I think). Everything works as well on Windows as it does on Linux for me. Code reloads, refreshing the browser, latex output, etc.

@bradrn
Copy link
Contributor Author

bradrn commented Sep 12, 2019

Ok, now I've fixed the last issues (I think). Everything works as well on Windows as it does on Linux for me. Code reloads, refreshing the browser, latex output, etc.

Sounds good @lemmih! I finally have enough time to test this (it’s compiling as I write), so will inform you if it works for me.

Out of curiosity, in which commits did you fix the issue?

@lemmih
Copy link
Member

lemmih commented Sep 12, 2019

2298fca#diff-3aca47243ba1ee857817d88ba75931b2L48

Reusing the same temporary directory for compilations messed things up for some reason. Using a separate directory for each compilation fixed the errors for me.

@bradrn
Copy link
Contributor Author

bradrn commented Sep 12, 2019

That’s odd. Do you have any idea why reusing the same directory would have caused those issues?

@lemmih
Copy link
Member

lemmih commented Sep 12, 2019

Nope, it wasn't a problem on Linux or Mac. And it's particularly weird that GHC would create an empty binary but not give any error message or error return value.

@bradrn
Copy link
Contributor Author

bradrn commented Sep 12, 2019

I’ve just tried the latest version and can confirm that the DeleteFile and runInteractiveProcess errors are gone! However, I still get terminateProcess: permission denied (Permission denied) errors, even when I run as administrator.

@lemmih
Copy link
Member

lemmih commented Sep 12, 2019

That last error is harmless. I think it happens because it tries to terminate a process which has already been terminated.

@bradrn
Copy link
Contributor Author

bradrn commented Sep 12, 2019

That last error is harmless.

I know, but it’s not too good an impression if you’re trying out this library for the first time…

I think it happens because it tries to terminate a process which has already been terminated.

It’s possible. I think it happens when I close a tab, but I will have to investigate more before saying anything definitively.

@bradrn
Copy link
Contributor Author

bradrn commented Sep 12, 2019

Well, I can’t reproduce that error again. I still have no idea what caused it.

@lemmih
Copy link
Member

lemmih commented May 13, 2020

Everything looks to be solved. Closing issue.

@lemmih lemmih closed this as completed May 13, 2020
@bradrn
Copy link
Contributor Author

bradrn commented May 14, 2020

That’s fine @lemmih.

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