Skip to content

Commit dd9b3a0

Browse files
committed
Fix commercialhaskell#6565 Include Cabal flags set manually in the source map hash
1 parent 37873ca commit dd9b3a0

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

ChangeLog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
Release notes:
66

7+
* The hash that Stack uses to distinguish one build plan from another has
8+
changed for plans that set (as opposed to unset) manually Cabal flags for
9+
immutable dependencies. This will cause Stack to rebuild dependencies for such
10+
plans.
11+
712
**Changes since v2.15.6.1:**
813

914
Major changes:
@@ -14,6 +19,10 @@ Other enhancements:
1419

1520
Bug fixes:
1621

22+
* The hashes that Stack uses to distinguish one build plan from another now
23+
include the Cabal flags for immutable dependencies set manually. Previously,
24+
in error, only such flags that were unset manually were included.
25+
1726
## v2.15.6.1 (release candidate)
1827

1928
Release notes:

doc/build_command.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,6 @@ This overrides:
281281
In order to set a Cabal flag for a GHC boot package, the package must be
282282
specified as an [extra-dep](yaml_configuration.md#extra-deps).
283283

284-
!!! warning
285-
286-
Stack creates snapshots when building immutable dependencies of projects.
287-
The names of Cabal flags that have been unset manually distinguish one such
288-
snapshot from another. However, the names of Cabal flags that have been set
289-
manually do not do so.
290-
291284
### `--[no-]force-dirty` flag
292285

293286
Default: Disabled

doc/yaml_configuration.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,6 @@ in the snapshot.
322322
In order to set a Cabal flag for a GHC boot package, the package must be
323323
specified as an [extra-dep](#extra-deps).
324324

325-
!!! warning
326-
327-
Stack creates snapshots when building immutable dependencies of projects.
328-
The names of Cabal flags that have been unset manually distinguish one such
329-
snapshot from another. However, the names of Cabal flags that have been set
330-
manually do not do so.
331-
332325
### drop-packages
333326

334327
[:octicons-tag-24: 2.1.1](https://github.com/commercialhaskell/stack/releases/tag/v2.1.1)

src/Stack/Build/Source.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ depPackageHashableContent dp =
194194
PLMutable _ -> pure ""
195195
PLImmutable pli -> do
196196
let flagToBs (f, enabled) =
197-
if enabled
198-
then ""
199-
else "-" <> fromString (C.unFlagName f)
197+
(if enabled then "" else "-") <> fromString (C.unFlagName f)
200198
flags = map flagToBs $ Map.toList dp.depCommon.flags
201199
ghcOptions = map display dp.depCommon.ghcOptions
202200
cabalConfigOpts = map display dp.depCommon.cabalConfigOpts

0 commit comments

Comments
 (0)