Skip to content

Commit

Permalink
Reenable PkgConfigParse on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Sep 1, 2024
1 parent 1b4e996 commit a5a632b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Binary file not shown.
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/PkgConfigParse/pkg-config.shim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
path = "FINDSH\sh.exe"
args = "pkg-config"
12 changes: 11 additions & 1 deletion cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import System.Directory
import Test.Cabal.Prelude

-- Test that invalid unicode in pkg-config output doesn't trip up cabal very much
main = cabalTest $ expectBrokenIfWindows 10179 $ do
main = cabalTest $ do
when isWindows $ do
sh <- fmap takeDirectory <$> liftIO (findExecutable "sh")
case sh of
Nothing -> skip "no sh"
Just sh' -> do
let sh'' = concatMap (\c -> case c of
'\\' -> "\\\\\\\\"
x -> [x]) sh'
void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "pkg-config.shim"]
cdir <- testCurrentDir `fmap` getTestEnv
res <- cabal' "v2-build" ["--extra-prog-path="++cdir, "-v2"]
assertOutputContains "Some pkg-config packages have names containing invalid unicode: or" res

0 comments on commit a5a632b

Please sign in to comment.