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

Rustup backend does not detect missing components #58

Open
InnocentZero opened this issue Nov 27, 2024 · 3 comments · May be fixed by #62
Open

Rustup backend does not detect missing components #58

InnocentZero opened this issue Nov 27, 2024 · 3 comments · May be fixed by #62
Labels
bug Something isn't working

Comments

@InnocentZero
Copy link
Collaborator

InnocentZero commented Nov 27, 2024

Basically the title. I came across this on a fresh arch install when I noticed the rust-analyzer was missing. Now, the way we handle missing packages is just by checking the keys, which does not suffice for Rustup (since the components are stored in InstallOptions and that is discarded).

One way to deal with this would be to convert them into an enum of components and toolchains, but I'm not sure how much of a 'hack' it'll be.

@InnocentZero InnocentZero added the bug Something isn't working label Nov 27, 2024
@ripytide
Copy link
Owner

I don't really want to make it a hacky method again like it was in pacdef, perhaps we could instead fix this by delegating the "is this package missing, and if so which bits do we need to install?" question to be have a per backend implementation. Something like:

trait Backend {
    fn missing(managed: Self::InstallOptions, installed: Option<Self::QueryInfo>) -> Option<Self::InstallOptions>;
}

@ripytide
Copy link
Owner

Also I don't like the managed variable name as it's a bit vague, perhaps we could rename it to required throughout the codebase?

@ripytide ripytide linked a pull request Dec 15, 2024 that will close this issue
@InnocentZero
Copy link
Collaborator Author

I don't really want to make it a hacky method again like it was in pacdef, perhaps we could instead fix this by delegating the "is this package missing, and if so which bits do we need to install?" question to be have a per backend implementation. Something like:

trait Backend {
    fn missing(managed: Self::InstallOptions, installed: Option<Self::QueryInfo>) -> Option<Self::InstallOptions>;
}

Yeah, this sounds good, and I was also thinking of "let the backend decide how to install things"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants