Skip to content

Commit

Permalink
stack setup: Specify decompressor to tar
Browse files Browse the repository at this point in the history
This supports non-GNU tar programs that do not decompress archives
automatically, such as the OpenBSD one.
  • Loading branch information
Blaisorblade committed Aug 8, 2016
1 parent d4417fb commit 0ae5411
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Stack/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -813,11 +813,11 @@ installGHCPosix version _ archiveFile archiveType destDir = do
menv0 <- getMinimalEnvOverride
menv <- mkEnvOverride platform (removeHaskellEnvVars (unEnvOverride menv0))
$logDebug $ "menv = " <> T.pack (show (unEnvOverride menv))
zipTool' <-
(zipTool', compOpt) <-
case archiveType of
TarXz -> return "xz"
TarBz2 -> return "bzip2"
TarGz -> return "gzip"
TarXz -> return ("xz", 'J')
TarBz2 -> return ("bzip2", 'j')
TarGz -> return ("gzip", 'z')
SevenZ -> error "Don't know how to deal with .7z files on non-Windows"
-- Slight hack: OpenBSD's tar doesn't support xz.
-- https://github.com/commercialhaskell/stack/issues/2283#issuecomment-237980986
Expand All @@ -842,7 +842,7 @@ installGHCPosix version _ archiveFile archiveType destDir = do

$logSticky $ T.concat ["Unpacking GHC into ", T.pack . toFilePath $ root, " ..."]
$logDebug $ "Unpacking " <> T.pack (toFilePath archiveFile)
readInNull root tarTool menv ["xf", toFilePath archiveFile] Nothing
readInNull root tarTool menv [compOpt : "xf", toFilePath archiveFile] Nothing

$logSticky "Configuring GHC ..."
readInNull dir (toFilePath $ dir </> $(mkRelFile "configure"))
Expand Down

0 comments on commit 0ae5411

Please sign in to comment.