[commit: ghc] wip/nfs-locking: Adjust cmdLineLengthLimit for OS X (e3d96ff)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:04:18 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/e3d96ff27fb0967053043b0d30c0fb4112889613/ghc

>---------------------------------------------------------------

commit e3d96ff27fb0967053043b0d30c0fb4112889613
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Sat Jan 9 21:45:08 2016 +0800

    Adjust cmdLineLengthLimit for OS X
    
    This should fix #141.


>---------------------------------------------------------------

e3d96ff27fb0967053043b0d30c0fb4112889613
 src/Oracles/Config/Setting.hs | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/Oracles/Config/Setting.hs b/src/Oracles/Config/Setting.hs
index ace9158..58f508b 100644
--- a/src/Oracles/Config/Setting.hs
+++ b/src/Oracles/Config/Setting.hs
@@ -3,7 +3,7 @@ module Oracles.Config.Setting (
     setting, settingList, getSetting, getSettingList,
     anyTargetPlatform, anyTargetOs, anyTargetArch, anyHostOs, windowsHost,
     ghcWithInterpreter, ghcEnableTablesNextToCode, useLibFFIForAdjustors,
-    ghcCanonVersion, cmdLineLengthLimit
+    ghcCanonVersion, cmdLineLengthLimit, osxHost
     ) where
 
 import Control.Monad.Trans.Reader
@@ -125,6 +125,9 @@ anyHostOs = matchSetting HostOs
 windowsHost :: Action Bool
 windowsHost = anyHostOs ["mingw32", "cygwin32"]
 
+osxHost :: Action Bool
+osxHost = anyHostOs ["darwin"]
+
 ghcWithInterpreter :: Action Bool
 ghcWithInterpreter = do
     goodOs <- anyTargetOs [ "mingw32", "cygwin32", "linux", "solaris2"
@@ -156,6 +159,10 @@ ghcCanonVersion = do
 cmdLineLengthLimit :: Action Int
 cmdLineLengthLimit = do
     windows <- windowsHost
-    return $ if windows
-             then 31000
-             else 4194304 -- Cabal needs a bit more than 2MB!
+    osx     <- osxHost
+    return $ case (windows, osx) of
+        -- windows
+        (True, False) -> 31000
+        -- osx 262144 is ARG_MAX, 33166 experimentally determined
+        (False, True) -> 262144 - 33166
+        _             -> 4194304 -- Cabal needs a bit more than 2MB!



More information about the ghc-commits mailing list