[commit: ghc] wip/nfs-locking: Pass arguments as simple lists. (6269a42)

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


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

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

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

commit 6269a42dc3c1f166f8ab913d5cca4a0ed7000f88
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Thu Jan 15 02:07:53 2015 +0000

    Pass arguments as simple lists.


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

6269a42dc3c1f166f8ab913d5cca4a0ed7000f88
 src/Package/Library.hs | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/Package/Library.hs b/src/Package/Library.hs
index 043977a..22c9869 100644
--- a/src/Package/Library.hs
+++ b/src/Package/Library.hs
@@ -2,7 +2,6 @@
 module Package.Library (buildPackageLibrary) where
 
 import Package.Base
-import Data.List.Split
 
 arRule :: Package -> TodoItem -> Rules ()
 arRule (Package _ path _) (stage, dist, _) =
@@ -16,9 +15,11 @@ arRule (Package _ path _) (stage, dist, _) =
         libObjs <- pkgLibObjects path dist stage way
         liftIO $ removeFiles "." [out]
         -- Splitting argument list into chunks as otherwise Ar chokes up
-        -- TODO: use simpler list notation for passing arguments
-        forM_ (chunksOf 100 libObjs) $ \os -> do
-            terseRun Ar $ "q" <+> toStandard out <+> os
+        maxChunk <- argSizeLimit
+        forM_ (chunksOfSize maxChunk libObjs) $ \os -> do
+            terseRun Ar [ arg "q"
+                        , arg $ toStandard out
+                        , arg os ]
 
 ldRule :: Package -> TodoItem -> Rules ()
 ldRule (Package name path _) (stage, dist, _) =
@@ -29,12 +30,14 @@ ldRule (Package name path _) (stage, dist, _) =
         need ["shake/src/Package/Library.hs"]
         depObjs <- pkgDepObjects path dist vanilla
         need depObjs
-        terseRun Ld $ arg (ConfLdLinkerArgs stage)
-            <> arg ["-r", "-o", toStandard out]
-            <> arg depObjs
+        terseRun Ld [ arg (ConfLdLinkerArgs stage)
+                    , arg "-r"
+                    , arg "-o"
+                    , arg $ toStandard out
+                    , arg depObjs ]
         synopsis <- unwords <$> arg (Synopsis pkgData)
-        putNormal $ "Successfully built package " ++ name ++ "." 
-        putNormal $ "Package synopsis: " ++ synopsis ++ "."
+        putNormal $ "/--------\nSuccessfully built package " ++ name ++ "."
+        putNormal $ "Package synopsis: " ++ synopsis ++ ".\n\\--------"
 
 buildPackageLibrary :: Package -> TodoItem -> Rules ()
 buildPackageLibrary = arRule <> ldRule



More information about the ghc-commits mailing list