From 2eda0934f4c1aef76346fdff1b056740d67f5e00 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 1 May 2024 16:36:25 -1000 Subject: [PATCH] ;doc: DEVFAQ: edits --- doc/DEVFAQ.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/DEVFAQ.md b/doc/DEVFAQ.md index ef5c44579..807cff2d6 100644 --- a/doc/DEVFAQ.md +++ b/doc/DEVFAQ.md @@ -56,6 +56,7 @@ $ cabal install all:exes You might need to stop background builders like HLS, to avoid a fight over the build flag (in VS Code, run the command "Haskell: Stop Haskell LSP server"). + Then build lib and executable(s) with the `ghcdebug` flag: ```cli $ stack build --flag hledger-lib:ghcdebug --flag hledger:ghcdebug --flag hledger-ui:ghcdebug --flag hledger-web:ghcdebug @@ -67,7 +68,7 @@ $ stack exec -- hledger --version ... with ghc debug support ``` -Now if you run at debug level -1, -2 or -3 the output should mention ghc-debug: +And when you run at debug level -1, -2 or -3 the output should mention ghc-debug: ```cli $ hledger CMD --debug=-1 # run normally, and listen for ghc-debug commands $ hledger CMD --debug=-2 # pause for ghc-debug commands at program start @@ -75,7 +76,7 @@ $ hledger CMD --debug=-3 # pause for ghc-debug commands at program end Starting ghc-debug on socket: ... ``` -Then in another window, you can run [ghc-debug-brick](https://hackage.haskell.org/package/ghc-debug-brick) and it will show the running hledger process. Press enter to connect. This is not robust. Tips: +Now in another window, you can run [ghc-debug-brick](https://hackage.haskell.org/package/ghc-debug-brick) and it will show the hledger process (until it ends). Press enter to connect. This is not robust. Tips: - you might need to clear out stale sockets: `rm -f ~/.local/share/ghc-debug/debuggee/sockets/*` - you might need to kill stale hledger processes: `pkill -fl hledger` - it might still fail with this error, reasons unclear:\