From 8f2e5eee7db0cfae21f0c347d5551f23e69de34c Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Tue, 6 Aug 2019 02:12:00 +0200 Subject: Make ChSetupEntrypoint carry the Main module file name --- src/CabalHelper/Shared/InterfaceTypes.hs | 2 ++ tests/GhcSession.hs | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CabalHelper/Shared/InterfaceTypes.hs b/src/CabalHelper/Shared/InterfaceTypes.hs index ed06045..352deb0 100644 --- a/src/CabalHelper/Shared/InterfaceTypes.hs +++ b/src/CabalHelper/Shared/InterfaceTypes.hs @@ -79,6 +79,8 @@ data ChComponentInfo = ChComponentInfo data ChEntrypoint = ChSetupEntrypoint + { chMainIs :: FilePath + } | ChLibEntrypoint { chExposedModules :: [ChModuleName] , chOtherModules :: [ChModuleName] diff --git a/tests/GhcSession.hs b/tests/GhcSession.hs index 2fdd3e2..1a97b89 100644 --- a/tests/GhcSession.hs +++ b/tests/GhcSession.hs @@ -398,9 +398,7 @@ compileModule pkgdir ep srcdirs opts = do Nothing -> error $ printf "Couldn't find source file for Main module (%s), search path:\n\ \%s\n" m (show srcdirs) - ChSetupEntrypoint -> return $ - -- TODO: this doesn't support Setup.lhs - ["Setup.hs"] + ChSetupEntrypoint m -> return [m] -- Always compile targets as GHCi bytecode so the setContext call below -- can always succeed @@ -418,7 +416,7 @@ compileModule pkgdir ep srcdirs opts = do map (IIModule . mkModuleName . unChModuleName) $ ms ++ ms' ++ ss ChExeEntrypoint _ ms -> map (IIModule . mkModuleName . unChModuleName) $ ChModuleName "Main" : ms - ChSetupEntrypoint -> + ChSetupEntrypoint _ -> map (IIModule . mkModuleName) ["Main"] return $ TestResult True -- cgit v1.2.3