Commit ce42d94
committed
Hotfix packages with unpinned var opts on load
Given a package with an embedded package that defines a var with a
default value, such as in:
```yaml
install:
embedded:
- pkg: python/3.10.8
build:
options:
- var: abi/3.10.8
```
Until the fix in the previous commit, these vars were not getting pinned
when the package is built and the stub created:
```yaml
pkg: python/3.10.8/embedded[some-parent-pkg:run/3.10.8/P7SZECZD]
api: v0/package
build:
options:
- var: python.abi/cp310
```
This created a problem for solving correctly because
`Satisfy<VarRequest>` would incorrectly claim that this package is compatible
with _any_ value for `python.abi`.
In order to fix solves for the existing embedded stubs, these missing
pinned values are pinned as the package specs are read from storage, so
they end up with the intended content:
```yaml
pkg: python/3.10.8/embedded[some-parent-pkg:run/3.10.8/P7SZECZD]
api: v0/package
build:
options:
- var: python.abi/cp310
static: cp310
```
Now `Satisfy<VarRequest>` will correctly reject this package as not
being compatible with, e.g., `python.abi/cp311`.
The best we can do is assume `python.abi` was not overridden to some
other value at the time the parent package was built and that the
default on the option is the appropriate value for the pin.
Signed-off-by: J Robert Ray <jrray@imageworks.com>1 parent e7dc7f2 commit ce42d94
2 files changed
+44
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
419 | 428 | | |
420 | 429 | | |
421 | 430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
508 | 507 | | |
509 | 508 | | |
510 | 509 | | |
| |||
517 | 516 | | |
518 | 517 | | |
519 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
520 | 542 | | |
521 | 543 | | |
522 | 544 | | |
| |||
768 | 790 | | |
769 | 791 | | |
770 | 792 | | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
771 | 804 | | |
772 | 805 | | |
773 | 806 | | |
| |||
0 commit comments