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

ghc-options should also appear under "project specific" settings #6691

Open
andreasabel opened this issue Feb 26, 2025 · 1 comment
Open

Comments

@andreasabel
Copy link

andreasabel commented Feb 26, 2025

First, let me praise the documentation, which looks great!

The issue: It took me very long to find how to correctly place ghc-options into stack.yaml so they are passed to the compiler when building my project.

The "project specific" listing does not contain them: https://docs.haskellstack.org/en/v3.3.1/configure/yaml/project/

Eventually I found them under "Non-project specific": https://docs.haskellstack.org/en/v3.3.1/configure/yaml/non-project/#ghc-options

I think the docs could be improved to add "ghc-options" also to "project specific" and link to their description under "non-project specific".

After all, I consider ghc-options akin to flags, and those are described under "project specific".
(Of course, not all GHC options are project specific, and there is options to pass GHC options also to the dependencies, but still, they are often specific to the project.)

@mpilgrem
Copy link
Member

@andreasabel, the structure of Stack's options, explained here, is that:

  • non-project specific options (the great majority) can be configured globally or at the project level (and ghc-options is an example of that); and
  • project-specific options can only be configured at the project level.

I think the distinction made between Cabal flags (flags) and GHC options (ghc-options) is that the former generally affects what is built and the latter can affect how it is built (eg optimisation, warnings, verbosity).

If you put GHC options into the search box in Stack's documentation, it should take you to this part of Stack's tutorial-like documentation: https://docs.haskellstack.org/en/stable/tutorial/cabal_flags_and_ghc_options/

I'll tweak the online documentation for your experience, but I think the basic structure will remain unchanged.

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