Skip to content
GitLab
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
f00dc68e
Commit
f00dc68e
authored
May 11, 2014
by
bardur.arantsson
Browse files
Print full build log instead of only the last 10 lines
parent
e417655d
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/Install.hs
View file @
f00dc68e
...
...
@@ -1048,8 +1048,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
...
...
@@ -1060,17 +1060,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
.
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