Skip to content

Commit f494fe1

Browse files
committed
Normalise Filepaths for target matching
1 parent 9ae54f4 commit f494fe1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cabal-install/Distribution/Client/TargetSelector.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,6 +2124,7 @@ matchComponentOtherFile cs =
21242124
++ cinfoCFiles c
21252125
++ cinfoJsFiles c
21262126
]
2127+
. normalise
21272128

21282129

21292130
matchComponentModuleFile :: [KnownComponent] -> String

cabal-install/tests/IntegrationTests2.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ testTargetSelectors reportSubCase = do
255255
ts @?= replicate 5 (TargetComponent "p-0.1" (CLibName LMainLibName) (FileTarget "P"))
256256
++ replicate 5 (TargetComponent "q-0.1" (CLibName LMainLibName) (FileTarget "QQ"))
257257
++ replicate 5 (TargetComponent "q-0.1" (CLibName LMainLibName) (FileTarget "Q"))
258-
++ replicate 5 (TargetComponent "p-0.1" (CExeName "ppexe") (FileTarget "app/Main.hs"))
258+
++ replicate 5 (TargetComponent "p-0.1" (CExeName "ppexe") (FileTarget ("app" </> "Main.hs")))
259259
-- Note there's a bit of an inconsistency here: for the single-part
260260
-- syntax the target has to point to a file that exists, whereas for
261261
-- all the other forms we don't require that.

0 commit comments

Comments
 (0)