-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: lake: track trace of cached build logs (#4343)
Stores the dependency trace for a build in the cached build log and then verifies that it matches the trace of the current build before replaying the log. Includes test. Closes #4303.
- Loading branch information
Showing
9 changed files
with
69 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
def hello := "foo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Hello | ||
|
||
def main (args : List String) : IO Unit := | ||
IO.println s!"Hello, {hello}!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rm -rf .lake lake-manifest.json Hello.lean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Lake | ||
open Lake DSL | ||
|
||
package test | ||
|
||
lean_lib Hello | ||
|
||
@[default_target] | ||
lean_exe hello where | ||
root := `Main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
|
||
LAKE=${LAKE:-../../.lake/build/bin/lake} | ||
|
||
./clean.sh | ||
|
||
# Test that introducing an error and reverting works | ||
# https://github.com/leanprover/lean4/issues/4303 | ||
|
||
# Initial state | ||
echo 'def hello := "foo"' > Hello.lean | ||
$LAKE -q build | ||
# Introduce error | ||
echo 'error' > Hello.lean | ||
$LAKE build && exit 1 || true | ||
# Revert | ||
echo 'def hello := "foo"' > Hello.lean | ||
# Ensure error is not presevered but the warning in another file is | ||
$LAKE -q build | grep --color 'Replayed Main' |