Skip to content

test: Debug and validate the debugger itself#286

Merged
alt-romes merged 1 commit into
masterfrom
wip/romes/245
Apr 24, 2026
Merged

test: Debug and validate the debugger itself#286
alt-romes merged 1 commit into
masterfrom
wip/romes/245

Conversation

@alt-romes
Copy link
Copy Markdown
Collaborator

Introduce a test which tests loading the haskell-debugger onto itself, setting a breakpoint on runDebugger, and printing a FastString value, expecting the value to be printed according to the pretty instance DebugView FastString we gave in GHC.Debugger.Utils.Orphans.

From here on, we should aim to introduce more DebugView instances for the haskell-debugger types and (orphan) instances for the ghc types, aiming to make debugging the debugger as seamless as possible (also to dogfood this all!)

Fixes #245

@alt-romes
Copy link
Copy Markdown
Collaborator Author

hie-bios is not happy:


      In order, the following will be built (use -v for more details):
       - haskell-debugger-view-0.2.1.0 (interactive) (lib) (first run)
       - haskell-debugger-0.12.3.0 (interactive) (lib) (first run)
       - haskell-debugger-0.12.3.0 (interactive) (exe:hdb) (first run)
       - haskell-debugger-0.12.3.0 (interactive) (test:haskell-debugger-test) (first run)
      Configuring library for haskell-debugger-view-0.2.1.0...
      Preprocessing library for haskell-debugger-view-0.2.1.0...
      Configuring library for haskell-debugger-0.12.3.0...
      Preprocessing library for haskell-debugger-0.12.3.0...
      Configuring executable 'hdb' for haskell-debugger-0.12.3.0...
      Preprocessing executable 'hdb' for haskell-debugger-0.12.3.0...
      Building executable 'hdb' for haskell-debugger-0.12.3.0...
      
      <command line>: cannot satisfy -package-id haskell-debugger-0.12.3.0-inplace
          (use -v for more information)
      Error: [Cabal-7125]
      Failed to build exe:hdb from haskell-debugger-0.12.3.0 (which is required by test:haskell-debugger-test from haskell-debugger-0.12.3.0).
      
      
      
      Process Environment:
      
      Failed to get compiler options using hie-bios cradle
      

@alt-romes
Copy link
Copy Markdown
Collaborator Author

We probably also need to normalize the ROOT DIRECTORY out

@alt-romes alt-romes force-pushed the wip/romes/245 branch 4 times, most recently from eb753b3 to 29d0b56 Compare April 24, 2026 14:02
@alt-romes
Copy link
Copy Markdown
Collaborator Author

I was able to reproduce this locally with:

cabal repl all --enable-multi-repl --builddir=$(mktemp -d) --enable-tests
Resolving dependencies...
Build profile: -w ghc-9.14.1 -O1
In order, the following will be built (use -v for more details):
 - haskell-debugger-view-0.2.1.0 (interactive) (lib) (first run)
 - haskell-debugger-0.12.3.0 (interactive) (lib) (first run)
 - haskell-debugger-0.12.3.0 (interactive) (exe:hdb) (first run)
 - haskell-debugger-0.12.3.0 (interactive) (test:haskell-debugger-test) (first run)
Configuring library for haskell-debugger-view-0.2.1.0...
Preprocessing library for haskell-debugger-view-0.2.1.0...
Configuring library for haskell-debugger-0.12.3.0...
Preprocessing library for haskell-debugger-0.12.3.0...
Configuring executable 'hdb' for haskell-debugger-0.12.3.0...
Preprocessing executable 'hdb' for haskell-debugger-0.12.3.0...
Building executable 'hdb' for haskell-debugger-0.12.3.0...
<command line>: cannot satisfy -package-id haskell-debugger-0.12.3.0-inplace
    (use -v for more information)
Error: [Cabal-7125]
Failed to build exe:hdb from haskell-debugger-0.12.3.0 (which is required by test:haskell-debugger-test from haskell-debugger-0.12.3.0).

alt-romes added a commit that referenced this pull request Apr 24, 2026
Introduce a test which tests loading the haskell-debugger onto itself,
setting a breakpoint on `runDebugger`, and printing a `FastString`
value, expecting the value to be printed according to the pretty
`instance DebugView FastString` we gave in `GHC.Debugger.Utils.Orphans`.

From here on, we should aim to introduce more `DebugView` instances for
the `haskell-debugger` types and (orphan) instances for the `ghc` types,
aiming to make debugging the debugger as seamless as possible (also to
dogfood this all!)

The debugger.yaml CI has to be tweaked to /not/ persist --enable-tests
with cabal configure, because when the debugger loads itself it looks at
the configured plan and loading the tests which have a
build-tool-depends on a multi-repl with that same tool currently fails
(see #286)

Fixes #245
Introduce a test which tests loading the haskell-debugger onto itself,
setting a breakpoint on `runDebugger`, and printing a `FastString`
value, expecting the value to be printed according to the pretty
`instance DebugView FastString` we gave in `GHC.Debugger.Utils.Orphans`.

From here on, we should aim to introduce more `DebugView` instances for
the `haskell-debugger` types and (orphan) instances for the `ghc` types,
aiming to make debugging the debugger as seamless as possible (also to
dogfood this all!)

The debugger.yaml CI has to be tweaked to /not/ persist --enable-tests
with cabal configure, because when the debugger loads itself it looks at
the configured plan and loading the tests which have a
build-tool-depends on a multi-repl with that same tool currently fails
(see #286)

Fixes #245
@alt-romes alt-romes merged commit d0b7f21 into master Apr 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test DebugView found when debugging debugger.

1 participant