-
Notifications
You must be signed in to change notification settings - Fork 202
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
refactor: factor gateway data fetch and solve into a function #1793
base: main
Are you sure you want to change the base?
Conversation
4af492f
to
bdedea9
Compare
src/cli/global/common.rs
Outdated
gateway | ||
.query( | ||
channels, | ||
[Platform::current(), Platform::NoArch], |
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.
Before this PR, the query was done for a given Platform. however, virtual_packages were computed for the current platform. Is that discrepancy expected / normal?
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.
The platform must be given because you can install packages on osx for both osx-arm64 and osx-64. The virtual packages cannot be computed for an arbitrary platform though so we are stuck with the ones for the current platform.
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.
Thanks @baszalmstra .
If this is the only use case, shouldn't we guess best_platform
automatically and remove the --platform
argument from the global commands?
edit: I note that the exec command does not take any --platform
argument already
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.
If we can get rid of the argument thatd be great! How would you go about detecting the best_platform
?
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.
Not 100% sure TBH 😆 . If the only case to handle is the osx-arm
to osx
, we could maybe detect the right error / empty solve when the current platform is osx-arm
, and try again on the 'backup' platform? would that work? is that the only case to handle?
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.
Im not entirely sure if that would work, because Im not sure which situation you could get into..
bdedea9
to
4c21e8a
Compare
1ee0f1d
to
db009a4
Compare
712af8c
to
5341116
Compare
Progress report is not the best, as messages such as |
Yes but it requires implementing a Reporter. |
@baszalmstra I am not sure what this entails. But it does not sound straightforward 🥲 . Is it worth it? Or should we pull the messaging out of the function and wrap it when / it needed where it is used? |
Yeah that sounds fair! 👍 |
Actually that does not work. Even with the messaging outside of the loop, the iterator is still there waiting... Reporter it is then :-) |
Rattler-build has a custom implementation here: https://github.com/prefix-dev/rattler-build/blob/a28628bc6d29e227dffc1a64c27fa5f0b50f7dc9/src/render/solver.rs#L136 Its not great but might serve as inspiration! |
Hi guys! What is the status of this PR @olivier-lacroix @baszalmstra? |
A follow-up on #1767