Closed g-pechorin closed 1 year ago
This seems to be an HGL problem. Maybe @xpika knows the answer to this one?
The problem seems to be in a different package, not SpaceInvaders. That's why I mentioned someone else.
A workaround, which is not really a solution, could be:
Extract HGL in a directory with:
$ cabal unpack HGL
$ cd HLG-*/
Modify those files to convert between number types. Most likely, it'll be enough if you add fromIntegral
before x
and y
in those expressions (as in (fromIntegral x, fromIntegral y)
).
Finally, go to where you were before (presumably, cd ..
) and do:
$ cabal install HGL-*/
EDIT: Missing last part of the instructions.
That fixes some errors, but, I'm left with another error from HGL
Module `Control.Concurrent.Chan' does not export `isEmptyChan'
Aha. The function isEmptyChan
was deprecated many moons ago (in base 4.5, which accompanied GHC 7.4, released in 2012) and finally eliminated in this year (in base 4.11, with GHC 8.4, released in 2018).
I two non-exclusive ways to move forward:
a) Change the cabal file and indicate an incompatibility with base 4.11 and higher.
b) Change the implementation to use the solution recommended in [1].
Would you (or anybody) want to help with this?
[1] http://hackage.haskell.org/package/base-4.10.1.0/docs/Control-Concurrent-Chan.html
(These would be changes in HGL, not SpaceInvaders.)
I setup a stack build and got it to build on Windows with specific versions of the dependencies.
Now it crashes on launch complaining that a window was destroyed in a different thread from the one that it was created in.
I don't immediately find anything in SpaceInvaders that uses threads, so I don't know where that can come from. But I don't use Windows or stack, so I don't know what may be going on over there.
You can try to modify the cabal file and eliminate the threaded option to compile with the non-threaded RTS. I'm not sure if this can make a difference (meaning I'm not sure if Haskell's light threads can be causing this specific problem), but it's worth the try.
See: https://github.com/ivanperez-keera/SpaceInvaders/blob/develop/SpaceInvaders.cabal#L19
It's been 5 years. I don't have a windows machine available, and I don't think the Haskell Platform is being advertised as the way to install haskell anymore, so I'm going to close this.
If this is still a problem, please re-open. Thanks!
This is HGL's issue. I have fixed it via the repository https://github.com/chansey97/HGL.
Neither the "master" or "development" branch build. Both seem to fail with a chorus of errors such as;
Can you advise on how to fix this?