Skip to content

Commit

Permalink
Only use gtar on OpenBSD for xz archives (commercialhaskell#2283)
Browse files Browse the repository at this point in the history
Since OpenBSD's tar does not support xz, use only `gtar` there. Stick to
`tar` elsewhere.

The UX is not perfect but it's already useful.
  • Loading branch information
Blaisorblade committed Aug 8, 2016
1 parent b3f8352 commit d4417fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Stack/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -819,10 +819,16 @@ installGHCPosix version _ archiveFile archiveType destDir = do
TarBz2 -> return "bzip2"
TarGz -> return "gzip"
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
let tarDep =
case (platform, archiveType) of
(Platform _ Cabal.OpenBSD, TarXz) -> checkDependency "gtar"
_ -> checkDependency "tar"
(zipTool, makeTool, tarTool) <- checkDependencies $ (,,)
<$> checkDependency zipTool'
<*> (checkDependency "gmake" <|> checkDependency "make")
<*> checkDependency "tar"
<*> tarDep

$logDebug $ "ziptool: " <> T.pack zipTool
$logDebug $ "make: " <> T.pack makeTool
Expand Down

0 comments on commit d4417fb

Please sign in to comment.