Skip to content
Merged
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
26 changes: 13 additions & 13 deletions .github/workflows/debugger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ name: Debugger CI
jobs:
build-vscode-extension:
name: Build VSCode Extension
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -136,12 +136,13 @@ jobs:

# Golden+Haskell tests are run on the git checkout
build-n-more-test-haskell-debugger:
name: Build and Run Haskell Tests
runs-on: ubuntu-latest
# Run all jobs in the matrix to the end (IF NOT ON RELEASE)
name: Build and Run Haskell Tests (${{ matrix.runner }})
runs-on: ${{ matrix.runner }}
# Run all jobs in the matrix to the end (IF RELEASE, STOP ON FAILURE)
continue-on-error: ${{ inputs.is-release == false }}
strategy:
matrix:
runner: [ubuntu-latest, macOS-latest, windows-latest] # it'd be good to also build-from-hackage on windows and macOS
version: [9.14.0.20251104] #, latest-nightly] disable nightly while its broken
include:
# - channel: https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml
Expand All @@ -156,8 +157,7 @@ jobs:
# Cabal store cache (main speed-up)
- uses: actions/cache@v3
with:
path: |
~/.cabal/store
path: ~/.cabal/store
key: ${{ runner.os }}-ghc-${{ matrix.version }}-cabal-${{ hashFiles('**/*.cabal', 'cabal.project*') }}
restore-keys: |
${{ runner.os }}-ghc-${{ matrix.version }}-cabal-
Expand All @@ -168,11 +168,11 @@ jobs:
cabal-version: 3.14
ghcup-release-channel: ${{ matrix.channel }}

- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Build and Run integration tests
- name: Build and Run Haskell tests
shell: bash
run: |
echo "Running Haskell Testsuite now..."
cabal run haskell-debugger-test --enable-executable-dynamic --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell
if [ "$RUNNER_OS" == "Windows" ]; then
cabal run haskell-debugger-test --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell
else
cabal run haskell-debugger-test --enable-executable-dynamic --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell
fi
10 changes: 6 additions & 4 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ packages: . haskell-debugger-view

allow-newer: ghc-bignum,containers,time,ghc,base,template-haskell

package *
-- Speeds up a bit
library-vanilla: False
if !os(windows)
package *
-- Speeds up a bit
library-vanilla: False

executable-dynamic: True
if !os(windows)
executable-dynamic: True

7 changes: 5 additions & 2 deletions haskell-debugger.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ library
mtl >= 2.3 && < 3,
binary >= 0.8.9 && < 0.11,
process >= 1.6.25 && < 1.7,
unix >= 2.8.6 && < 2.9,
filepath >= 1.5.4 && < 1.6,
directory >= 1.3.9.0 && < 1.4,
exceptions >= 0.10.9 && < 0.11,
Expand All @@ -105,6 +104,9 @@ library

haskell-debugger-view >= 0.1 && < 1.0

if !os(windows)
build-depends: unix >= 2.8.6 && < 2.9,

hs-source-dirs: haskell-debugger
default-language: GHC2021

Expand Down Expand Up @@ -137,7 +139,7 @@ executable hdb
base, ghc,
exceptions, aeson, bytestring,
containers, filepath,
process, mtl, unix,
process, mtl,
unordered-containers >= 0.2.19 && < 0.3,

haskell-debugger,
Expand Down Expand Up @@ -187,6 +189,7 @@ test-suite haskell-debugger-test
tasty >= 1.5.3,
tasty-golden >= 2.3.5,
tasty-hunit >= 0.10.2,
tasty-expected-failure >= 0.12.3,
regex >= 1.1
build-tool-depends: haskell-debugger:hdb
ghc-options: -threaded
4 changes: 4 additions & 0 deletions haskell-debugger/GHC/Debugger/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import Data.IORef
import Data.Maybe
import Prelude hiding (mod)
import System.IO
#ifdef MIN_VERSION_unix
import System.Posix.Signals
#endif
import qualified Data.IntMap as IM
import qualified Data.List as L
import qualified Data.List.NonEmpty as NonEmpty
Expand Down Expand Up @@ -161,8 +163,10 @@ runDebugger :: Recorder (WithSeverity DebuggerMonadLog)
runDebugger l dbg_out rootDir compDir libdir units ghcInvocation' extraGhcArgs mainFp conf (Debugger action) = do
let ghcInvocation = filter (\case ('-':'B':_) -> False; _ -> True) ghcInvocation'
GHC.runGhc (Just libdir) $ do
#ifdef MIN_VERSION_unix
-- Workaround #4162
_ <- liftIO $ installHandler sigINT Default Nothing
#endif
dflags0 <- GHC.getSessionDynFlags
let dflags1 = dflags0
{ GHC.ghcMode = GHC.CompManager
Expand Down
6 changes: 5 additions & 1 deletion test/haskell/Main.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# LANGUAGE LambdaCase, OverloadedStrings, ViewPatterns, QuasiQuotes #-}
{-# LANGUAGE LambdaCase, OverloadedStrings, ViewPatterns, QuasiQuotes, CPP #-}
module Main (main) where

import Text.RE.TDFA.Text.Lazy
Expand All @@ -15,6 +15,7 @@ import System.IO
import Control.Exception

import Test.Tasty
import Test.Tasty.ExpectedFailure
import Test.Tasty.Golden as G
import Test.Tasty.Golden.Advanced as G

Expand All @@ -25,6 +26,9 @@ main :: IO ()
main = do
goldens <- mapM (mkGoldenTest False) =<< findByExtension [".hdb-test"] "test/golden"
defaultMain $
#ifdef mingw32_HOST_OS
ignoreTestBecause "Testsuite is not enabled on Windows (#149)" $
#endif
testGroup "Tests"
[ testGroup "Golden tests" goldens
, testGroup "Unit tests" unitTests
Expand Down
8 changes: 7 additions & 1 deletion test/haskell/Test/DAP/RunInTerminal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedRecordDot #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE CPP #-}
module Test.DAP.RunInTerminal (runInTerminalTests) where

import Control.Concurrent
Expand All @@ -17,6 +18,7 @@ import System.Random
import Test.DAP
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.ExpectedFailure
import Test.Utils
import qualified Data.ByteString.Lazy as LBS
import qualified Data.ByteString.Lazy.Char8 as LB8
Expand All @@ -26,7 +28,11 @@ import qualified System.Process as P

runInTerminalTests =
testGroup "DAP.RunInTerminal"
[ testCase "runInTerminal: proxy forwards stdin correctly" runInTerminal1
[
#ifdef mingw32_HOST_OS
ignoreTestBecause "Needs to be fixed for Windows" $
#endif
testCase "runInTerminal: proxy forwards stdin correctly" runInTerminal1
]

rit_keep_tmp_dirs :: Bool
Expand Down
Loading