File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ Behavior changes:
2727* With Nix integration, Stack uses ` nix-instantiate ` before ` nix-shell ` ,
2828 enabling Stack to catch and report when the Nix expression cannot be
2929 evaluated by Nix. The ` nix-instantiate-options ` option is added, accordingly.
30+ * Stack's ` build ` command now warns if ` --force-dirty ` is specified but no
31+ local packages will be built.
3032
3133Other enhancements:
3234
Original file line number Diff line number Diff line change @@ -199,9 +199,20 @@ build msetLocalFiles = do
199199 boptsCli. initialBuildSteps
200200
201201 allowLocals <- view $ configL . to (. allowLocals)
202- unless allowLocals $ case justLocals plan of
203- [] -> pure ()
204- localsIdents -> throwM $ LocalPackagesPresent localsIdents
202+ case justLocals plan of
203+ [] -> when bopts. forceDirty $ prettyWarn $
204+ fillSep
205+ [ style Shell " --force-dirty"
206+ , flow " is specified but no local packages will be built."
207+ ]
208+ <> blankLine
209+ <> flow " If your aim is that Stack rebuilds an installed package (one \
210+ \registered in the relevant package database) that Stack deems \
211+ \immutable, first unregister it from the database by commanding:"
212+ <> blankLine
213+ <> style Shell " stack exec -- ghc-pkg unregister --force <package>"
214+ localsIdents -> unless allowLocals $
215+ throwM $ LocalPackagesPresent localsIdents
205216
206217 checkCabalVersion
207218 haddockCompsSupported <- warnAboutHaddockComps bopts
You can’t perform that action at this time.
0 commit comments