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
GHC
Commits
49521c02
Commit
49521c02
authored
Dec 31, 2015
by
Andrey Mokhov
Browse files
Track wrapped binary.
parent
7cf7210e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Rules/Program.hs
View file @
49521c02
...
...
@@ -29,6 +29,11 @@ buildProgram _ target @ (PartialTarget stage pkg) = do
let
match
file
=
case
programPath
stage
pkg
of
Nothing
->
False
Just
program
->
program
==
file
matchWrapped
file
=
case
programPath
stage
pkg
of
Nothing
->
False
Just
program
->
case
computeWrappedPath
program
of
Nothing
->
False
Just
wrappedProgram
->
wrappedProgram
==
file
match
?>
\
bin
->
do
windows
<-
windowsHost
...
...
@@ -37,15 +42,16 @@ buildProgram _ target @ (PartialTarget stage pkg) = do
else
case
find
((
==
target
)
.
fst
)
wrappers
of
Nothing
->
buildBinary
target
bin
-- No wrapper found
Just
(
_
,
wrapper
)
->
do
wrappedBin
<-
moveToLib
bin
buildBinary
target
wrappedBin
let
Just
wrappedBin
=
computeWrappedPath
bin
need
[
wrappedBin
]
buildWrapper
target
wrapper
bin
wrappedBin
matchWrapped
?>
\
bin
->
buildBinary
target
bin
-- Replace programInplacePath with programInplaceLibPath in a given path
moveToLib
::
FilePath
->
Action
FilePath
moveToLib
path
=
case
stripPrefix
programInplacePath
path
of
Just
suffix
->
return
$
programInplaceLibPath
++
suffix
Nothing
->
putError
$
"moveToLib: cannot move "
++
path
computeWrappedPath
::
FilePath
->
Maybe
FilePath
computeWrappedPath
=
fmap
(
programInplaceLibPath
++
)
.
stripPrefix
programInplacePath
buildWrapper
::
PartialTarget
->
Wrapper
->
FilePath
->
FilePath
->
Action
()
buildWrapper
target
@
(
PartialTarget
stage
pkg
)
wrapper
wrapperPath
binPath
=
do
...
...
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