Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions haskell-debugger/GHC/Debugger/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ runDebugger l rootDir compDir libdir units ghcInvocation' extraGhcArgs mainFp co
-- 3093efa27468fb2d31a617f6a0e4ff67a90f6623 tried to fix (but had to be
-- reverted)
(dflags2, fileish_args, warns)
<- parseDynamicFlags logger dflags1 (map noLoc extraGhcArgs)
<- parseDynamicFlags logger dflags1 (map noLoc (ghcInvocation ++ extraGhcArgs))

liftIO $ printOrThrowDiagnostics logger (initPrintConfig dflags2) (initDiagOpts dflags2) (GhcDriverMessage <$> warns)
forM_ fileish_args $ \fish_arg -> liftIO $ do
GHC.logMsg logger MCOutput noSrcSpan $ text "Ignoring extraGhcArg which isn't a recognized flag:" <+> text (unLoc fish_arg)
Expand Down Expand Up @@ -315,7 +316,7 @@ runDebugger l rootDir compDir libdir units ghcInvocation' extraGhcArgs mainFp co
GHC.initUniqSupply (GHC.initialUnique df) (GHC.uniqueIncrement df)

-- Discover the user-given flags and targets
flagsAndTargets <- parseHomeUnitArguments mainFp compDir units ghcInvocation dflags2 rootDir
flagsAndTargets <- parseHomeUnitArguments mainFp compDir units dflags2 rootDir
buildWays <- liftIO $ validateUnitsWays flagsAndTargets

-- Setup base HomeUnitGraph
Expand Down
6 changes: 2 additions & 4 deletions haskell-debugger/GHC/Debugger/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import GHC.Unit.Types
import qualified GHC.Unit.State as State
import GHC.Driver.Env
import GHC.Types.SrcLoc

Check warning on line 63 in haskell-debugger/GHC/Debugger/Session.hs

View workflow job for this annotation

GitHub Actions / Build and Run Haskell Tests (ubuntu-latest)

The import of ‘GHC.Types.SrcLoc’ is redundant

Check warning on line 63 in haskell-debugger/GHC/Debugger/Session.hs

View workflow job for this annotation

GitHub Actions / Build and Run Haskell Tests (macOS-latest)

The import of ‘GHC.Types.SrcLoc’ is redundant

Check failure on line 63 in haskell-debugger/GHC/Debugger/Session.hs

View workflow job for this annotation

GitHub Actions / Build and Run Integration Tests (9.14.1)

The import of ‘GHC.Types.SrcLoc’ is redundant
import GHC.Settings (ToolSettings(..))
import Language.Haskell.Syntax.Module.Name
import qualified Data.Foldable as Foldable
Expand All @@ -74,16 +74,14 @@
=> FilePath -- ^ Main entry point function
-> FilePath -- ^ Component root. Important for multi-package cabal projects.
-> [String]
-> [String] -- ghcInvocation
-> DynFlags
-> FilePath -- ^ root dir, see Note [Root Directory]
-> m (NonEmpty.NonEmpty (DynFlags, [GHC.Target]))
parseHomeUnitArguments cfp compRoot units theOpts dflags rootDir = do
((theOpts',_errs,_warns),_units) <- GHC.processCmdLineP [] [] (map noLoc theOpts)
parseHomeUnitArguments cfp compRoot units dflags rootDir = do
case NonEmpty.nonEmpty units of
Just us -> initMulti us
Nothing -> do
(df, targets) <- initOne (map unLoc theOpts')
(df, targets) <- initOne []
-- A special target for the file which caused this wonderful
-- component to be created. In case the cradle doesn't list all the targets for
-- the component, in which case things will be horribly broken anyway.
Expand Down
9 changes: 1 addition & 8 deletions hdb/Development/Debug/Session/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ hieBiosFlags cradle root relTarget = runExceptT $ do

let (units', flags') = extractUnits (HIE.componentOptions componentOpts)
return HieBiosFlags
{ ghcInvocation = flags' ++ ghcDebuggerFlags
{ ghcInvocation = flags'
, libdir = libdir
, units = units'
, rootDir = HIE.cradleRootDir cradle
Expand All @@ -179,13 +179,6 @@ extractUnits = go [] []
go units rest (x : xs) = go units (x : rest) xs
go units rest [] = (reverse units, reverse rest)

-- | Flags specific to haskell-debugger to append to all GHC invocations.
ghcDebuggerFlags :: [String]
ghcDebuggerFlags =
[ "-fno-it" -- don't introduce @it@ after evaluating something at the prompt
]


-- ----------------------------------------------------------------------------
-- Utilities
-- ----------------------------------------------------------------------------
Expand Down
Loading