jtdaugherty / vty

A high-level ncurses alternative written in Haskell
BSD 3-Clause "New" or "Revised" License
319 stars 57 forks source link

Fails to build with GHC-9.2.8 on windows #271

Closed hasufell closed 7 months ago

hasufell commented 7 months ago
Failed to build vty-6.0.
Build log (
C:\cabal\logs\ghc-9.2.8\vty-6.0-c9d29843e440fbb3ee329f6ea71598a3854ca906.log
):
Preprocessing library for vty-6.0..
Building library for vty-6.0..
[ 1 of 24] Compiling Graphics.Text.Width ( src\Graphics\Text\Width.hs, dist\build\Graphics\Text\Width.o )
[ 2 of 24] Compiling Graphics.Vty.Attributes.Color240 ( src\Graphics\Vty\Attributes\Color240.hs, dist\build\Graphics\Vty\Attributes\Color240.o )
[ 3 of 24] Compiling Graphics.Vty.Attributes.Color ( src\Graphics\Vty\Attributes\Color.hs, dist\build\Graphics\Vty\Attributes\Color.o )
[ 4 of 24] Compiling Graphics.Vty.Attributes ( src\Graphics\Vty\Attributes.hs, dist\build\Graphics\Vty\Attributes.o )
[ 5 of 24] Compiling Graphics.Vty.DisplayAttributes ( src\Graphics\Vty\DisplayAttributes.hs, dist\build\Graphics\Vty\DisplayAttributes.o )
[ 6 of 24] Compiling Graphics.Vty.Error ( src\Graphics\Vty\Error.hs, dist\build\Graphics\Vty\Error.o )
[ 7 of 24] Compiling Graphics.Vty.Image.Internal ( src\Graphics\Vty\Image\Internal.hs, dist\build\Graphics\Vty\Image\Internal.o )
[ 8 of 24] Compiling Graphics.Vty.Image ( src\Graphics\Vty\Image.hs, dist\build\Graphics\Vty\Image.o )
[ 9 of 24] Compiling Graphics.Vty.Input.Events ( src\Graphics\Vty\Input\Events.hs, dist\build\Graphics\Vty\Input\Events.o )
[10 of 24] Compiling Graphics.Vty.Input ( src\Graphics\Vty\Input.hs, dist\build\Graphics\Vty\Input.o )
[11 of 24] Compiling Graphics.Vty.Config ( src\Graphics\Vty\Config.hs, dist\build\Graphics\Vty\Config.o )
[12 of 24] Compiling Graphics.Vty.Picture ( src\Graphics\Vty\Picture.hs, dist\build\Graphics\Vty\Picture.o )
[13 of 24] Compiling Graphics.Vty.Span ( src\Graphics\Vty\Span.hs, dist\build\Graphics\Vty\Span.o )
[14 of 24] Compiling Graphics.Vty.PictureToSpans ( src\Graphics\Vty\PictureToSpans.hs, dist\build\Graphics\Vty\PictureToSpans.o )
ghc-9.2.8.exe: panic! (the 'impossible' happened)
  (GHC version 9.2.8:
        loadArchive "C:\\ghcup\\ghc\\9.2.8\\mingw\\lib\\gcc\\x86_64-w64-mingw32\\10.2.0\\libstdc++.dll.a": failed

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

ghc-9.2.8.exe: Could not load `libstdc++-6.dll'. Reason: addDLL: libstdc++-6.dll or dependencies not loaded. (Win32 error 126)

Error: cabal-3.10.2.1.exe: Failed to build vty-6.0 (which is required by
exe:ghcup from ghcup-0.1.20.0). See the build log above for details.        

Maybe related: https://gitlab.haskell.org/ghc/ghc/-/issues/21435

Since GHC-9.4.x is even more busted on windows, it's not an option for me to upgrade.

Bodigrim commented 7 months ago

@hasufell is your build by chance forcing text>2.0? I don't see any other C++ dependencies in vty's dependency tree.

hasufell commented 7 months ago

It's very likely this is yet another text instance.

Bodigrim commented 7 months ago

Yeah, GHC 9.2 does not cope with text>=2 + TemplateHaskell on Windows (which is what's happening in Graphics.Vty.PictureToSpans). Just text works fine, that's why I'm reluctant to prohibit building it with GHC<9.4 altogether.

hasufell commented 7 months ago

Well, I don't know what to do.

Bodigrim commented 7 months ago

A tactical solution would be to derive lens manually, so that TemplateHaskell is not enabled. Graphics.Vty.PictureToSpans is the only module depending on TH and there are only two makeLenses, which would not take long to rewrite.

Dunno how @jtdaugherty feels about it though.

jtdaugherty commented 7 months ago

Happy to work around this. I just pushed https://github.com/jtdaugherty/vty/commit/72ce9f6ae5ea4f47efb4d3da57d8ee72a8035c91 to get away from the TH dependency in that module. I've just uploaded 6.2 to Hackage which includes this fix.