Skip to content

Fix package managers for macOS/Linux compatibility#4542

Merged
Gabriel Dufresne (GabrielDuf) merged 7 commits intomainfrom
PackageManagerForMacOS
Apr 2, 2026
Merged

Fix package managers for macOS/Linux compatibility#4542
Gabriel Dufresne (GabrielDuf) merged 7 commits intomainfrom
PackageManagerForMacOS

Conversation

@GabrielDuf
Copy link
Copy Markdown
Contributor

Summary

  • Pip: Replace parse_pip_search dependency with a direct PyPI Simple Index lookup. Searches are now done by substring-matching against the full package name index with parallel version fetches. Adds --break-system-packages auto-retry when pip hits an externally-managed-environment error, and prefers pip3/pip standalone executables on non-Windows.

  • Cargo: Add fallback to cargo install --list when cargo-update is not installed, so installed packages are always populated. Fix regex to match hyphenated crate names. Detect cargo-binstall at runtime and use plain cargo install when it is absent. Invalidate the installed-packages cache after a successful operation.

  • PowerShell7: Source listing now tries Get-PSResourceRepository first and falls back to Get PSRepository, covering both old and new PowerShell module ecosystems. Switches to UseSubstringSearch on the NuGet search endpoint to avoid PSGallery silently omitting packages.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves cross-platform (macOS/Linux) behavior for several package managers by removing Windows-only assumptions, adding fallbacks when optional tools aren’t present, and making search/listing behavior more robust across differing ecosystems (PyPI, Cargo, PowerShell repositories).

Changes:

  • vcpkg: make bootstrap/version output OS-aware and adjust uninstall behavior.
  • pip: replace parse_pip_search with PyPI Simple Index-based search + caching; prefer standalone pip3/pip on non-Windows; add auto-retry for externally-managed environments.
  • cargo + PowerShell7: add compatibility fallbacks (cargo-update absent, PSResourceRepository vs PSRepository) and adjust search semantics for PSGallery reliability.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/UniGetUI.PackageEngine.Managers.Vcpkg/Vcpkg.cs Use OS-specific env-var formatting and bootstrap script execution for non-Windows.
src/UniGetUI.PackageEngine.Managers.Vcpkg/Helpers/VcpkgPkgOperationHelper.cs Add recursive uninstall flag for vcpkg removals.
src/UniGetUI.PackageEngine.Managers.PowerShell7/PowerShell7.cs Combine installed-package listing across scopes in one run; enable substring search behavior.
src/UniGetUI.PackageEngine.Managers.PowerShell7/Helpers/PowerShell7SourceHelper.cs Prefer Get-PSResourceRepository, fallback to Get-PSRepository for broader compatibility.
src/UniGetUI.PackageEngine.Managers.Pip/Pip.cs Implement PyPI Simple Index name cache + parallel version fetch; prefer pip3/pip on non-Windows; background pre-warm.
src/UniGetUI.PackageEngine.Managers.Pip/Helpers/PipPkgOperationHelper.cs Add --break-system-packages option and auto-retry when PEP 668 blocks operations.
src/UniGetUI.PackageEngine.Managers.Generic.NuGet/BaseNuGet.cs Add UseSubstringSearch switch and implement Packages() substring-based endpoint path.
src/UniGetUI.PackageEngine.Managers.Cargo/Helpers/CargoPkgOperationHelper.cs Use cargo install when cargo-binstall missing; invalidate installed cache after success.
src/UniGetUI.PackageEngine.Managers.Cargo/Cargo.cs Regex fixes; fallback to cargo install --list; runtime detection of cargo-binstall; cache invalidation hook.
src/UniGetUI.PackageEngine.Enums/OverridenInstallationOptions.cs Add Pip override flag for --break-system-packages.
src/UniGetUI.Avalonia/Views/Pages/SettingsPages/PackageManagerPage.axaml.cs Fix vcpkg name casing check; use command binding for vcpkg root picker card.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit fe7ea5d into main Apr 2, 2026
1 check passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the PackageManagerForMacOS branch April 2, 2026 15:27
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.

3 participants