diff --git a/lib/GHCup/Utils/Prelude.hs b/lib/GHCup/Utils/Prelude.hs index 21b7173..db2fbdc 100644 --- a/lib/GHCup/Utils/Prelude.hs +++ b/lib/GHCup/Utils/Prelude.hs @@ -473,7 +473,7 @@ recyclePathForcibly fp liftIO (moveFile fp dest) `catch` (\e -> if | isDoesNotExistError e -> pure () - | isPermissionError e {- EXDEV on windows -} -> recover (liftIO $ removePathForcibly fp) + | isPermissionError e || ioeGetErrorType e == UnsupportedOperation {- EXDEV on windows -} -> recover (liftIO $ removePathForcibly fp) | otherwise -> throwIO e) `finally` liftIO (handleIO (\_ -> pure ()) $ removePathForcibly tmp) @@ -515,7 +515,7 @@ recycleFile fp let dest = tmp takeFileName fp liftIO (moveFile fp dest) `catch` - (\e -> if isPermissionError e {- EXDEV on windows -} then recover (liftIO $ removePathForcibly fp) else throwIO e) + (\e -> if isPermissionError e || ioeGetErrorType e == UnsupportedOperation {- EXDEV on windows -} then recover (liftIO $ removePathForcibly fp) else throwIO e) `finally` liftIO (handleIO (\_ -> pure ()) $ removePathForcibly tmp) | otherwise = liftIO $ removeFile fp