diff --git a/src/System/Plugins/Load.hs b/src/System/Plugins/Load.hs index 1daab7c..a081a8d 100644 --- a/src/System/Plugins/Load.hs +++ b/src/System/Plugins/Load.hs @@ -258,14 +258,13 @@ unify obj incs args ty sym = do let nm = mkModid (basename tmpf) src = mkTest nm (hierize' . mkModid . hierize $ obj) (fst $ break (=='.') ty) ty sym - is = map (\s -> "-i"++s) incs -- api + is = map ("-i"++) incs -- api i = "-i" ++ dirname obj -- plugin hWrite hdl src e <- build tmpf tmpf1 (i:is++args++["-fno-code","-ohi "++tmpf1]) - -- removeFile tmpf - removeFile tmpf1 + mapM_ removeFile [tmpf,tmpf1] return e where diff --git a/src/System/Plugins/Make.hs b/src/System/Plugins/Make.hs index 5f17722..d5f413e 100644 --- a/src/System/Plugins/Make.hs +++ b/src/System/Plugins/Make.hs @@ -292,6 +292,8 @@ build :: FilePath -- ^ path to .hs source build src obj extra_opts = do let odir = dirname obj -- always put the .hi file next to the .o file + -- does this work in the presence of hier plugins? + -- won't handle hier names properly. let ghc_opts = [ "-Onot" ] output = [ "-o", obj, "-odir", odir, @@ -299,7 +301,6 @@ build src obj extra_opts = do let flags = ghc_opts ++ output ++ extra_opts ++ [src] - #if DEBUG -- env. putStr $ show $ ghc : flags @@ -354,8 +355,8 @@ mergeTo src stb out = rawMerge src stb out False -- directory. mergeToDir :: FilePath -> FilePath -> FilePath -> IO MergeStatus mergeToDir src stb dir = do - out <- mkUniqueIn dir - rawMerge src stb out True + out <- mkUniqueIn dir + rawMerge src stb out True -- --------------------------------------------------------------------- -- Conditional on file modification times, merge a src file with a