File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,8 @@ Bug fixes:
138138* docs.haskellstack.org RTD documentation search is replaced by the mkdocs
139139 search. Please see
140140 [ #3376 ] ( https://github.com/commercialhaskell/stack/issues/3376 ) .
141+ * ` stack clean ` now works with nix. See
142+ [ #3468 ] ( https://github.com/commercialhaskell/stack/issues/3376 ) .
141143
142144
143145## 1.5.1
Original file line number Diff line number Diff line change @@ -128,6 +128,8 @@ withBuildConfigAndLock
128128withBuildConfigAndLock go inner =
129129 withBuildConfigExt False go Nothing inner Nothing
130130
131+ -- | See issue #2010 for why this exists. Currently just used for the
132+ -- specific case of "stack clean --full".
131133withBuildConfigAndLockNoDocker
132134 :: GlobalOpts
133135 -> (Maybe FileLock -> RIO EnvConfig () )
@@ -177,7 +179,7 @@ withBuildConfigExt skipDocker go@GlobalOpts{..} mbefore inner mafter = loadConfi
177179 if skipDocker
178180 then runRIO (lcConfig lc) $ do
179181 forM_ mbefore id
180- liftIO $ inner'' lk0
182+ Nix. reexecWithOptionalShell (lcProjectRoot lc) getCompilerVersion ( inner'' lk0)
181183 forM_ mafter id
182184 else runRIO (lcConfig lc) $
183185 Docker. reexecWithOptionalContainer
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ import Path
5151import Path.IO
5252import qualified Paths_stack as Meta
5353import Stack.Build
54- import Stack.Clean (CleanOpts , clean )
54+ import Stack.Clean (CleanOpts ( .. ) , clean )
5555import Stack.Config
5656import Stack.ConfigCmd as ConfigCmd
5757import Stack.Constants
@@ -581,7 +581,12 @@ setupCmd sco@SetupCmdOpts{..} go@GlobalOpts{..} = loadConfigWithOpts go $ \lc ->
581581 (Just $ munlockFile lk)
582582
583583cleanCmd :: CleanOpts -> GlobalOpts -> IO ()
584- cleanCmd opts go = withBuildConfigAndLockNoDocker go (const (clean opts))
584+ cleanCmd opts go =
585+ -- See issues #2010 and #3468 for why "stack clean --full" is not used
586+ -- within docker.
587+ case opts of
588+ CleanFull {} -> withBuildConfigAndLock go (const (clean opts))
589+ CleanShallow {} -> withBuildConfigAndLockNoDocker go (const (clean opts))
585590
586591-- | Helper for build and install commands
587592buildCmd :: BuildOptsCLI -> GlobalOpts -> IO ()
You can’t perform that action at this time.
0 commit comments