Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clean-ide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
clean-ide
Commits
0e0c2e94
Verified
Commit
0e0c2e94
authored
Nov 10, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround for System.Process issues on 64-bit Windows
parent
3d9f35cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
Pm/PmDriver.icl
Pm/PmDriver.icl
+15
-11
No files found.
Pm/PmDriver.icl
View file @
0e0c2e94
implementation
module
PmDriver
import
StdArray
,
StdBool
,
StdList
,
StdMisc
,
StdEnum
,
StdStrictLists
import
StdArray
,
StdBool
,
StdList
,
StdMisc
,
StdEnum
,
StdStrictLists
,
StdTuple
from
StdOverloadedList
import
Foldr
,++|,
Hd
,
Any
import
UtilNewlinesFile
,
UtilIO
...
...
@@ -22,7 +22,8 @@ from StdLibMisc import :: Date{..}, :: Time{..}
import
Data
.
Error
import
System
.
FilePath
import
System
.
Process
=>
qualified
::
Either
from
System
.
OS
import
IF_WINDOWS64
import
System
.
Process
=>
qualified
::
Either
(..)
from
Text
import
class
Text
(
split
),
instance
Text
String
verboseInfo
verbose
info
ps
:==
verbi
verbose
info
ps
...
...
@@ -1677,10 +1678,10 @@ OptimiseABC mdn abc_path ps
#
ps
=
showInfo
(
Level2
(
"Optimising ABC for '"
+++
mdn
.
mdn_name
+++
"'."
))
ps
#
(
h
,
ps
)
=
acc_world_instead_of_ps
(
runProcessIO
abcopt
[
abc_path
,
"-o"
,
abcopt_path
]
Nothing
)
ps
|
isError
h
=
(
False
,
updateErrorWindow
[
"failed to execute the ABC optimiser
"
]
ps
)
|
isError
h
=
(
False
,
updateErrorWindow
[
"failed to execute the ABC optimiser
: "
+++
snd
(
fromError
h
)
]
ps
)
#
(
h
,
io
)
=
fromOk
h
#
(
r
,
ps
)
=
acc_world_instead_of_ps
(
waitForProcess
h
)
ps
|
isError
r
=
(
False
,
updateErrorWindow
[
"failed to wait for the ABC optimiser
"
]
ps
)
|
isError
r
=
(
False
,
updateErrorWindow
[
"failed to wait for the ABC optimiser
: "
+++
snd
(
fromError
r
)
]
ps
)
#
ps
=
processIOToErrorWindow
io
ps
|
fromOk
r
<>
0
=
(
False
,
updateErrorWindow
[
"ABC optimiser failed with non-zero exit code "
+++
toString
(
fromOk
r
)
+++
" for "
+++
mdn
.
mdn_name
]
ps
)
=
(
True
,
ps
)
...
...
@@ -1695,10 +1696,10 @@ ByteCodeGen use_optimised_abc mdn abc_path ps
#
ps
=
showInfo
(
Level2
(
"Generating bytecode for '"
+++
mdn
.
mdn_name
+++
"'."
))
ps
#
(
h
,
ps
)
=
acc_world_instead_of_ps
(
runProcessIO
bcgen
[
if
use_optimised_abc
abcopt_path
abc_path
,
"-o"
,
bc_path
]
Nothing
)
ps
|
isError
h
=
(
False
,
updateErrorWindow
[
"failed to execute the bytecode generator
"
]
ps
)
|
isError
h
=
(
False
,
updateErrorWindow
[
"failed to execute the bytecode generator
: "
+++
snd
(
fromError
h
)
]
ps
)
#
(
h
,
io
)
=
fromOk
h
#
(
r
,
ps
)
=
acc_world_instead_of_ps
(
waitForProcess
h
)
ps
|
isError
r
=
(
False
,
updateErrorWindow
[
"failed to wait for the bytecode generator
"
]
ps
)
|
isError
r
=
(
False
,
updateErrorWindow
[
"failed to wait for the bytecode generator
: "
+++
snd
(
fromError
r
)
]
ps
)
#
ps
=
processIOToErrorWindow
io
ps
|
fromOk
r
<>
0
=
(
False
,
updateErrorWindow
[
"bytecode generator failed with non-zero exit code "
+++
toString
(
fromOk
r
)
+++
" for "
+++
mdn
.
mdn_name
]
ps
)
=
(
True
,
ps
)
...
...
@@ -1718,19 +1719,22 @@ ByteCodeLink fileinfo project ps
#
ps
=
showInfo
(
Level2
(
"Linking bytecode for '"
+++
RemovePath
bcpath
+++
"'"
))
ps
#
(
h
,
ps
)
=
acc_world_instead_of_ps
(
runProcessIO
bclink
(
abcpaths
++
[
"-o"
,
bcpath
])
Nothing
)
ps
|
isError
h
=
(
False
,
updateErrorWindow
[
"failed to execute the bytecode linker
"
]
ps
)
|
isError
h
=
(
False
,
updateErrorWindow
[
"failed to execute the bytecode linker
: "
+++
snd
(
fromError
h
)
]
ps
)
#
(
h
,
io
)
=
fromOk
h
#
(
r
,
ps
)
=
acc_world_instead_of_ps
(
waitForProcess
h
)
ps
|
isError
r
=
(
False
,
updateErrorWindow
[
"failed to wait for the bytecode linker
"
]
ps
)
|
isError
r
=
(
False
,
updateErrorWindow
[
"failed to wait for the bytecode linker
: "
+++
snd
(
fromError
r
)
]
ps
)
#
ps
=
processIOToErrorWindow
io
ps
|
fromOk
r
<>
0
=
(
False
,
updateErrorWindow
[
"bytecode linker failed with non-zero exit code "
+++
toString
(
fromOk
r
)]
ps
)
=
(
True
,
ps
)
processIOToErrorWindow
::
!
ProcessIO
!*
GeneralSt
->
*
GeneralSt
processIOToErrorWindow
io
ps
|
IF_WINDOWS64
True
False
=
ps
// FIXME: System.Process is broken on 64-bit windows (see Platform#65)
#
(
out
,
ps
)
=
acc_world_instead_of_ps
(
readPipeBlocking
io
.
stdOut
)
ps
#
(
err
,
ps
)
=
acc_world_instead_of_ps
(
readPipeBlocking
io
.
stdErr
)
ps
|
isError
out
||
isError
err
=
updateErrorWindow
[
"failed to get process output"
]
ps
#
ps
=
showInfo
(
Level3
[
s
\\
s
<-
split
"
\n
"
(
fromOk
err
)
|
size
s
>
1
])
ps
// 1, to also strip \r
#
ps
=
showInfo
(
Level3
[
s
\\
s
<-
split
"
\n
"
(
fromOk
out
)
|
size
s
>
1
])
ps
|
isError
out
||
isError
err
=
updateErrorWindow
[
"failed to get process output"
]
ps
#
ps
=
updateErrorWindow
[
s
\\
s
<-
split
"
\n
"
(
fromOk
err
)
|
size
s
>
1
]
ps
// 1, to also strip \r
#
ps
=
updateErrorWindow
[
s
\\
s
<-
split
"
\n
"
(
fromOk
out
)
|
size
s
>
1
]
ps
#
(_,
ps
)
=
acc_world_instead_of_ps
(
closeProcessIO
io
)
ps
=
ps
Write
Preview
Markdown
is supported
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