Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Behavior changes:
* With Nix integration, Stack uses `nix-instantiate` before `nix-shell`,
enabling Stack to catch and report when the Nix expression cannot be
evaluated by Nix. The `nix-instantiate-options` option is added, accordingly.
* Stack's `build` command now warns if `--force-dirty` is specified but no
local packages will be built.

Other enhancements:

Expand Down
17 changes: 14 additions & 3 deletions src/Stack/Build.hs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,20 @@ build msetLocalFiles = do
boptsCli.initialBuildSteps

allowLocals <- view $ configL . to (.allowLocals)
unless allowLocals $ case justLocals plan of
[] -> pure ()
localsIdents -> throwM $ LocalPackagesPresent localsIdents
case justLocals plan of
[] -> when bopts.forceDirty $ prettyWarn $
fillSep
[ style Shell "--force-dirty"
, flow "is specified but no local packages will be built."
]
<> blankLine
<> flow "If your aim is that Stack rebuilds an installed package (one \
\registered in the relevant package database) that Stack deems \
\immutable, first unregister it from the database by commanding:"
<> blankLine
<> style Shell "stack exec -- ghc-pkg unregister --force <package>"
localsIdents -> unless allowLocals $
throwM $ LocalPackagesPresent localsIdents

checkCabalVersion
haddockCompsSupported <- warnAboutHaddockComps bopts
Expand Down
Loading