Skip to content

Commit

Permalink
Use explicit data types for cabal file entries
Browse files Browse the repository at this point in the history
@manny-fp This fixes the issue. Accidentally passed in the wrong type
here:

-            (map DotCabalModule (otherModules build) ++ [DotCabalFile (modulePath exe)])
+            (map DotCabalModule (otherModules build) ++ [DotCabalMain (modulePath exe)])

Now it's fixed and the 32-unlisted-module test passes.
  • Loading branch information
Chris Done authored and Chris Done committed Sep 4, 2015
1 parent d6fb242 commit 5f3ffe5
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 122 deletions.
8 changes: 3 additions & 5 deletions src/Stack/Build/Source.hs
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,10 @@ loadLocalPackage bopts targets (name, (lpv, gpkg)) = do
testpkg = resolvePackage testconfig gpkg
benchpkg = resolvePackage benchconfig gpkg
mbuildCache <- tryGetBuildCache $ lpvRoot lpv
(_,modFiles,otherFiles,mainFiles,extraFiles) <- getPackageFiles (packageFiles pkg) (lpvCabalFP lpv)
(_,compFiles,cabalFiles) <- getPackageFiles (packageFiles pkg) (lpvCabalFP lpv)
let files =
mconcat (M.elems modFiles) <>
mconcat (M.elems otherFiles) <>
Set.map mainIsFile (mconcat (M.elems mainFiles)) <>
extraFiles
Set.map dotCabalGetPath (mconcat (M.elems compFiles)) <>
cabalFiles
(isDirty, newBuildCache) <- checkBuildCache
(fromMaybe Map.empty mbuildCache)
(map toFilePath $ Set.toList files)
Expand Down
8 changes: 5 additions & 3 deletions src/Stack/Ghci.hs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ makeGhciPkgInfo sourceMap locals name cabalfp components = do
pkg <- readPackage config cabalfp
(componentsOpts,generalOpts) <-
getPackageOpts (packageOpts pkg) sourceMap locals cabalfp
(componentsModules,componentModFiles,_,mainIsFiles,_) <-
(componentsModules,componentFiles,_) <-
getPackageFiles (packageFiles pkg) cabalfp
let filterWithinWantedComponents m =
M.elems
Expand All @@ -270,10 +270,12 @@ makeGhciPkgInfo sourceMap locals name cabalfp components = do
, ghciPkgModules = mconcat
(filterWithinWantedComponents componentsModules)
, ghciPkgModFiles = mconcat
(filterWithinWantedComponents componentModFiles)
, ghciPkgMainIs = M.map (S.map mainIsFile) mainIsFiles
(filterWithinWantedComponents
(M.map (setMapMaybe dotCabalModulePath) componentFiles))
, ghciPkgMainIs = M.map (setMapMaybe dotCabalMainPath) componentFiles
}
where
badForGhci :: String -> Bool
badForGhci x =
isPrefixOf "-O" x || elem x (words "-debug -threaded -ticky")
setMapMaybe f = S.fromList . mapMaybe f . S.toList
Loading

0 comments on commit 5f3ffe5

Please sign in to comment.