Skip to content

Commit 7d2a6b5

Browse files
jasagredoMikolaj
authored andcommitted
Reenable PkgConfigParse on Windows
(cherry picked from commit e420708)
1 parent 44486b9 commit 7d2a6b5

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed
113 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
path = "FINDSH\sh.exe"
2+
args = "pkg-config"
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
import System.Directory
12
import Test.Cabal.Prelude
23

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

0 commit comments

Comments
 (0)