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
7b00fa70
Commit
7b00fa70
authored
Oct 30, 2016
by
Andrey Mokhov
Browse files
Fix buildProgram
parent
c5ba8b94
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Rules/Program.hs
View file @
7b00fa70
...
...
@@ -29,15 +29,23 @@ wrappers = [ (vanillaContext Stage0 ghc , ghcWrapper )
buildProgram
::
[(
Resource
,
Int
)]
->
Context
->
Rules
()
buildProgram
rs
context
@
Context
{
..
}
=
when
(
isProgram
package
)
$
do
let
installStage
=
do
latest
<-
latestBuildStage
package
-- isJust below is safe
return
$
if
package
==
ghc
then
stage
else
fromJust
latest
buildPath
context
-/-
programName
context
<.>
exe
%>
buildBinaryAndWrapper
rs
context
-- Rules for programs built in install directories
when
(
stage
==
Stage0
||
package
==
ghc
)
$
installPath
package
-/-
programName
context
<.>
exe
%>
\
bin
->
do
latest
<-
latestBuildStage
package
-- isJust below is safe
let
binStage
=
if
package
==
ghc
then
stage
else
fromJust
latest
when
(
stage
==
Stage0
||
package
==
ghc
)
$
do
-- Some binaries in programInplacePath are wrapped
programInplacePath
-/-
programName
context
<.>
exe
%>
\
bin
->
do
binStage
<-
installStage
buildBinaryAndWrapper
rs
(
context
{
stage
=
binStage
})
bin
-- We build only unwrapped binaries in programInplaceLibPath
programInplaceLibPath
-/-
programName
context
<.>
exe
%>
\
bin
->
do
binStage
<-
installStage
buildBinary
rs
(
context
{
stage
=
binStage
})
bin
buildBinaryAndWrapper
::
[(
Resource
,
Int
)]
->
Context
->
FilePath
->
Action
()
buildBinaryAndWrapper
rs
context
bin
=
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