[commit: ghc] wip/nfs-locking: Add cmdLineLengthLimit for detecting command line size limits. (ef14064)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:16:10 UTC 2017


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

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

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

commit ef1406494d3dc15ab0b311fcaf7e3c853c2a3a81
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Thu Aug 6 01:35:31 2015 +0100

    Add cmdLineLengthLimit for detecting command line size limits.


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

ef1406494d3dc15ab0b311fcaf7e3c853c2a3a81
 src/Oracles/Setting.hs | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/Oracles/Setting.hs b/src/Oracles/Setting.hs
index 33067b1..20e4376 100644
--- a/src/Oracles/Setting.hs
+++ b/src/Oracles/Setting.hs
@@ -3,7 +3,7 @@ module Oracles.Setting (
     setting, settingList,
     targetPlatform, targetPlatforms, targetOs, targetOss, notTargetOs,
     targetArchs, windowsHost, notWindowsHost, ghcWithInterpreter,
-    ghcEnableTablesNextToCode
+    ghcEnableTablesNextToCode, cmdLineLengthLimit
     ) where
 
 import Base
@@ -96,3 +96,14 @@ ghcWithInterpreter = do
 
 ghcEnableTablesNextToCode :: Action Bool
 ghcEnableTablesNextToCode = targetArchs ["ia64", "powerpc64"]
+
+-- Command lines have limited size on Windows. Since Windows 7 the limit is
+-- 32768 characters (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 OSs if necessary.
+cmdLineLengthLimit :: Action Int
+cmdLineLengthLimit = do
+    windows <- windowsHost
+    return $ if windows
+             then 31000
+             else 4194304 -- Cabal needs a bit more than 2MB!



More information about the ghc-commits mailing list