Skip to content

Commit

Permalink
fix: make package extraDep intransitive
Browse files Browse the repository at this point in the history
  • Loading branch information
tydeu committed Oct 7, 2024
1 parent 9dac514 commit 00e3d85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/lake/Lake/Build/Package.lean
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,12 @@ def Package.maybeFetchBuildCacheWithWarning (self : Package) := do
def Package.fetchOptRelease := @maybeFetchBuildCacheWithWarning

/--
Build the `extraDepTargets` for the package and its transitive dependencies.
Also fetch pre-built releases for the package's' dependencies.
Build the `extraDepTargets` for the package.
Also, if the package is a dependency, maybe fetch its build cache.
-/
def Package.recBuildExtraDepTargets (self : Package) : FetchM (BuildJob Unit) :=
withRegisterJob s!"{self.name}:extraDep" do
let mut job := BuildJob.nil
-- Build dependencies' extra dep targets
for dep in self.deps do
job := job.mix <| ← dep.extraDep.fetch
-- Fetch build cache if this package is a dependency
if self.name ≠ (← getWorkspace).root.name then
job := job.add <| ← self.maybeFetchBuildCacheWithWarning
Expand Down
3 changes: 3 additions & 0 deletions src/lake/tests/online/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ $LAKE -v -f git.toml build @Cli:extraDep |

./clean.sh
$LAKE -f barrel.lean update
# Test that a barrel is not fetched for an unbuilt dependency
$LAKE -v -f barrel.lean build @test:extraDep |
grep --color "Cli:optBarrel" && exit 1 || true
# Test that barrels are not fetched after the build directory is created.
mkdir -p .lake/packages/Cli/.lake/build
($LAKE -v -f barrel.lean build @Cli:extraDep) |
Expand Down

0 comments on commit 00e3d85

Please sign in to comment.