From 7571b291de58768582ced97700be7b1cf178817e Mon Sep 17 00:00:00 2001 From: David Thrane Christiansen Date: Mon, 20 Oct 2025 09:21:25 +0200 Subject: [PATCH] fix: don't copy giant files to temp containers This makes the build process much more friendly for smaller disks. --- book/FPLean/Examples/Commands.lean | 7 ++++++- book/lake-manifest.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/book/FPLean/Examples/Commands.lean b/book/FPLean/Examples/Commands.lean index b7d359b..b1395c1 100644 --- a/book/FPLean/Examples/Commands.lean +++ b/book/FPLean/Examples/Commands.lean @@ -15,12 +15,17 @@ def ensureContainer (container : Ident) : m Container := do let c : Container := ⟨tmp, {}⟩ let projectRoot : System.FilePath := ".." let copyErrors : IO.Ref (Array String) ← IO.mkRef #[] - Verso.FS.copyRecursively (fun s => copyErrors.modify (·.push s)) projectRoot tmp + Verso.FS.copyRecursively (fun s => copyErrors.modify (·.push s)) projectRoot tmp shouldCopy let errs ← (copyErrors.get : IO _) unless errs.isEmpty do throwErrorAt container "Errors copying project to container {name}: {indentD <| MessageData.joinSep (errs.toList.map toMessageData) Format.line}" modifyEnv (containersExt.modifyState · (·.insert name c)) return c +where + shouldCopy (path : System.FilePath) : IO Bool := do + let some x := path.fileName + | return true + return !(x.startsWith ".") && !(x == "site-packages") && !(x == "_out") && !(x == "static") def requireContainer (container : Ident) : m Container := do let name := container.getId diff --git a/book/lake-manifest.json b/book/lake-manifest.json index 2587717..28dd393 100644 --- a/book/lake-manifest.json +++ b/book/lake-manifest.json @@ -5,7 +5,7 @@ "type": "git", "subDir": null, "scope": "", - "rev": "38b11d9518e544b08b5b27e91197dfdb2b86690a", + "rev": "c68870b3fd3ae8e99ea242bf17197db3b0d39b0f", "name": "verso", "manifestFile": "lake-manifest.json", "inputRev": "main",