Commit 77f8db0
committed
Replace Spec with RecipeSpec and PackageSpec
This is the first step towards having separate types for the different
variations of specs that are valid in specific contexts. These changes
will be done in a series of PRs to limit the diff size of each change.
In this PR the focus is on embedded packages. In a recipe, an embedded
package spec in a recipe spec is expected to be given a `VersionIdent`,
as in:
```yaml
install:
embedded:
- pkg: example/1.0.0
```
It is now illegal to specify a build id for an embedded package in a
recipe.
When the package is built, the embedded package in a package spec is a
`BuildIdent` to reflect the idea that the embedded package is "built",
such as:
```yaml
install:
embedded:
- pkg: example/1.0.0/embedded
```
Test content has been updated appropriately since this was not enforced
previously.
What is allowed in the `build:` and `install:` sections of an embedded
package is different from a regular package, so `EmbeddedRecipeSpec`
and `EmbeddedPackageSpec` model those differences. These contain
`EmbeddedBuildSpec` and `EmbeddedInstallSpec`.
An `EmbeddedInstallSpec` does not contain an `embedded` field, making it
impossible to nest embedded packages.
`EmbeddedPackagesList` gained a generic parameter for the type of spec
it contains so it can be reused for the two flavors of embedded specs.
`Package::components()` was moved to its own trait to make is possible
to not have `Package` implemented for embedded packages. Note that when
embedded packages are turned into stubs, the stubs are normal packages
that implement `Package`.
All the new types were created in the `v0` module since they are part of
the `v0/package` API. The types like `BuildSpec` and `InstallSpec`
should arguably have been defined in `v0` as well.
These new types were created by copying and modifying the existing types
(and tests) and I haven't (at this point) done the work to remove
duplicate or unused code.
Signed-off-by: J Robert Ray <jrray@jrray.org>1 parent d2855f0 commit 77f8db0
File tree
56 files changed
+3586
-637
lines changed- crates
- spk-build/src
- build
- validation
- spk-exec/src
- spk-schema/src
- metadata
- v0
- v1
- spk-solve
- crates
- graph/src
- macros
- src
- package-iterator
- solution/src
- validation
- src
- validators
- src
- solvers
- resolvo
- step
- spk-storage/src
- storage
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
56 files changed
+3586
-637
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | 155 | | |
169 | 156 | | |
170 | 157 | | |
| |||
342 | 329 | | |
343 | 330 | | |
344 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
345 | 346 | | |
346 | 347 | | |
347 | 348 | | |
| |||
527 | 528 | | |
528 | 529 | | |
529 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
530 | 537 | | |
531 | 538 | | |
532 | 539 | | |
| |||
0 commit comments