Skip to content
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

Consider OS version when matching artifacts to platforms #419

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ararslan
Copy link
Member

We currently largely ignore OS version, and for most platforms that doesn't really matter. But binaries built for a particular FreeBSD version are forward- but not backward-compatible with other FreeBSD versions, and that isn't accounted for when choosing artifacts. That means that whenever the FreeBSD version used in the RootFS is bumped, entries in Artifacts.toml corresponding to older versions need to be manually deleted so they don't get chosen instead.

More care is needed here than I had anticipated, as platforms_match has documented but unfortunate behavior when both arguments have compare_version_cap set for their os_version comparison strategies. The function assumes that this case occurs only when both arguments are host platforms, and it compares their versions using ==. That strategy is set explicitly for CompilerShard targets with a comment about treating the OS version as a bound, except it doesn't act as a bound as such if the comparator is e.g. HostPlatform().

This is partially an experiment to see what breaks if the FreeBSD entries in supported_platforms start setting os_version.

We currently largely ignore OS version, and for most platforms that
doesn't really matter. But binaries built for a particular FreeBSD
version are forward- but not backward-compatible with other FreeBSD
versions, and that isn't accounted for when choosing artifacts. That
means that whenever the FreeBSD version used in the RootFS is bumped,
entries in Artifacts.toml corresponding to older versions need to be
manually deleted so they don't get chosen instead.

More care is needed here than I had anticipated, as `platforms_match`
has documented but unfortunate behavior when both arguments have
`compare_version_cap` set for their `os_version` comparison strategies.
The function assumes that this case occurs only when both arguments are
host platforms, and it compares their versions using `==`. That strategy
is set explicitly for `CompilerShard` targets with a comment about
treating the OS version as a bound, except it doesn't act as a bound as
such if the comparator is e.g. `HostPlatform()`.
@giordano
Copy link
Member

I have the impression that so far we haven't include this because binaries are effectively mostly compatible across different os versions, and making the os versions would introduce lots of friction. In a sense, I believe this was a pragmatic decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants