Skip to content

winget driver: names are ids only, so a moniker such as pwsh never resolves, and the failure quotes stderr while winget reports on stdout #817

Open

Description

@David-Noble-at-work

DANOBLE-WD11-3 (Windows 11 arm64, winget v1.29.290, writ build 966bdf9).

Observed

[writ] [△] scope home failed: ... child "pkg.install-1": pkg.install: platform: winget/pwsh did not reach the requested state (post=""):

PowerShell 7.6.5 is installed on the machine. The manifest entry was pwsh.

Mechanism

  1. pkg/platform/windows_managers_windows.go: available, installed, installRaw, removeRaw all pass the
    manifest name as --id <name>. winget's id for PowerShell is Microsoft.PowerShell; pwsh is its moniker.
    winget show --id pwsh → "No package found matching input criteria." (exit -1978335212), so the pre-check reports
    not installed, the install fails the same way, and the post-check sees an empty version.
  2. pkg/platform/helpers.go bracket builds the error as did not reach the requested state (post=%q): %s with
    result.Stderr. winget writes its diagnostics to stdout, so the message ends in : and the cause is lost.

Evidence of completion

  • a name that is not a winget id is resolved (--moniker, then exact name) or refused with winget's own message
    before any install is attempted; pwsh and Microsoft.PowerShell both reach the installed state
  • the requested-state error carries winget's output when stderr is empty
  • a unit test per driver method against a fake runner; a functional test on the Windows leg (test (windows-*))
    that plans and observes an already-installed package by moniker

Related

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions