Skip to content

Commit 6d8f2b5

Browse files
felixonmarsmgsloan
authored andcommitted
Use path-0.6
1 parent 8b022c8 commit 6d8f2b5

12 files changed

Lines changed: 21 additions & 14 deletions

File tree

src/Stack/Build/Execute.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ singleBuild runInBase ac@ActionContext {..} ee@ExecuteEnv {..} task@Task {..} in
12181218
-- Only pay attention to precompiled caches that refer to packages within
12191219
-- the snapshot.
12201220
Just pc | maybe False
1221-
(bcoSnapInstallRoot eeBaseConfigOpts `isParentOf`)
1221+
(bcoSnapInstallRoot eeBaseConfigOpts `isProperPrefixOf`)
12221222
(parseAbsFile =<< pcLibrary pc) ->
12231223
return Nothing
12241224
-- If old precompiled cache files are left around but snapshots are deleted,
@@ -1768,7 +1768,7 @@ mungeBuildOutput excludeTHLoading makeAbsolute pkgDir compilerVer = void $
17681768
if isValidSuffix y
17691769
then liftIO $ liftM (fmap ((T.takeWhile isSpace x <>) . T.pack . toFilePath)) $
17701770
forgivingAbsence (resolveFile pkgDir (T.unpack $ T.dropWhile isSpace x)) `catch`
1771-
\(_ :: PathParseException) -> return Nothing
1771+
\(_ :: PathException) -> return Nothing
17721772
else return Nothing
17731773
case mabs of
17741774
Nothing -> return bs

src/Stack/Build/Target.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ parseRawTargetDirs root locals ri =
166166
names -> return $ Right $ map ((ri, ) . RTPackage) names
167167
where
168168
childOf dir (name, lpv) =
169-
if dir == lpvRoot lpv || isParentOf dir (lpvRoot lpv)
169+
if dir == lpvRoot lpv || isProperPrefixOf dir (lpvRoot lpv)
170170
then Just name
171171
else Nothing
172172

src/Stack/Config.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ loadProjectConfig mstackYaml = do
906906
LCSProject fp -> do
907907
currDir <- getCurrentDir
908908
$logDebug $ "Loading project config file " <>
909-
T.pack (maybe (toFilePath fp) toFilePath (stripDir currDir fp))
909+
T.pack (maybe (toFilePath fp) toFilePath (stripProperPrefix currDir fp))
910910
LCSProject <$> load fp
911911
LCSNoProject -> do
912912
$logDebug $ "No project config file found, using defaults."

src/Stack/Coverage.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ generateHpcMarkupIndex = do
344344
let indexPath = subdir </> $(mkRelFile "hpc_index.html")
345345
exists' <- doesFileExist indexPath
346346
if not exists' then return Nothing else do
347-
relPath <- stripDir outputDir indexPath
347+
relPath <- stripProperPrefix outputDir indexPath
348348
let package = dirname dir
349349
testsuite = dirname subdir
350350
return $ Just $ T.concat

src/Stack/Ghci.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ getPackageOptsAndTargetFiles pwd pkg = do
779779
-- FIXME: use compilerOptionsCabalFlag
780780
map ("--ghc-option=" ++) (concatMap (ghcOptions . snd) (ghciPkgOpts pkg))
781781
, mapMaybe
782-
(fmap toFilePath . stripDir pwd)
782+
(fmap toFilePath . stripProperPrefix pwd)
783783
(S.toList (ghciPkgCFiles pkg) <> S.toList (ghciPkgModFiles pkg) <>
784784
[paths_foo | paths_foo_exists]))
785785

src/Stack/Init.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ initProject whichCmd currDir initOpts mresolver = do
127127
}
128128

129129
makeRelDir dir =
130-
case stripDir currDir dir of
130+
case stripProperPrefix currDir dir of
131131
Nothing
132132
| currDir == dir -> "."
133133
| otherwise -> assert False $ toFilePathNoTrailingSep dir

src/Stack/Package.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ makeObjectFilePathFromC
497497
-> Path Abs File -- ^ The path to the .c file.
498498
-> m (Path Abs File) -- ^ The path to the .o file for the component.
499499
makeObjectFilePathFromC cabalDir namedComponent distDir cFilePath = do
500-
relCFilePath <- stripDir cabalDir cFilePath
500+
relCFilePath <- stripProperPrefix cabalDir cFilePath
501501
relOFilePath <-
502502
parseRelFile (replaceExtension (toFilePath relCFilePath) "o")
503503
addComponentPrefix <- fileGenDirFromComponentName namedComponent
@@ -991,7 +991,7 @@ getDependencies component dotCabalPath =
991991
readResolvedHi resolvedFile = do
992992
dumpHIDir <- getDumpHIDir
993993
dir <- asks (parent . fst)
994-
case stripDir dir resolvedFile of
994+
case stripProperPrefix dir resolvedFile of
995995
Nothing -> return (S.empty, [])
996996
Just fileRel -> do
997997
let dumpHIPath =
@@ -1243,7 +1243,7 @@ resolveOrWarn subject resolver path =
12431243
result <- resolver dir path
12441244
when (isNothing result) $
12451245
$logWarn ("Warning: " <> subject <> " listed in " <>
1246-
T.pack (maybe (FL.toFilePath file) FL.toFilePath (stripDir cwd file)) <>
1246+
T.pack (maybe (FL.toFilePath file) FL.toFilePath (stripProperPrefix cwd file)) <>
12471247
" file does not exist: " <>
12481248
T.pack path)
12491249
return result

src/Stack/Solver.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,5 +754,5 @@ prettyPath
754754
prettyPath path = do
755755
eres <- liftIO $ try $ makeRelativeToCurrentDir path
756756
return $ case eres of
757-
Left (_ :: PathParseException) -> toFilePath path
757+
Left (_ :: PathException) -> toFilePath path
758758
Right res -> toFilePath (res :: Path Rel t)

stack-7.10.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ extra-deps:
4040
- unliftio-0.1.0.0
4141
- async-2.1.1.1
4242
- bindings-uname-0.1
43+
- path-0.6.1
44+
- path-io-1.3.3
45+
- dlist-0.8.0.3

stack-nightly.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ extra-deps:
1717
- mintty-0.1.1
1818
- text-metrics-0.3.0
1919
- bindings-uname-0.1
20+
- path-0.6.1
21+
- path-io-1.3.3

0 commit comments

Comments
 (0)