<commit_before>### In Progress

# Passing flags --flag use the Flag option or yaml file
https://github.com/commercialhaskell/stack/issues/191
https://github.com/commercialhaskell/stack/issues/201
https://github.com/commercialhaskell/stack/issues/417
https://github.com/commercialhaskell/stack/issues/335
https://github.com/commercialhaskell/stack/issues/301

# Selecting a resolver
Stack should intelligently select a resolver based on a installed GHC version https://github.com/commercialhaskell/stack/issues/468

# Using git repos
Use YAML syntax for remote git location identification. https://github.com/commercialhaskell/stack/issues/254

# Private Hackage
https://github.com/commercialhaskell/stack/issues/445

# Custom Snapshots
https://github.com/commercialhaskell/stack/issues/111

# intra-package targets
 https://github.com/commercialhaskell/stack/issues/201

## Common Gotchas 
Add an example of how to add a dependency to a project to the README and/or Wiki 
 https://github.com/commercialhaskell/stack/issues/510<commit_msg>Cabal flags explaination<commit_after># Introduction
The purpose of this page is to collect information about issues that arise when users either have an existing cabal project or another nonstandard setup such as a private hackage database. 

# Passing flags to cabal

Any build command, `bench`, `install`, `haddock`, `test`, etc. takes a `--flag` option which passes flags to cabal. Another way to do this is using the flags field in a `stack.yaml`, with the option to specify flags on a per project basis. 

As an example, in a `stack.yaml` for multi-package project with packages `foo`, `bar`, `baz`:

```
flags:
  foo:
    release: true
  bar:
    default: true
  baz:
    manual: true
```

It is also possible to pass the same flag to multiple packages, i.e. `stack build --flag *:necessary`

Currently one needs to list all of your modules that interpret flags in the `other-modules` section of a cabal file. `cabal-install` has a different behavior currently and doesn't require that the modules be listed. This may change in a future release. 


## Issues Referenced
https://github.com/commercialhaskell/stack/issues/191
https://github.com/commercialhaskell/stack/issues/417
https://github.com/commercialhaskell/stack/issues/335
https://github.com/commercialhaskell/stack/issues/301
https://github.com/commercialhaskell/stack/issues/365
https://github.com/commercialhaskell/stack/issues/105

# Selecting a resolver
Stack should intelligently select a resolver based on a installed GHC version https://github.com/commercialhaskell/stack/issues/468

# Using git repos
Use YAML syntax for remote git location identification. https://github.com/commercialhaskell/stack/issues/254

# Private Hackage
https://github.com/commercialhaskell/stack/issues/445

# Custom Snapshots
https://github.com/commercialhaskell/stack/issues/111

# intra-package targets
 https://github.com/commercialhaskell/stack/issues/201

## Common Gotchas 
Add an example of how to add a dependency to a project to the README and/or Wiki 
 https://github.com/commercialhaskell/stack/issues/510
{'fraction_non_alphanumeric': 0.0936594785967171, 'fraction_numerical': 0.022207917605407145, 'mean_word_length': 4.6, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 23, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5883797', 'n_tokens_mistral': 969, 'n_tokens_neox': 849, 'n_words': 301}