commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
3.95k stars 842 forks source link

Improve documentation of scope of `--flag *:` #6564

Closed mpilgrem closed 2 months ago

mpilgrem commented 2 months ago

The scope of --flag *: is not clear from online and in-app documentation.

mpilgrem commented 2 months ago

I think I have identified a bug, introduced in https://github.com/commercialhaskell/stack/commit/6d57ab5b2ea509b18d23860c7a72904bd9b8948d and Stack 2.1.1 (released June 2019).

Namely, in Stack.Build.depPackageHashableContent (as now is):

let flagToBs (f, enabled) =
      if enabled
        then ""
        else "-" <> fromString (C.unFlagName f)

does not hash flags that are set. I think what was intended was:

let flagToBs (f, enabled) =
         (if enabled then "" else "-")
      <> fromString (C.unFlagName f)

That strikes me as non-trivial. I'll re-raise it as a separate issue.

mpilgrem commented 2 months ago

The documentation side of things has now been improved, in-app and online.