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

Consider implication of MSYS2 64-bit environments other than MINGW64 #6457

Closed
mpilgrem opened this issue Jan 22, 2024 · 1 comment
Closed

Comments

@mpilgrem
Copy link
Member

Motivation: haskell/ghcup-hs#982

Context: https://www.msys2.org/docs/environments/

Code: Stack.Setup.setupEnv (extract):

  envRef <- liftIO $ newIORef Map.empty
  let getProcessContext' es = do
        m <- readIORef envRef
        case Map.lookup es m of
          Just eo -> pure eo
          Nothing -> do
            eo <- mkProcessContext
              ...

              $ case (sopts.skipMsys, platform) of
                  (False, Platform Cabal.I386   Cabal.Windows) ->
                    Map.insert "MSYSTEM" "MINGW32"
                  (False, Platform Cabal.X86_64 Cabal.Windows) ->
                    Map.insert "MSYSTEM" "MINGW64"
                  _ -> id
@mpilgrem
Copy link
Member Author

The configuration of Stack's MSYS2 environment is implemented in version stack upgrade --source-only --git --git-branch fix6457 (#6465). The pull request includes documentation and also a new integration test. The latter sets the environment to UCRT64, uses pacman to get the UCRT64 version of gsl (mingw-w64-ucrt-x86_64-gsl), and builds an executable that depends on the Bessel function of the first kind.

It has also been tested (on 64-bit Windows) with:

  • no msys-environment - uses MINGW64
  • msys-environment: duff - yields a parse error
  • msys-environment: MINGW32 - yields an error that the environment is inconsistent with the architecture
  • msys-environment: UCRT64 - works as intended (stack path, stack config env)

Interestingly, the test seems to work also with snapshots specifying GHC < 9.6. It had been suggested that GHC < 9.6 might need a MINGW64 Stack MSYS2 environment.

mpilgrem added a commit that referenced this issue Feb 11, 2024
Fix #6457 Allow MSYS2 environment to be configured
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

1 participant