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
cff887e3
Commit
cff887e3
authored
Jan 15, 2015
by
Andrey Mokhov
Browse files
Add argSizeLimit function (mainly for Ar builder).
parent
d52b4c94
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Package/Base.hs
View file @
cff887e3
...
...
@@ -9,7 +9,8 @@ module Package.Base (
commonCcArgs
,
commonLdArgs
,
commonCppArgs
,
commonCcWarninigArgs
,
bootPkgConstraints
,
pathArgs
,
packageArgs
,
includeArgs
,
pkgHsSources
,
pkgDepObjects
,
pkgLibObjects
pkgDepObjects
,
pkgLibObjects
,
argSizeLimit
)
where
import
Base
...
...
@@ -147,3 +148,14 @@ findModuleFiles pkgData directories suffixes = do
suffix
<-
suffixes
return
$
dir
</>
modPath
++
suffix
return
$
map
(
toStandard
.
normaliseEx
)
files
-- The argument list has a limited size on Windows. Since Windows 7 the limit
-- is 32768 (theoretically). In practice we use 31000 to leave some breathing
-- space for the builder's path & name, auxiliary flags, and other overheads.
-- Use this function to set limits for other operating systems if necessary.
argSizeLimit
::
Action
Int
argSizeLimit
=
do
windows
<-
windowsHost
return
$
if
windows
then
31000
else
1048576
-- surely, 1MB should be enough?
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