This repository was archived by the owner on Oct 25, 2023. It is now read-only.
File tree 4 files changed +13
-2
lines changed
4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ def Package.defaultTarget (self : Package) : OpaqueTarget :=
16
16
| .staticLib => self.staticLibTarget.withoutInfo
17
17
| .sharedLib => self.sharedLibTarget.withoutInfo
18
18
| .leanLib | .oleans => self.libTarget.withoutInfo
19
+ | .none => Target.nil
19
20
20
21
def parsePackageSpec (ws : Workspace) (spec : String) : Except CliError Package :=
21
22
if spec.isEmpty then
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ unsafe def loadUnsafe (dir : FilePath) (args : List String := [])
111
111
let exes ← leanExeAttr.ext.getState env |>.foldM (init := {}) fun m d =>
112
112
let eval := env.evalConstCheck LeanExeConfig leanOpts ``LeanExeConfig d
113
113
return m.insert d <| ← IO.ofExcept eval.run.run
114
- if libs.isEmpty && exes.isEmpty then
114
+ if libs.isEmpty && exes.isEmpty && !config.defaultFacet = .none then
115
115
logWarning <| "Package targets are deprecated. " ++
116
116
"Add a `lean_exe` and/or `lean_lib` default target to the package instead."
117
117
let defaultTargets := defaultTargetAttr.ext.getState env |>.toArray
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ inductive PackageFacet
52
52
| /-- The package's shared library. -/ sharedLib
53
53
| /-- The package's lean library (e.g. `olean` / `ilean` files). -/ leanLib
54
54
| /-- The package's `.olean` files. **DEPRECATED:** Use `leanLib` instead. -/ oleans
55
+ | /-- The package has no buildable component. -/ none
55
56
deriving BEq, DecidableEq, Repr
56
57
instance : Inhabited PackageFacet := ⟨PackageFacet.exe⟩
57
58
@@ -221,6 +222,14 @@ structure PackageConfig extends WorkspaceConfig where
221
222
-/
222
223
moreLinkArgs : Array String := #[]
223
224
225
+ /--
226
+ Marks the package as only containing scripts.
227
+
228
+ Used to turn off deprecation warnings about package facets in packages
229
+ not intended to have any targets.
230
+ -/
231
+ scriptsOnly : Bool := false
232
+
224
233
deriving Inhabited
225
234
226
235
namespace PackageConfig
Original file line number Diff line number Diff line change 1
1
import Lake
2
2
open Lake DSL
3
3
4
- package scripts
4
+ package scripts where
5
+ defaultFacet := .none
5
6
6
7
/--
7
8
Display a greeting
You can’t perform that action at this time.
0 commit comments