@@ -77,7 +77,7 @@ import Obelisk.CliApp (
77 withSpinner,
77 withSpinner,
79import Obelisk.Command.Nix
79import Obelisk.Command.Nix
80−import Obelisk.Command.Project (nixShellWithoutPkgs, withProjectRoot, findProjectAssets, bashEscape, getHaskellManifestProjectPath)
80+import Obelisk.Command.Project (nixShellWithoutPkgs, withProjectRoot, findProjectAssets, bashEscape)
81import Obelisk.Command.Thunk (attrCacheFileName)
81import Obelisk.Command.Thunk (attrCacheFileName)
82import Obelisk.Command.Utils (findExePath, ghcidExePath)
82import Obelisk.Command.Utils (findExePath, ghcidExePath)
@@ -164,9 +164,8 @@ run :: MonadObelisk m => FilePath -> PathTree Interpret -> m ()
164run root interpretPaths = do
164run root interpretPaths = do
165 pkgs <- getParsedLocalPkgs root interpretPaths
165 pkgs <- getParsedLocalPkgs root interpretPaths
166 assets <- findProjectAssets root
166 assets <- findProjectAssets root
167− manifestPkg <- parsePackagesOrFail . (:[]) . T.unpack =<< getHaskellManifestProjectPath root
168 putLog Debug $ "Assets impurely loaded from: " <> assets
167 putLog Debug $ "Assets impurely loaded from: " <> assets
169− ghciArgs <- getGhciSessionSettings (pkgs <> manifestPkg) root True
168+ ghciArgs <- getGhciSessionSettings pkgs root True
170 freePort <- getFreePort
169 freePort <- getFreePort
171 withGhciScriptArgs pkgs $ \dotGhciArgs -> do
170 withGhciScriptArgs pkgs $ \dotGhciArgs -> do
172 runGhcid root True (ghciArgs <> dotGhciArgs) pkgs $ Just $ unwords
171 runGhcid root True (ghciArgs <> dotGhciArgs) pkgs $ Just $ unwords
@@ -223,12 +222,7 @@ getLocalPkgs root interpretPaths = do
223 let rootsAndExclusions = calcIntepretFinds "" interpretPaths
222 let rootsAndExclusions = calcIntepretFinds "" interpretPaths
225 fmap fold $ for (MMap.toAscList rootsAndExclusions) $ \(interpretPathRoot, exclusions) ->
224 fmap fold $ for (MMap.toAscList rootsAndExclusions) $ \(interpretPathRoot, exclusions) ->
226− let allExclusions = obeliskPackageExclusions
225+ let allExclusions = obeliskPackageExclusions <> exclusions <> Set.singleton ("*" </> attrCacheFileName)
228− <> Set.singleton ("*" </> attrCacheFileName)
229− <> Set.singleton ("*" </> "lib/asset/manifest") -- NB: obelisk-asset-manifest is excluded because it generates
230− -- a module that in turn imports it. This will cause ob run to
231− -- fail in its current implementation.
232 in fmap (Set.fromList . map normalise) $ runFind $
226 in fmap (Set.fromList . map normalise) $ runFind $
233 ["-L", interpretPathRoot, "(", "-name", "*.cabal", "-o", "-name", Hpack.packageConfig, ")", "-a", "-type", "f"]
227 ["-L", interpretPathRoot, "(", "-name", "*.cabal", "-o", "-name", Hpack.packageConfig, ")", "-a", "-type", "f"]
234 <> concat [["-not", "-path", p </> "*"] | p <- toList allExclusions]
228 <> concat [["-not", "-path", p </> "*"] | p <- toList allExclusions]
@@ -406,8 +400,7 @@ withGhciScriptArgs
406 => f CabalPackageInfo -- ^ List of packages to load into ghci
400 => f CabalPackageInfo -- ^ List of packages to load into ghci
407 -> ([String] -> m ()) -- ^ Action to run with the extra ghci arguments
401 -> ([String] -> m ()) -- ^ Action to run with the extra ghci arguments
409−withGhciScriptArgs packageInfos f = withGhciScript loadPreludeManually packageInfos $ \fp ->
403+withGhciScriptArgs packageInfos f = withGhciScript loadPreludeManually packageInfos $ \fp -> f ["-XNoImplicitPrelude", "-ghci-script", fp]
410− f ["-XNoImplicitPrelude", "-ghci-script", fp]
412 -- These lines must be first and allow the session to support a custom Prelude when @-XNoImplicitPrelude@
405 -- These lines must be first and allow the session to support a custom Prelude when @-XNoImplicitPrelude@
413 -- is passed to the ghci session.
406 -- is passed to the ghci session.
@@ -465,7 +458,6 @@ getGhciSessionSettings (toList -> packageInfos) pathBase useRelativePaths = do
467 $ baseGhciOptions
460 $ baseGhciOptions
468− <> ["-DOBELISK_ASSET_PASSTHRU"] -- For passthrough static assets
469 <> ["-F", "-pgmF", selfExe, "-optF", preprocessorIdentifier]
461 <> ["-F", "-pgmF", selfExe, "-optF", preprocessorIdentifier]
470 <> concatMap (\p -> ["-optF", p]) pkgFiles
462 <> concatMap (\p -> ["-optF", p]) pkgFiles
471 <> [ "-i" <> intercalate ":" (concatMap toList pkgSrcPaths) ]
463 <> [ "-i" <> intercalate ":" (concatMap toList pkgSrcPaths) ]