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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
myPackage.cabal
25 changes: 25 additions & 0 deletions tests/integration/tests/6342-say-ghc-version-in-build/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- Stack outputs the GHC version that it is using during a build.
--
-- See: https://github.com/commercialhaskell/stack/issues/6342

import Control.Monad ( unless )
import Data.Char ( isSpace )
import Data.List ( dropWhileEnd, isInfixOf )
import StackTest

main :: IO ()
main =
-- Query the actual compiler
stackCheckStdout ["query", "compiler", "actual"] $ \compiler -> do
stackCheckStderr ["build"] (expectMessage $ buildWith (trimEnd compiler))

buildWith :: String -> String
buildWith compiler = "build (lib) with " <> compiler

expectMessage :: String -> String -> IO ()
expectMessage msg stderr = do
unless (words msg `isInfixOf` words stderr)
(error $ "Expected message: \n" ++ show msg)

trimEnd :: String -> String
trimEnd = dropWhileEnd isSpace
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
spec-version: 0.36.0

name: myPackage

dependencies:
- base < 5

library:
source-dirs: src
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module Lib where
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
snapshot: ghc-9.10.3
Loading