Skip to content

Commit

Permalink
--force-dirty flag
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Jul 17, 2015
1 parent 9ce0b14 commit 09a9fa4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Upper limit on number of flag combinations to test [#543](https://github.com/commercialhaskell/stack/issues/543)
* Fuzzy matching support to give better error messages for close version numbers [#504](https://github.com/commercialhaskell/stack/issues/504)
* --local-bin-path global option. Use to change where binaries get placed on an `stack install` [#342](https://github.com/commercialhaskell/stack/issues/342)
* --force-dirty flag: Force treating all local packages as having dirty files (useful for cases where stack can't detect a file change)

## 0.1.2.0

Expand Down
2 changes: 1 addition & 1 deletion src/Stack/Build/Source.hs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ loadLocals bopts latestVersion = do
, lpPackageFinal = pkgFinal
, lpWanted = wanted
, lpFiles = files
, lpDirtyFiles = isDirty
, lpDirtyFiles = isDirty || boptsForceDirty bopts
, lpNewBuildCache = newBuildCache
, lpCabalFile = cabalfp
, lpDir = dir
Expand Down
3 changes: 3 additions & 0 deletions src/Stack/Build/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ data BuildOpts =
-- ^ Watch files for changes and automatically rebuild
,boptsKeepGoing :: !(Maybe Bool)
-- ^ Keep building/running after failure
,boptsForceDirty :: !Bool
-- ^ Force treating all local packages as having dirty files
}
deriving (Show)

Expand All @@ -331,6 +333,7 @@ defaultBuildOpts = BuildOpts
, boptsOnlySnapshot = False
, boptsFileWatch = False
, boptsKeepGoing = Nothing
, boptsForceDirty = False
}

-- | Options for the 'FinalAction' 'DoTests'
Expand Down
6 changes: 5 additions & 1 deletion src/Stack/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ buildOptsParser cmd =
BuildOpts <$> target <*> libProfiling <*> exeProfiling <*>
optimize <*> haddock <*> haddockDeps <*> finalAction <*> dryRun <*> ghcOpts <*>
flags <*> installExes <*> preFetch <*> onlySnapshot <*>
fileWatch' <*> keepGoing
fileWatch' <*> keepGoing <*> forceDirty
where optimize =
maybeBoolFlags "optimizations" "optimizations for TARGETs and all its dependencies" idm
target =
Expand Down Expand Up @@ -130,6 +130,10 @@ buildOptsParser cmd =
"continue running after a step fails (default: false for build, true for test/bench)"
idm

forceDirty = flag False True
(long "force-dirty" <>
help "Force treating all local packages as having dirty files (useful for cases where stack can't detect a file change)")

-- | Parser for package:[-]flag
readFlag :: ReadM (Map (Maybe PackageName) (Map FlagName Bool))
readFlag = do
Expand Down

0 comments on commit 09a9fa4

Please sign in to comment.