fix: lake: afterBuildCache* traces (#6422)

This PR fixes a bug in #6388 where the `Package.afterBuildCahe*`
functions would produce different traces depending on whether the cache
was fetched.
This commit is contained in:
Mac Malone 2024-12-19 23:39:46 -05:00 committed by GitHub
parent 9fca337f38
commit 759da5d52c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -198,9 +198,11 @@ abbrev Package.releaseFacetConfig := gitHubReleaseFacetConfig
Perform a build job after first checking for an (optional) cached build
for the package (e.g., from Reservoir or GitHub).
-/
def Package.afterBuildCacheAsync (self : Package) (build : SpawnM (Job α)) : FetchM (Job α) := do
def Package.afterBuildCacheAsync (self : Package) (build : JobM (Job α)) : FetchM (Job α) := do
if self.name ≠ (← getRootPackage).name then
(← self.maybeFetchBuildCache).bindM fun _ => build
(← self.maybeFetchBuildCache).bindM fun _ => do
setTrace nilTrace -- ensure both branches start with the same trace
build
else
build
@ -213,7 +215,9 @@ def Package.afterReleaseAsync := @afterBuildCacheAsync
-/
def Package.afterBuildCacheSync (self : Package) (build : JobM α) : FetchM (Job α) := do
if self.name ≠ (← getRootPackage).name then
(← self.maybeFetchBuildCache).mapM fun _ => build
(← self.maybeFetchBuildCache).mapM fun _ => do
setTrace nilTrace -- ensure both branches start with the same trace
build
else
Job.async build