Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit d144cf6

Browse files
fendorAnrock
authored andcommitted
Remove dist target
1 parent d049fdf commit d144cf6

File tree

1 file changed

+1
-52
lines changed

1 file changed

+1
-52
lines changed

install.hs

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@
55
runghc
66
--package shake
77
--package directory
8-
--package tar
9-
--package zlib
108
-}
11-
12-
import qualified Data.ByteString.Lazy as BS
13-
import qualified Codec.Archive.Tar as Tar
14-
import qualified Codec.Compression.GZip as GZip
15-
169
import Development.Shake
1710
import Development.Shake.Command
1811
import Development.Shake.FilePath
@@ -40,8 +33,7 @@ hieVersions =
4033
["8.2.1", "8.2.2", "8.4.2", "8.4.3", "8.4.4", "8.6.1", "8.6.2", "8.6.3", "8.6.4"]
4134

4235
-- |Most recent version of hie.
43-
-- Important for `dist`, the `hie-wrapper` of the most recent hie
44-
-- will be copied to the tar-archive.
36+
-- Shown in the more concise help message.
4537
mostRecentHieVersion :: VersionNumber
4638
mostRecentHieVersion = last hieVersions
4739

@@ -61,7 +53,6 @@ main = do
6153
phony "short-help" shortHelpMessage
6254
phony "all" shortHelpMessage
6355
phony "help" helpMessage
64-
phony "dist" buildDist
6556

6657
phony "cabal-ghcs" $ do
6758
let
@@ -129,47 +120,6 @@ main = do
129120
phony "icu-macos-fix-install" (command_ [] "brew" ["install", "icu4c"])
130121
phony "icu-macos-fix-build" $ mapM_ buildIcuMacosFix hieVersions
131122

132-
-- |Creates a compressed tar-archive consisting of all hie versions and `hie-wrapper`.
133-
-- Creates a temporary folder, copies all hie versions to it and compresses it in the end.
134-
buildDist :: Action ()
135-
buildDist = do
136-
need ["submodules"]
137-
need ["cabal"]
138-
-- Create the name of the resulting tar file.
139-
Stdout gitRef' <- command [] "git" ["describe", "--tags"]
140-
let gitRef = trim gitRef'
141-
let hieDistName = concat ["hie-", gitRef, "-", arch, "-", os]
142-
-- define name constants for later use
143-
let hieWrapper = "hie-wrapper" <.> exe
144-
let hie = "hie" <.> exe
145-
let mkHie version = "hie-" ++ version <.> exe
146-
147-
withTempDir
148-
(\temporaryDir -> do
149-
forM_ hieVersions $ \hieVersion -> do
150-
stackBuildHie hieVersion
151-
-- after building `hie` copy it to the temporary folder
152-
localInstallRoot <- getLocalInstallRoot hieVersion
153-
copyFile' (localInstallRoot </> "bin" </> hie)
154-
(temporaryDir </> mkHie hieVersion)
155-
156-
-- if the most recent hie-* version is copied,
157-
-- copy it again as the default hie version
158-
-- Also, add its hie-wrapper to the tar archive
159-
when (hieVersion == mostRecentHieVersion) $ do
160-
copyFile' (localInstallRoot </> "bin" </> hieWrapper)
161-
(temporaryDir </> hieWrapper)
162-
copyFile' (localInstallRoot </> "bin" </> hie) (temporaryDir </> hie)
163-
164-
-- After every hie has been built, pack them into a tar.
165-
-- Encrypt the resulting tar file with gzip
166-
liftIO
167-
$ BS.writeFile (hieDistName ++ ".tar.gz")
168-
. GZip.compress
169-
. Tar.write
170-
=<< Tar.pack temporaryDir (hieWrapper : hie : map mkHie hieVersions)
171-
)
172-
return ()
173123

174124
buildIcuMacosFix :: VersionNumber -> Action ()
175125
buildIcuMacosFix version = execStackWithYaml_
@@ -356,7 +306,6 @@ helpMessage = do
356306
, ( "cabal"
357307
, "Makes sure that Cabal the lib is available for cabal-helper-wapper, to speed up project start"
358308
)
359-
, ("dist", "Creates a tarball containing all the hie binaries")
360309
]
361310

362311
macosTargets = [("icu-macos-fix", "Fixes icu related problems in MacOS")]

0 commit comments

Comments
 (0)