Skip to content

Verify manager dependency installations and detect cargo dependencies - #5322

Merged
Gabriel Dufresne (GabrielDuf) merged 5 commits into
mainfrom
fix/verify-dependency-installs
Aug 25, 2026
Merged

Verify manager dependency installations and detect cargo dependencies#5322
Gabriel Dufresne (GabrielDuf) merged 5 commits into
mainfrom
fix/verify-dependency-installs

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements to the dependency installation experience, especially for Cargo-based package managers, and enhances error handling and diagnostics for missing dependencies. The main themes are improved process output handling, more robust dependency detection, and better user feedback during installation failures.

Dependency installation and diagnostics improvements:

  • The MissingDependencyDialog now captures and displays the output from dependency installers in real time, showing the last lines of output in case of failure to help users diagnose issues. The dialog also provides clearer, more actionable error messages and retry options. (src/UniGetUI.Avalonia/Views/DialogPages/MissingDependencyDialog.axaml, src/UniGetUI.Avalonia/Views/DialogPages/MissingDependencyDialog.axaml.cs, src/Languages/lang_en.json)

  • The ManagerDependency struct now supports a custom command resolver, allowing dependencies to specify how their install commands are constructed dynamically. This enables more flexible and accurate installation routines for dependencies. (src/UniGetUI.PackageEngine.Interfaces/ManagerDependency.cs)

Cargo package manager enhancements:

  • The Cargo manager now detects binaries not only via the system PATH but also by searching known Cargo bin directories, improving detection reliability. The logic for finding these directories is encapsulated in new helper methods, which are thoroughly unit tested. (src/UniGetUI.PackageEngine.Managers.Cargo/Cargo.cs, src/UniGetUI.PackageEngine.Tests/CargoBinDirectoryTests.cs)
  • The Cargo dependency definitions are updated to use the new command resolver and improved detection logic, ensuring that required tools like cargo-binstall and cargo-update are installed and found more reliably. (src/UniGetUI.PackageEngine.Managers.Cargo/Cargo.cs)

Minor improvements and fixes:

  • The Scoop and Vcpkg managers have their install commands simplified to remove unnecessary error handling logic in PowerShell scripts. (src/UniGetUI.PackageEngine.Managers.Scoop/Scoop.cs, src/UniGetUI.PackageEngine.Managers.Vcpkg/Vcpkg.cs)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves dependency installation diagnostics and Cargo dependency discovery.

Changes:

  • Captures installer output and verifies installation results.
  • Adds dynamic dependency command resolution and Cargo binary-directory detection.
  • Simplifies Scoop and Vcpkg installation commands.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
CargoBinDirectoryTests.cs Tests Cargo directory discovery.
Vcpkg.cs Simplifies Git installation command.
Scoop.cs Simplifies dependency commands.
Cargo.cs Adds Cargo dependency detection and resolution.
ManagerDependency.cs Supports dynamic install commands.
MissingDependencyDialog.axaml.cs Captures output and reports failures.
MissingDependencyDialog.axaml Adds installer output display.
lang_en.json Adds diagnostic messages.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/UniGetUI.PackageEngine.Interfaces/ManagerDependency.cs Outdated
Comment thread src/Languages/lang_en.json
Comment thread src/UniGetUI.PackageEngine.Managers.Cargo/Cargo.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread src/UniGetUI.PackageEngine.Managers.Cargo/Cargo.cs
Comment thread src/UniGetUI.PackageEngine.Managers.Cargo/Cargo.cs
Comment thread src/UniGetUI.Avalonia/Views/DialogPages/MissingDependencyDialog.axaml.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread src/UniGetUI.PackageEngine.Managers.Cargo/Cargo.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

src/UniGetUI.PackageEngine.Tests/CargoBinDirectoryTests.cs:56

  • This fixed probe name makes the test depend on the developer/runner environment: if that executable already exists on PATH or under the current CARGO_HOME, the initial Assert.False fails before the fixture redirects CARGO_HOME. Generate a unique probe name so the test remains isolated.
        string binaryName = OperatingSystem.IsWindows()
            ? "cargo-unigetui-detection-probe.exe"
            : "cargo-unigetui-detection-probe";

src/UniGetUI.Avalonia/Views/DialogPages/MissingDependencyDialog.axaml.cs:166

  • Cancel can be clicked while the command resolver is still running. In that window _installProcess is null, so CancelInstall only sets _canceled; when the resolver returns, this method still launches the installer before killing it. That can trigger elevation prompts or other side effects after the user canceled. Check _canceled before starting the process.
        var (fileName, arguments) = await Task.Run(_dep.GetInstallCommand);

@randy-but-a-ro randy-but-a-ro Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉

Integration Details
{
	"deliveryId": "1694aa50-a0c1-11f1-90c0-821a712439c3",
	"headSha": "baa11ed84966ca52e1ee452cd4aca1066ece8ecd",
	"reviewer": "copilot-pull-request-reviewer[bot]"
}

@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit 20f3296 into main Aug 25, 2026
7 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the fix/verify-dependency-installs branch August 25, 2026 20:40
martesi added a commit to martesi/UniGetUI that referenced this pull request Aug 30, 2026
martesi added a commit to martesi/UniGetUI that referenced this pull request Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants