Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

stack overrides the mintty-0.1.3 default requirement for Win32-2.13.1, causing build errors #117

Closed
mpilgrem opened this issue Nov 19, 2021 · 3 comments
Labels
Windows Relates to Windows operating system

Comments

@mpilgrem
Copy link
Collaborator

mpilgrem commented Nov 19, 2021

On Windows, ansi-terminal depends on package mintty to detect MinTTY terminals. The current version of mintty (version 0.1.3), by default, depends on Win32-2.13.1 or greater (mintty flag Win32-2-13-1 is set by default).

Win32 is one of the libraries that ships with GHC. GHC 8.10.7 ships with Win32-2.6.2.1 and GHC 9.0.1 ships with Win32-2.10.0.0.

On Stackage, snapshots lts-18.17 (GHC 8.10.7) and nightly-2021-11-15 (GHC 9.0.1) include versions of Win32 before version 2.13.1. The stack tool assumes that it is the snapshot version that is required and the .cabal file is mistaken, reporting:

WARNING: Ignoring mintty's bounds on Win32 (>=2.13.1); using Win32-2.6.2.1.
Reason: trusting snapshot over cabal file dependency information.

Ignoring mintty's bounds on Win32 causes stack build to fail with errors like:

mintty       > [1 of 1] Compiling System.Console.MinTTY
mintty       >
mintty       > src\System\Console\MinTTY.hs:31:1: error:
mintty       >     Could not find module `System.Console.MinTTY.Win32'
mintty       >     Use -v (or `:set -v` in ghci) to see a list of the files searched for.
mintty       >    |
mintty       > 31 | import qualified System.Console.MinTTY.Win32 as Win32 (isMinTTY, isMinTTYHandle)
mintty       >    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
mintty       >

The alternative solutions are:

  1. Specify a version of Win32 that is 2.13.1 or greater as an extra-dep in the relevant stack.yaml. This causes stack to assume that the cabal file dependency is to be trusted.
  2. Specify a version of mintty before 0.1.3 in the relevant .cabal file. However, mintty-0.1.3 was released to fix a bug that would make isMinTTY incorrectly return False on recent versions of MinTTY. Specifiyng mintty < 0.1.3 will prompt stack to suggest an extra-dep.
  3. Unset the mintty flag Win32-2-13-1. This will cause mintty to depend on versions of Win32 before 2.13.1.

See also discussion in #114.

@mpilgrem mpilgrem added the Windows Relates to Windows operating system label Nov 19, 2021
@UnkindPartition
Copy link
Owner

Here are the related upstream issues:

RyanGlScott/mintty#4
commercialhaskell/stackage#6304

So I would expect it to work on nightly-2021-11-19; are you saying it doesn't?

@mpilgrem
Copy link
Collaborator Author

My mistake - I meant to refer to nightly-2021-11-15 (not -19) (now corrected). I see that this is now fixed in nightly-2021-11-19.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Windows Relates to Windows operating system
Projects
None yet
Development

No branches or pull requests

3 participants