Closed mouse07410 closed 5 years ago
Changing --with-ghc=ghci-dap
to --with-ghc=haskell-dap
did not improve the situation. Actually, it claims that it cannot use --with-ghc=haskell-dap
, removes it, and then adds --with-ghc=ghci-dap
instead:
Configuration read.
Starting GHCi.
Wait for a moment.
[DEBUG][APP] ["stack","ghci","--with-ghc=haskell-dap","--test","--no-load","--no-build","--main-is","TARGET","--ghci-options","-fprint-evld-with-show"]
[INFO][APP] can not use haskell-dap. deleting "--with-ghc=haskell-dap"
[INFO][APP] "--with-ghc" option not found. adding "--with-ghc=ghci-dap"
CWD:/Users/ur20980/src/Str3Split
CMD:stack ghci --with-ghc=ghci-dap --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show
Warning: /Users/ur20980/src/Str3Split/Str3Split.cabal was modified manually. Ignoring
/Users/ur20980/src/Str3Split/package.yaml in favor of the cabal file. If you want to use
the package.yaml file instead of the cabal file, then please delete the cabal file.
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded -Werror -O2
Configuring GHCi with the following packages: Str3Split
[DAP][INFO] start ghci-dap-0.0.12.0.
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
Prelude>
:set prompt "<<DAP_CMD_END2>>\nH>>= "
H>>=
:set prompt-cont "<<DAP_CMD_END2>>\nH>>= "
H>>=
:dap-launch ...
[DEBUG][APP] :dap-launch LaunchRequestArguments {noDebugLaunchRequestArguments = Nothing, nameLaunchRequestArguments = "test-haskell-debug-adapter", typeLaunchRequestArguments = "ghc", requestLaunchRequestArguments = "launch", startupLaunchRequestArguments = "/Users/ur20980/src/Str3Split/test/Spec.hs", workspaceLaunchRequestArguments = "/Users/ur20980/src/Str3Split", logFileLaunchRequestArguments = "/Users/ur20980/src/Str3Split/.vscode/phoityne.log", logLevelLaunchRequestArguments = "DEBUG", ghciPromptLaunchRequestArguments = "H>>= ", ghciCmdLaunchRequestArguments = "stack ghci --with-ghc=haskell-dap --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show", stopOnEntryLaunchRequestArguments = False, mainArgsLaunchRequestArguments = Just "", ghciEnvLaunchRequestArguments = fromList [], ghciInitialPromptLaunchRequestArguments = Just "Prelude>", startupFuncLaunchRequestArguments = Just "main", startupArgsLaunchRequestArguments = Just "", forceInspectLaunchRequestArguments = Just False}
<<DAP>>Right ()
H>>=
:load /Users/ur20980/src/Str3Split/test/Spec.hs
[1 of 4] Compiling Phoityne.Example.Math ( /Users/ur20980/src/Str3Split/src/Phoityne/Example/Math.hs, interpreted )
[2 of 4] Compiling SpecHelper ( /Users/ur20980/src/Str3Split/test/SpecHelper.hs, interpreted )
[3 of 4] Compiling Phoityne.Example.MathSpec ( /Users/ur20980/src/Str3Split/test/Phoityne/Example/MathSpec.hs, interpreted )
[4 of 4] Compiling Main ( /Users/ur20980/src/Str3Split/test/Spec.hs, interpreted )
Ok, four modules loaded.
H>>=
:dap-set-function-breakpoints ...
[DEBUG][APP] :dap-set-function-breakpoints SetFunctionBreakpointsRequestArguments {breakpointsSetFunctionBreakpointsRequestArguments = []}
[DAP][DEBUG]<dapSetFunctionBreakpointsCommand> delete func bps []
[DEBUG][APP] <<DAP>>Right (SetFunctionBreakpointsResponseBody {breakpointsSetFunctionBreakpointsResponseBody = []})
H>>=
:set -fbreak-on-exception
H>>=
:set -fbreak-on-error
H>>=
:dap-continue ...
[DEBUG][APP] :dap-continue ContinueRequestArguments {threadIdContinueRequestArguments = 0, exprContinueRequestArguments = Just "main"}
Stopped in <exception thrown>, <unknown>
_exception :: e = _
[DAP][DEBUG]stopped by exception
[DAP][WARN]ghci says,
Couldn't match kind ‘Constraint’ with ‘*’
When matching types
a0 :: *
Typeable IOException :: Constraint
"end of file"
[DEBUG][APP] <<DAP>>Right (StoppedEventBody {reasonStoppedEventBody = "exception", descriptionStoppedEventBody = "\"end of file\"", threadIdStoppedEventBody = 0, textStoppedEventBody = "\"end of file\"", allThreadsStoppedStoppedEventBody = True})
H>>=
:dap-stacktrace ...
[DEBUG][APP] :dap-stacktrace StackTraceRequestArguments {threadIdStackTraceRequestArguments = 0, startFrameStackTraceRequestArguments = Just 0, levelsStackTraceRequestArguments = 20}
-1 : main (/Users/ur20980/src/Str3Split/test/Spec.hs:6:8-17)
<end of history>
[DEBUG][APP] <<DAP>>Right (StackTraceResponseBody {stackFramesStackTraceResponseBody = [StackFrame {idStackFrame = 0, nameStackFrame = "main", sourceStackFrame = Source {nameSource = Nothing, pathSource = "/Users/ur20980/src/Str3Split/test/Spec.hs", sourceReferenceSource = Nothing, origineSource = Nothing}, lineStackFrame = 6, columnStackFrame = 8, endLineStackFrame = 6, endColumnStackFrame = 18}], totalFramesStackTraceResponseBody = 1})
H>>=
:dap-scopes ...
[DEBUG][APP] :dap-scopes ScopesRequestArguments {frameIdScopesRequestArguments = 0}
[DEBUG][APP] <<DAP>>Right (ScopesResponseBody {scopesScopesResponseBody = [Scope {nameScope = "GHCi Local", variablesReferenceScope = 1, namedVariablesScope = Nothing, indexedVariablesScope = Nothing, expensiveScope = False},Scope {nameScope = "GHCi Global", variablesReferenceScope = 2, namedVariablesScope = Nothing, indexedVariablesScope = Nothing, expensiveScope = False}]})
H>>=
:dap-variables ...
[DEBUG][APP] :dap-variables VariablesRequestArguments {variablesReferenceVariablesRequestArguments = 1}
[DEBUG][APP] <<DAP>>Left "Couldn't match kind \8216Constraint\8217 with \8216*\8217\nWhen matching types\n a0 :: *\n Typeable IOException :: Constraint\n"
H>>=
This is for Main.hs
(not Spec.hs
) - note how it changed to =ghci-dap
there, despite what launch.json
says:
Configuration read.
Starting GHCi.
Wait for a moment.
CWD:/Users/ur20980/src/Str3Split
CMD:stack ghci --with-ghc=ghci-dap --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show
Warning: /Users/ur20980/src/Str3Split/Str3Split.cabal was modified manually. Ignoring
/Users/ur20980/src/Str3Split/package.yaml in favor of the cabal file. If you want to use
the package.yaml file instead of the cabal file, then please delete the cabal file.
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded -Werror -O2
Configuring GHCi with the following packages: Str3Split
[DAP][INFO] start ghci-dap-0.0.12.0.
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
Prelude>
:set prompt "<<DAP_CMD_END2>>\nH>>= "
H>>=
:set prompt-cont "<<DAP_CMD_END2>>\nH>>= "
H>>=
:dap-launch ...
<<DAP>>Right ()
H>>=
:load /Users/ur20980/src/Str3Split/app/Main.hs
[1 of 2] Compiling Lib ( /Users/ur20980/src/Str3Split/src/Lib.hs, interpreted )
[2 of 2] Compiling Main ( /Users/ur20980/src/Str3Split/app/Main.hs, interpreted )
Ok, two modules loaded.
H>>=
:dap-set-function-breakpoints ...
H>>=
:set -fbreak-on-exception
H>>=
:set -fbreak-on-error
H>>=
:dap-continue ...
Testing complicated 'foldr'
"2d4 fda 81c 8ce 783 aso meF unc"
Testing my 'chunker' (uses 'unfoldr')
["2d","4f","da","81","c8","ce","78","3a","so","me","Fu","nc"]
Testing "splitMore" using 'unfoldr' and 'intercalate'
"2d 4f da 81 c8 ce 78 3a so me Fu nc"
Testing "splitMore" using 'unfoldr' and 'unwords'
"2d 4f da 81 c8 ce 78 3a so me Fu nc"
debugging completed.
H>>=
:quit
Leaving GHCi.
I think I'm beginning to understand a little. EOF
is an exception, but since debugger was set to break on it, it breaks instead of handling that exception. Probably OK. But then I observe this in the log - note panic! (the 'impossible' happened)
message:
Configuration read.
Starting GHCi.
Wait for a moment.
CWD:/Users/ur20980/src/Str3Split
CMD:stack ghci --with-ghc=ghci-dap --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show
Warning: /Users/ur20980/src/Str3Split/Str3Split.cabal was modified manually. Ignoring
/Users/ur20980/src/Str3Split/package.yaml in favor of the cabal file. If you want to use
the package.yaml file instead of the cabal file, then please delete the cabal file.
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded -Werror -O2
Configuring GHCi with the following packages: Str3Split
[DAP][INFO] start ghci-dap-0.0.12.0.
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
Prelude>
:set prompt "<<DAP_CMD_END2>>\nH>>= "
H>>=
:set prompt-cont "<<DAP_CMD_END2>>\nH>>= "
H>>=
:dap-launch ...
<<DAP>>Right ()
H>>=
:load /Users/ur20980/src/Str3Split/test/Spec.hs
[1 of 4] Compiling Phoityne.Example.Math ( /Users/ur20980/src/Str3Split/src/Phoityne/Example/Math.hs, interpreted )
[2 of 4] Compiling SpecHelper ( /Users/ur20980/src/Str3Split/test/SpecHelper.hs, interpreted )
[3 of 4] Compiling Phoityne.Example.MathSpec ( /Users/ur20980/src/Str3Split/test/Phoityne/Example/MathSpec.hs, interpreted )
[4 of 4] Compiling Main ( /Users/ur20980/src/Str3Split/test/Spec.hs, interpreted )
Ok, four modules loaded.
H>>=
:dap-set-function-breakpoints ...
H>>=
:set -fbreak-on-exception
H>>=
:set -fbreak-on-error
H>>=
:dap-continue ...
Stopped in <exception thrown>, <unknown>
_exception :: e = _
[DAP][WARN]ghci says,
Couldn't match kind ‘Constraint’ with ‘*’
When matching types
a0 :: *
Typeable IOException :: Constraint
"end of file"
H>>=
:dap-stacktrace ...
-1 : main (/Users/ur20980/src/Str3Split/test/Spec.hs:6:8-17)
<end of history>
H>>=
:dap-scopes ...
H>>=
:dap-variables ...
H>>=
:dap-next ...
[DAP][WARN]ghci says,
<interactive>: panic! (the 'impossible' happened)
(GHC version 8.6.5 for x86_64-apple-darwin):
enclosingTickSpan UnhelpfulSpan
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
H>>=
:dap-continue ...
Stopped in <exception thrown>, <unknown>
[DAP][WARN]ghci says,
Couldn't match kind ‘Constraint’ with ‘*’
When matching types
a0 :: *
Typeable IOException :: Constraint
[DAP][WARN]ghci says,
Couldn't match kind ‘Constraint’ with ‘*’
When matching types
a0 :: *
Typeable IOException :: Constraint
"end of file"
H>>=
:dap-stacktrace ...
-1 : main (/Users/ur20980/src/Str3Split/test/Spec.hs:6:8-17)
<end of history>
H>>=
:dap-scopes ...
H>>=
:dap-variables ...
H>>=
Hi.
About exception breaks, could you check off the "break-on-exception" checkbox ? (in the left breakpoints menu )
hspec throws exceptions internally, then ghci catches them all.
from your log.
H>>= :set -fbreak-on-exception => will be :set -fno-break-on-exception
H>>= :set -fbreak-on-error
H>>=
About exception breaks, could you check off the "break-on-exception" checkbox ?
Yes, that helped.
So, the conclusion is - one cannot/shouldn't attempt to catch exceptions when running a test framework. Correct?
Also, it looks like --with-ghc=haskell-dap
is no longer supported? Only --with-ghc=ghci-dap
?
So, the conclusion is - one cannot/shouldn't attempt to catch exceptions when running a test framework. Correct?
Yes, shouldn't check on "break-on-exception" with hspec. (because many automatic breaks will be occured.)
Also, it looks like --with-ghc=haskell-dap is no longer supported? Only --with-ghc=ghci-dap?
With haskell-debug-adapter(hda), yes.
Also, it looks like
--with-ghc=haskell-dap
is no longer supported? Only--with-ghc=ghci-dap
?With haskell-debug-adapter(hda), yes.
- phoityne-vscode + haskell-dap <-- current version.
- hda + ghci-dap <-- next version
I have all the four of your components installed:
Does that mean that I "automatically" provided everything necessary for the software to force the "next version"? Because, as I said above, my attempt to specify --with-ghc=haskell-dap
failed: it said:
[DEBUG][APP] ["stack","ghci","--with-ghc=haskell-dap","--test","--no-load","--no-build","--main-is","TARGET","--ghci-options","-fprint-evld-with-show"]
[INFO][APP] can not use haskell-dap. deleting "--with-ghc=haskell-dap"
[INFO][APP] "--with-ghc" option not found. adding "--with-ghc=ghci-dap"
Does that mean that I "automatically" provided everything necessary for the software to force the "next version"?
Yes, right. It is the hda. phoityen vscode extension runs hda if it is installed. This is because of preparation for gradual migration from current to next version.
If you want to run current version, uninstall hda. (just ok renaming haskell-debug-dapter.exe) phoityen vscode extension will run phoityne-vscode.exe
Regards.
Yes, right. It is the hda. phoityen vscode extension runs hda if it is installed.
Excellent, thanks!
If you want to run current version, uninstall hda.
Oh no, no need, thanks. I just wanted to make sure I understand what the code is doing, and why. I'm perfectly happy with it.
Perhaps you want to document this behavior somewhere.
MacOS 10.14.4, everything current.
Attempt to debug the tests from your example (after all the components have been successfully re-installed) causes this failure:
Here's the log:
Here's the
Spec.hs
file that seems to cause "end-of-file" exception:Here's
.hspec
:and its contents:
Here's the relevant entry in
launch.json
:(uncommenting the line with
--with-ghc=...
did not change anything)