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 @@ -140,6 +140,8 @@ Bug fixes:
* docs.haskellstack.org RTD documentation search is replaced by the mkdocs
search. Please see
[#3376](https://github.com/commercialhaskell/stack/issues/3376).
* `stack clean` now works with nix. See
[#3468](https://github.com/commercialhaskell/stack/issues/3376).


## 1.5.1
Expand Down
4 changes: 3 additions & 1 deletion src/Stack/Runners.hs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ withBuildConfigAndLock
withBuildConfigAndLock go inner =
withBuildConfigExt False go Nothing inner Nothing

-- | See issue #2010 for why this exists. Currently just used for the
-- specific case of "stack clean --full".
withBuildConfigAndLockNoDocker
:: GlobalOpts
-> (Maybe FileLock -> RIO EnvConfig ())
Expand Down Expand Up @@ -177,7 +179,7 @@ withBuildConfigExt skipDocker go@GlobalOpts{..} mbefore inner mafter = loadConfi
if skipDocker
then runRIO (lcConfig lc) $ do
forM_ mbefore id
liftIO $ inner'' lk0
Nix.reexecWithOptionalShell (lcProjectRoot lc) getCompilerVersion (inner'' lk0)
forM_ mafter id
else runRIO (lcConfig lc) $
Docker.reexecWithOptionalContainer
Expand Down
9 changes: 7 additions & 2 deletions src/main/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import Path
import Path.IO
import qualified Paths_stack as Meta
import Stack.Build
import Stack.Clean (CleanOpts, clean)
import Stack.Clean (CleanOpts(..), clean)
import Stack.Config
import Stack.ConfigCmd as ConfigCmd
import Stack.Constants
Expand Down Expand Up @@ -581,7 +581,12 @@ setupCmd sco@SetupCmdOpts{..} go@GlobalOpts{..} = loadConfigWithOpts go $ \lc ->
(Just $ munlockFile lk)

cleanCmd :: CleanOpts -> GlobalOpts -> IO ()
cleanCmd opts go = withBuildConfigAndLockNoDocker go (const (clean opts))
cleanCmd opts go =
-- See issues #2010 and #3468 for why "stack clean --full" is not used
-- within docker.
case opts of
CleanFull{} -> withBuildConfigAndLock go (const (clean opts))
CleanShallow{} -> withBuildConfigAndLockNoDocker go (const (clean opts))

-- | Helper for build and install commands
buildCmd :: BuildOptsCLI -> GlobalOpts -> IO ()
Expand Down