From 9efd822614f230e09987cfbbeaff8ca6b86a44d4 Mon Sep 17 00:00:00 2001 From: Bretton Date: Thu, 4 Aug 2022 18:51:41 -0700 Subject: [PATCH] FFI: Canonicalize module path for finding dylib --- src/Cryptol/Eval/FFI.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Cryptol/Eval/FFI.hs b/src/Cryptol/Eval/FFI.hs index 3767bddc4..fb12d33e9 100644 --- a/src/Cryptol/Eval/FFI.hs +++ b/src/Cryptol/Eval/FFI.hs @@ -32,6 +32,7 @@ import Foreign.C.Types import GHC.Float import LibBF (bfFromDouble, bfToDouble, pattern NearEven) +import System.Directory import Cryptol.Backend.Concrete import Cryptol.Backend.FFI @@ -66,7 +67,8 @@ evalForeignDecls path m env = do InFile p -> do -- If any error happens when loading the 'ForeignSrc', stop -- processing the module. - fsrc <- liftIO (loadForeignSrc p) >>= liftEither + fsrc <- liftEither =<< + liftIO (canonicalizePath p >>= loadForeignSrc) liftIO $ writeIORef foreignSrc $ Just fsrc pure fsrc -- We don't handle in-memory modules for now