Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup-hs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
ghcup-hs
Commits
655ee432
Verified
Commit
655ee432
authored
3 years ago
by
Julian Ospald
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/merge-requests/231'
parents
66961101
67b7b2f2
No related branches found
No related tags found
1 merge request
!231
Don't print to stdout during logging
Pipeline
#46284
passed
3 years ago
Stage: checks
Stage: quick-test
Stage: test
Stage: expensive-test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/GHCup/Utils/File/Posix.hs
+4
-3
4 additions, 3 deletions
lib/GHCup/Utils/File/Posix.hs
lib/GHCup/Utils/File/Windows.hs
+2
-1
2 additions, 1 deletion
lib/GHCup/Utils/File/Windows.hs
with
6 additions
and
4 deletions
lib/GHCup/Utils/File/Posix.hs
+
4
−
3
View file @
655ee432
...
@@ -35,6 +35,7 @@ import Data.Sequence ( Seq, (|>) )
...
@@ -35,6 +35,7 @@ import Data.Sequence ( Seq, (|>) )
import
Data.List
import
Data.List
import
Data.Word8
import
Data.Word8
import
GHC.IO.Exception
import
GHC.IO.Exception
import
System.IO
(
stderr
)
import
System.IO.Error
import
System.IO.Error
import
System.FilePath
import
System.FilePath
import
System.Directory
import
System.Directory
...
@@ -142,14 +143,14 @@ execLogged exe args chdir lfile env = do
...
@@ -142,14 +143,14 @@ execLogged exe args chdir lfile env = do
printToRegion
::
Fd
->
Fd
->
Int
->
MVar
Bool
->
Bool
->
IO
()
printToRegion
::
Fd
->
Fd
->
Int
->
MVar
Bool
->
Bool
->
IO
()
printToRegion
fileFd
fdIn
size
pState
no_color
=
do
printToRegion
fileFd
fdIn
size
pState
no_color
=
do
-- init region
-- init region
forM_
[
1
..
size
]
$
\
_
->
BS
.
putSt
r
"
\n
"
forM_
[
1
..
size
]
$
\
_
->
BS
.
hPut
stder
r
"
\n
"
void
$
flip
runStateT
mempty
void
$
flip
runStateT
mempty
$
do
$
do
handle
handle
(
\
(
ex
::
SomeException
)
->
do
(
\
(
ex
::
SomeException
)
->
do
ps
<-
liftIO
$
takeMVar
pState
ps
<-
liftIO
$
takeMVar
pState
when
ps
(
liftIO
$
BS
.
putSt
r
(
pos1
<>
moveLineUp
size
<>
clearScreen
))
when
ps
(
liftIO
$
BS
.
hPut
stder
r
(
pos1
<>
moveLineUp
size
<>
clearScreen
))
throw
ex
throw
ex
)
$
readTilEOF
lineAction
fdIn
)
$
readTilEOF
lineAction
fdIn
...
@@ -184,7 +185,7 @@ execLogged exe args chdir lfile env = do
...
@@ -184,7 +185,7 @@ execLogged exe args chdir lfile env = do
Just
(
TP
.
Window
_
w
)
->
do
Just
(
TP
.
Window
_
w
)
->
do
regs
<-
get
regs
<-
get
liftIO
$
forM_
(
Sq
.
zip
regs
(
Sq
.
fromList
[
0
..
(
Sq
.
length
regs
-
1
)]))
$
\
(
bs
,
i
)
->
do
liftIO
$
forM_
(
Sq
.
zip
regs
(
Sq
.
fromList
[
0
..
(
Sq
.
length
regs
-
1
)]))
$
\
(
bs
,
i
)
->
do
BS
.
putSt
r
BS
.
hPut
stder
r
.
overwriteNthLine
(
size
-
i
)
.
overwriteNthLine
(
size
-
i
)
.
trim
w
.
trim
w
.
blue
.
blue
...
...
This diff is collapsed.
Click to expand it.
lib/GHCup/Utils/File/Windows.hs
+
2
−
1
View file @
655ee432
...
@@ -196,7 +196,8 @@ execLogged exe args chdir lfile env = do
...
@@ -196,7 +196,8 @@ execLogged exe args chdir lfile env = do
then
pure
()
then
pure
()
else
do
else
do
void
$
BS
.
appendFile
logFile
some
void
$
BS
.
appendFile
logFile
some
void
$
BS
.
hPut
stdout
some
-- subprocess stdout also goes to stderr for logging
void
$
BS
.
hPut
stderr
some
go
go
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment