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

--no-install-ghc also blocks install MSYS2 when necessary #6675

Closed
andreasabel opened this issue Jan 7, 2025 · 3 comments
Closed

--no-install-ghc also blocks install MSYS2 when necessary #6675

andreasabel opened this issue Jan 7, 2025 · 3 comments

Comments

@andreasabel
Copy link

Seems like --no-install-ghc stops stack also from installing MSYS2.

Observed in a CI run: https://github.com/haskell-hvr/brotli/actions/runs/12653647868/job/35259576693?pr=13#step:4:11

stack exec --stack-yaml=stack-9.10.yaml --no-terminal --no-install-ghc --system-ghc -- pacman --noconfirm -Sy msys2-keyring
Warning: Stack is not using a Stack-supplied MSYS2.
Executable named pacman not found on path: ...

The docs instead say that it only affects the instalation [sic!] of GHC:

## `--[no-]install-ghc` flag
Default: Enabled
Enables/disables the download and instalation of GHC if necessary. For further
information, see the documentation for the corresponding non-project specific
configuration [option](yaml/non-project.md#install-ghc).

I suppose at least the documentation should be fixed, maybe the option should be differentiated.

@mpilgrem
Copy link
Member

@andreasabel, I have fixed the documentation.

The current logic is that if skip-msys is true (false is the default), Stack-supplied MSYS2 is not used. Otherwise, if MSYS2 is missing and install-ghc is true (the default), Stack seeks to fetch MSYS2.

I agree with your suggestion. I think that means there should be:

  • an install-msys with a default value equal to the (default or specified) value of install-ghc; and
  • (as now) if skip-msys is true, Stack-supplied MSYS2 is not used;
  • otherwise, if MSYS2 is missing and install-msys is true, Stack seeks to fetch MSYS2.

That way:

  • the default experience would be unchanged, including when install-ghc is false (install-msys is also false); but

  • a user could specify install-ghc: false and install-msys: true (overriding the default) to use their own GHC but still have Stack download and install the Stack-supplied MSYS2 when necessary.

@mpilgrem
Copy link
Member

I've raised a pull request that seeks to implement this:

@mpilgrem mpilgrem changed the title --no-install-ghc also does not install MSYS2 --no-install-ghc also blocks install MSYS2 when necessary Jan 11, 2025
@andreasabel
Copy link
Author

Excellent, thanks!

mpilgrem added a commit that referenced this issue Jan 21, 2025
Fix #6675 Add install-msys and ancillary matters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants