Skip to content

Commit 4179967

Browse files
committed
Fix rebuild on changing package location in stack.yaml
1 parent 53d70ae commit 4179967

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Stack/Build/ConstructPlan.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ addFinal lp package isAllInOne = do
359359
, taskPresent = present
360360
, taskType = TTLocal lp
361361
, taskAllInOne = isAllInOne
362-
, taskCachePkgSrc = CacheSrcLocal
362+
, taskCachePkgSrc = CacheSrcLocal (toFilePath (lpDir lp))
363363
}
364364
tell mempty { wFinals = Map.singleton (packageName package) res }
365365

@@ -774,7 +774,7 @@ describeConfigDiff config old new
774774

775775
newComponents = configCacheComponents new `Set.difference` configCacheComponents old
776776

777-
pkgSrcName CacheSrcLocal = "local source"
777+
pkgSrcName (CacheSrcLocal fp) = T.pack fp
778778
pkgSrcName CacheSrcUpstream = "upstream source"
779779

780780
psForceDirty :: PackageSource -> Bool

src/Stack/SDist.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ getSDistFileList lp =
239239
}
240240
, taskPresent = Map.empty
241241
, taskAllInOne = True
242-
, taskCachePkgSrc = CacheSrcLocal
242+
, taskCachePkgSrc = CacheSrcLocal (toFilePath (lpDir lp))
243243
}
244244

245245
normalizeTarballPaths :: (StackM env m) => [FilePath] -> m [FilePath]

src/Stack/Types/Build.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,17 +402,17 @@ data ConfigCache = ConfigCache
402402
instance Store ConfigCache
403403
instance NFData ConfigCache
404404

405-
data CachePkgSrc = CacheSrcUpstream | CacheSrcLocal
405+
data CachePkgSrc = CacheSrcUpstream | CacheSrcLocal FilePath
406406
deriving (Generic, Eq, Show, Data, Typeable)
407407
instance Store CachePkgSrc
408408
instance NFData CachePkgSrc
409409

410410
toCachePkgSrc :: PackageSource -> CachePkgSrc
411-
toCachePkgSrc PSLocal{} = CacheSrcLocal
411+
toCachePkgSrc (PSLocal lp) = CacheSrcLocal (toFilePath (lpDir lp))
412412
toCachePkgSrc PSUpstream{} = CacheSrcUpstream
413413

414414
configCacheVC :: VersionConfig ConfigCache
415-
configCacheVC = storeVersionConfig "config-v2" "IU16Mr9HCSnOm0APqrPUvCW0adw="
415+
configCacheVC = storeVersionConfig "config-v3" "z7N_NxX7Gbz41Gi9AGEa1zoLE-4="
416416

417417
-- | A task to perform when building
418418
data Task = Task

0 commit comments

Comments
 (0)