Skip to content

Commit

Permalink
Fix MacOS canonical paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Jul 25, 2024
1 parent f364868 commit 4285454
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Cabal-tests/lib/Test/Utils/TempTestDir.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ withTestDir verbosity template action = withTestDir' verbosity defaultTempFileOp

withTestDir' :: (MonadIO m, MonadMask m) => Verbosity -> TempFileOptions -> String -> (FilePath -> m a) -> m a
withTestDir' verbosity tempFileOpts template action = do
systmpdir <- liftIO getTemporaryDirectory
systmpdir <-
-- MacOS returns /var/folders/... which is a symlink (/var -> /private/var),
-- so the test-suite struggles to make the build cwd-agnostic in particular
-- for the ShowBuildInfo tests. This canonicalizePath call makes it
-- /private/var/folders/... which will work.
liftIO $ canonicalizePath =<< getTemporaryDirectory
bracket
( do { tmpRelDir <- liftIO $ createTempDirectory systmpdir template
; return $ systmpdir </> tmpRelDir } )
Expand Down

0 comments on commit 4285454

Please sign in to comment.