Use Cabal directly in place of ghc-cabal + make build root configurable (#531)
[hadrian.git] / src / Rules / SourceDist.hs
index 879ae34..a28da83 100644 (file)
@@ -4,15 +4,15 @@ import Hadrian.Oracles.DirectoryContents
 
 import Base
 import Builder
-import Oracles.Config.Setting
+import Oracles.Setting
 import Rules.Clean
-import UserSettings
-import Util
 
 sourceDistRules :: Rules ()
 sourceDistRules = do
     "sdist-ghc" ~> do
-        cleanSourceTree -- We clean the source tree first, see #384
+        -- We clean the source tree first.
+        -- See https://github.com/snowleopard/hadrian/issues/384.
+        -- cleanSourceTree
         version <- setting ProjectVersion
         need ["sdistprep/ghc-" ++ version ++ "-src.tar.xz"]
         putSuccess "| Done"
@@ -21,8 +21,9 @@ sourceDistRules = do
             dropTarXz = dropExtension . dropExtension
             treePath  = "sdistprep/ghc" -/- dropTarXz tarName
         prepareTree treePath
-        runBuilderWith [Cwd "sdistprep/ghc"] Tar
-            ["cJf", ".." -/- tarName, dropTarXz tarName]
+        runBuilderWithCmdOptions [Cwd "sdistprep/ghc"] (Tar Create)
+            ["cJf", ".." -/- tarName,  dropTarXz tarName]
+            ["cJf", ".." -/- tarName] [dropTarXz tarName]
     "GIT_COMMIT_ID" %> \fname ->
         writeFileChanged fname =<< setting ProjectGitCommitId
     "VERSION" %> \fname ->