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
c02e070c
Commit
c02e070c
authored
Aug 06, 2015
by
Andrey Mokhov
Browse files
Add support for multiple invokations of Ar when argument list is too long.
parent
6c89bd01
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Rules/Actions.hs
View file @
c02e070c
...
...
@@ -7,9 +7,11 @@ import Util
import
Builder
import
Expression
import
qualified
Target
import
Oracles.Setting
import
Oracles.ArgsHash
import
Settings.Args
import
Settings.Util
import
Oracles.ArgsHash
import
Settings.Builders.Ar
-- Build a given target using an appropriate builder and acquiring necessary
-- resources. Force a rebuilt if the argument list has changed since the last
...
...
@@ -29,7 +31,14 @@ buildWithResources rs target = do
++
show
builder
++
" with arguments:"
mapM_
(
putBuild
.
(
"| "
++
))
$
interestingInfo
builder
argList
putBuild
$
"
\\
--------"
quietly
$
cmd
[
path
]
argList
quietly
$
if
builder
/=
Ar
then
cmd
[
path
]
argList
else
do
-- Split argument list into chunks as otherwise Ar chokes up
maxChunk
<-
cmdLineLengthLimit
let
persistentArgs
=
take
arPersistentArgsCount
argList
remainingArgs
=
drop
arPersistentArgsCount
argList
forM_
(
chunksOfSize
maxChunk
remainingArgs
)
$
\
argsChunk
->
unit
.
cmd
[
path
]
$
persistentArgs
++
argsChunk
-- Most targets are built without explicitly acquiring resources
build
::
FullTarget
->
Action
()
...
...
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