From b468488a76d11844565cbafad6bf7538b6e57e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Sun, 26 Apr 2020 04:14:51 +0200 Subject: [PATCH] Add tip to scroll up on package build failure. Many users don't get that when they see an error like -- While building package hopenssl-2.2.4 using: they have to scroll up (potentially multiple terminal pages!) to the last output starting with e.g. `hopenssl >`. This adds an explicit call to scroll up to that section, so that this user confusion can be reduced. --- ChangeLog.md | 3 +++ src/Stack/Types/Build.hs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 3595a1af08..8453540126 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -13,6 +13,9 @@ Behavior changes: Other enhancements: +* Build failures now show a hint to scroll up to the corresponding section + [#5279](https://github.com/commercialhaskell/stack/issues/5279) + Bug fixes: diff --git a/src/Stack/Types/Build.hs b/src/Stack/Types/Build.hs index 0b4c32d276..6d03cc62b7 100644 --- a/src/Stack/Types/Build.hs +++ b/src/Stack/Types/Build.hs @@ -348,7 +348,7 @@ showBuildError isBuildingSetup exitCode mtaskProvides execName fullArgs logFiles (True, Nothing) -> "simple Setup.hs" (True, Just taskProvides') -> "custom Setup.hs for package " ++ dropQuotes (packageIdentifierString taskProvides') ) ++ - " using:\n " ++ fullCmd ++ "\n" ++ + " (scroll up to its section to see the error) using:\n " ++ fullCmd ++ "\n" ++ " Process exited with code: " ++ show exitCode ++ (if exitCode == ExitFailure (-9) then " (THIS MAY INDICATE OUT OF MEMORY)"