Skip to content

Commit 11ccbce

Browse files
committed
chore: lake: revert use of Lake plugin (#7608)
This PR removes the use of the Lake plugin in the Lake build and in configuration files. With #7399, the plugin is no longer necessary and may be the source of some persistent intermittent Lake test failures. (cherry picked from commit 131b458)
1 parent fe96d76 commit 11ccbce

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

src/lake/Lake/CLI/Serve.lean

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ def setupFile
4545
paths := {
4646
oleanPath := loadConfig.lakeEnv.leanPath
4747
srcPath := loadConfig.lakeEnv.leanSrcPath
48-
loadDynlibPaths := #[]
49-
pluginPaths := #[loadConfig.lakeEnv.lake.sharedLib]
5048
}
5149
setupOptions := ⟨∅⟩
5250
: FileSetupInfo
@@ -59,15 +57,11 @@ def setupFile
5957
let outLv := buildConfig.verbosity.minLogLv
6058
let ws ← MainM.runLoggerIO (minLv := outLv) (ansiMode := .noAnsi) do
6159
loadWorkspace loadConfig
62-
-- Imperfect heuristic for determine when the Lake plugin is needed.
63-
let usesLake := imports.any (·.startsWith "Lake")
6460
let imports := imports.foldl (init := #[]) fun imps imp =>
6561
if let some mod := ws.findModule? imp.toName then imps.push mod else imps
6662
let {dynlibs, plugins} ←
6763
MainM.runLogIO (minLv := outLv) (ansiMode := .noAnsi) do
6864
ws.runBuild (buildImportsAndDeps path imports) buildConfig
69-
let plugins :=
70-
if usesLake then plugins.push ws.lakeEnv.lake.sharedLib else plugins
7165
let paths : LeanPaths := {
7266
oleanPath := ws.leanPath
7367
srcPath := ws.leanSrcPath

src/lake/tests/setupFile/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ LAKE=${LAKE:-../../.lake/build/bin/lake}
66
# Test `setup-file` functionality
77
#---
88

9-
# Test that, by default. no plugins are used.
9+
# Test that, by default, no plugins are used.
1010
$LAKE setup-file bogus Foo | grep -F --color '"pluginPaths":[]'
1111

12-
# Test that a Lake import uses the Lake plugin.
13-
$LAKE setup-file bogus Lake | (grep -F --color '"pluginPaths":[]' && exit 1 || true)
12+
# Test that, by default, no dynlibs are used.
13+
$LAKE setup-file bogus Foo | grep -F --color '"loadDynlibPaths":[]'
1414

1515
# Test that `setup-file` on an invalid Lean configuration file succeeds.
1616
$LAKE -f invalid.lean setup-file invalid.lean Lake

src/lakefile.toml.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,3 @@ globs = [
4444
[[lean_lib]]
4545
name = "Lake"
4646
srcDir = "lake"
47-
moreLeanArgs = ["--plugin=${PREV_STAGE}/${CMAKE_RELATIVE_LIBRARY_OUTPUT_DIRECTORY}/libLake_shared${CMAKE_SHARED_LIBRARY_SUFFIX}"]

src/stdlib.make.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ leanshared: ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libleanshared${CMAKE_SHARED_LIBRAR
101101

102102
Lake:
103103
# lake is in its own subdirectory, so must adjust relative paths...
104-
+"${LEAN_BIN}/leanmake" -C lake lib lib.export ../${LIB}/temp/LakeMain.o.export PKG=Lake $(LEANMAKE_OPTS) OUT="../${LIB}" LIB_OUT="../${LIB}/lean" TEMP_OUT="../${LIB}/temp" OLEAN_OUT="../${LIB}/lean" LEAN_OPTS+="--plugin=${PREV_STAGE}/${CMAKE_RELATIVE_LIBRARY_OUTPUT_DIRECTORY}/libLake_shared${CMAKE_SHARED_LIBRARY_SUFFIX}" EXTRA_SRC_ROOTS=LakeMain.lean
104+
+"${LEAN_BIN}/leanmake" -C lake lib lib.export ../${LIB}/temp/LakeMain.o.export PKG=Lake $(LEANMAKE_OPTS) OUT="../${LIB}" LIB_OUT="../${LIB}/lean" TEMP_OUT="../${LIB}/temp" OLEAN_OUT="../${LIB}/lean" EXTRA_SRC_ROOTS=LakeMain.lean
105105

106106
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libLake_shared${CMAKE_SHARED_LIBRARY_SUFFIX}: ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libInit_shared${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libleanshared_1${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libleanshared${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIB}/temp/libLean.a.export ${LIB}/temp/libLake.a.export
107107
@echo "[ ] Building $@"

0 commit comments

Comments
 (0)