-
Notifications
You must be signed in to change notification settings - Fork 10
Hotfix packages with unpinned var opts on load #1301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Some extra commentary... In the spirit of #1298 and friends, IMO it will help with bugs like this if/when an embedded package has a type that mandates that build options are pinned. You could take things further since "build options" are arguably meaningless for something that can never be built: an embedded package. You can also argue that a package, embedded or not, should not have a "build" section at all anymore, and anything from the "build" section of a recipe that is needed at runtime should be populated into the "install" section of the package at build time. Similarly, an embedded package could arguably not have an "install" section and any of its runtime requirements should live in the runtime requirements of the component in the parent package that embeds this package. Changes like these would go a long way towards simplifying how package dependencies are calculated and reduce the opportunity for bugs to sneak in. For example, Handling components could be made easier if we baked out package specs for each component and treated them like separate packages. The |
| .await | ||
| .map_err(|err| Error::FileReadError(filename, err))?; | ||
| Spec::from_yaml(&yaml) | ||
| .map(|spec| match spec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can understand that this might be undesirable, but it is needed at least in the short term to fix bad solves. With the other fix in this PR in place, we can work on republishing packages to fix their stubs (or write some fixer script), and then I would be good with reverting this.
22f72dc to
aaa800c
Compare
39271cf to
6a5854c
Compare
aaa800c to
25a9bc9
Compare
6a5854c to
e7dc7f2
Compare
25a9bc9 to
ce42d94
Compare
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>
ce42d94 to
b59386d
Compare
Given a package with an embedded package that defines a var with a
default value, such as in:
Until the fix in #1302, these vars were not getting pinned
when the package is built and the stub created:
This created a problem for solving correctly because
Satisfy<VarRequest>would incorrectly claim that this package is compatiblewith 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:
Now
Satisfy<VarRequest>will correctly reject this package as notbeing compatible with, e.g.,
python.abi/cp311.The best we can do is assume
python.abiwas not overridden to someother value at the time the parent package was built and that the
default on the option is the appropriate value for the pin.