Repository navigation
feat: Introduce default versions for virtual packages - #2646
Conversation
…solves When detecting virtual packages for a platform other than the current one, __linux, __glibc, __osx and __win previously fell back to version 0, which causes solves to pick packages that don't match any realistic system. Use the same defaults as pixi instead (linux 4.18, glibc 2.28, macOS 13.0, Windows 10.0), exposed in a new rattler_virtual_packages::defaults module. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WyyLK4E1qspcGuhDgoqS7K
| // Check override first, fall back to default (no version) | ||
| virtual_packages | ||
| .win | ||
| .or_else(|| Some(Windows { version: None })) |
There was a problem hiding this comment.
why was this None before while in all other places we used 0? maybe we should make it non-optional?
There was a problem hiding this comment.
I dont remember no. I think it might be because the version was added later.
|
How does this actually work in conda/conda? |
|
is there a conda command for things like cross-platform solves? |
|
That, my friend, is a gooood question! |
|
seems like they also have 🤖 yapprompt: |
|
I guess we should maybe also warn the user? E.g. "cant determine virtual package bla, assuming bla"? and tell them to override using bla. |
When detect_for_platform falls back to a default version for __win, __linux, __osx or __glibc, emit an info-level tracing message telling the user which version is assumed and which CONDA_OVERRIDE_* variable overrides it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WyyLK4E1qspcGuhDgoqS7K
There was a problem hiding this comment.
we should use those in a follow-up PR in pixi
| /// - **Windows** (`__win`): Version 10.0 | ||
| /// - **Linux** (`__linux`): Version 4.18 | ||
| /// - **OSX** (`__osx`): Version 13.0 | ||
| /// - **iOS** (`__ios`): Version 0 (minimum supported iOS version) |
There was a problem hiding this comment.
Maybe we can just point to the defaults module? TO make sure this doesnt go out of date.
Reference the defaults::default_*_version functions instead of hardcoding the version numbers in the detect_for_platform docs so they cannot go out of date. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WyyLK4E1qspcGuhDgoqS7K
i noticed that
rattler solve --platform <different-platform-than-host>results in__linux=0=0which leads to weird solving errors by default. wdyt about having default versions?prompt
i think we could use those versions in
pixias well in their defaults, wdyt?🤖 yap
Description
This PR introduces a new
defaultsmodule that provides default virtual package versions matching those used by pixi when detecting packages for platforms other than the current host. Previously, cross-compilation would use hardcoded version 0 for most packages, which doesn't reflect real-world defaults.Changes:
crates/rattler_virtual_packages/src/defaults.rswith functions for default versions:default_glibc_version()→ 2.28 (RHEL 8 / Debian 10)default_linux_version()→ 4.18 (RHEL 8 kernel)default_windows_version()→ 10.0default_mac_os_version()→ 13.0 (for macOS platforms)VirtualPackages::detect_for_platform()to use these defaults instead of hardcoded zerostest_cross_platform_default_versions()to verify defaults are applied correctly when cross-compilingThe defaults now align with pixi's behavior, ensuring consistent virtual package resolution across tools in the conda ecosystem.
How Has This Been Tested?
test_cross_platform_default_versions()that verifies:Checklist:
https://claude.ai/code/session_01WyyLK4E1qspcGuhDgoqS7K