Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
302b0dce
Commit
302b0dce
authored
May 11, 2014
by
bardur.arantsson
Committed by
tibbe
Jun 24, 2014
Browse files
Print full build log instead of only the last 10 lines
(cherry picked from commit
f00dc68e
)
parent
ffd67e5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/Install.hs
View file @
302b0dce
...
...
@@ -1051,8 +1051,8 @@ executeInstallPlan verbosity jobCtl useLogFile plan0 installPkg =
-- now cannot build, we mark as failing due to 'DependentFailed'
-- which kind of means it was not their fault.
-- Print
last 10 lines of the
build log if something went wrong, and
--
'Installed $PKGID'
otherwise.
-- Print build log if something went wrong, and
'Installed $PKGID'
-- otherwise.
printBuildResult
::
PackageId
->
BuildResult
->
IO
()
printBuildResult
pkgid
buildResult
=
case
buildResult
of
(
Right
_
)
->
notice
verbosity
$
"Installed "
++
display
pkgid
...
...
@@ -1063,17 +1063,11 @@ executeInstallPlan verbosity jobCtl useLogFile plan0 installPkg =
Nothing
->
return
()
Just
(
mkLogFileName
,
_
)
->
do
let
logName
=
mkLogFileName
pkgid
n
=
10
putStr
$
"Last "
++
(
show
n
)
++
" lines of the build log ( "
++
logName
++
" ):
\n
"
printLastNLines
logName
n
printLastNLines
::
FilePath
->
Int
->
IO
()
printLastNLines
path
n
=
do
lns
<-
fmap
lines
$
readFile
path
let
len
=
length
lns
let
toDrop
=
if
(
len
>
n
&&
n
>
0
)
then
(
len
-
n
)
else
0
mapM_
putStrLn
(
drop
toDrop
lns
)
putStr
$
"Build log ( "
++
logName
++
" ):
\n
"
printFile
logName
printFile
::
FilePath
->
IO
()
printFile
path
=
readFile
path
>>=
putStr
-- | Call an installer for an 'SourcePackage' but override the configure
-- flags with the ones given by the 'ReadyPackage'. In particular the
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment