diff --git a/app/CLI.hs b/app/CLI.hs index 702608500..bbbdd2323 100644 --- a/app/CLI.hs +++ b/app/CLI.hs @@ -45,7 +45,7 @@ commandFirstFile CommandGlobalOptions {_cliGlobalOptions = GlobalOptions {..}} = makeAbsPaths :: CLI -> IO CLI makeAbsPaths cli = case cli of Command cmd -> do - nOpts <- traverseOf globalInputFiles (mapM makeAbsolute) (cmd ^. cliGlobalOptions) + nOpts <- traverseOf globalInputFiles (mapM canonicalizePath) (cmd ^. cliGlobalOptions) return (Command (set cliGlobalOptions nOpts cmd)) _ -> return cli diff --git a/src/MiniJuvix/Prelude/Files.hs b/src/MiniJuvix/Prelude/Files.hs index 73a8d8015..67bde0cf3 100644 --- a/src/MiniJuvix/Prelude/Files.hs +++ b/src/MiniJuvix/Prelude/Files.hs @@ -13,9 +13,9 @@ runFilesIO :: Member (Embed IO) r => Sem (Files ': r) a -> Sem r a runFilesIO = interpret $ \case ReadFile' f -> embed (readFile f) EqualPaths' f h -> embed $ do - f' <- makeAbsolute f - h' <- makeAbsolute h - return (Just $ f' == h') + f' <- canonicalizePath f + h' <- canonicalizePath h + return (Just (equalFilePath f' h')) runFilesEmpty :: Sem (Files ': r) a -> Sem r a runFilesEmpty = runFilesPure mempty diff --git a/test/Scope/Positive.hs b/test/Scope/Positive.hs index 3627090b5..809af26f3 100644 --- a/test/Scope/Positive.hs +++ b/test/Scope/Positive.hs @@ -32,7 +32,7 @@ testDescr PosTest {..} = _testRoot = tRoot, _testAssertion = Steps $ \step -> do cwd <- getCurrentDirectory - entryFile <- makeAbsolute _file + entryFile <- canonicalizePath _file let entryPoint = EntryPoint cwd False (pure entryFile) step "Parsing"