microsoft / microsoft/winget-pkgs
[Pipeline Bug]: Winget-cli (and/or Azure pipelines) fail to recognise certain InstallerSuccessCodes.
- Dominant language
- No language data
- Stars
- 11.1k
- Forks
- 9.7k
- PR merge metrics
- PR metrics pending
Description
### Relevant area(s)
WinGet CLI
### Relevant command(s)
winget install
### Brief description of your issue
While having spent a month-ish doing ever deeper research of why the Winget-pkgs pipelines near-consistently threw(/throw) the https://github.com/microsoft/winget-pkgs/issues/326285 glitch for ARM64 packages, one of the aspects that stood out to me, was that any InstallerSuccessCodes were disregarded by Winget-cli and/or the validation pipelines.
This led to validation artifacts still claiming that running a specific executable was a "Fail", when in fact the exit code after running that executable matched one of those that was in `InstallerSuccessCodes` in the manifest.
The most common ones I encountered during testing (https://github.com/microsoft/winget-pkgs/pull/324922#issuecomment-3717508600 being among those cases) was `11`, `-1073741515` and `-2147450751`, so I thought that adding them to `InstallerSuccessCodes` in the form of:
```
InstallerSuccessCodes:
- 11
- -1073741515
- -2147450751
```
would result in the validations accepting any exit code that matched those to be treated as successful. But for some reason it doesn't.
### Steps to reproduce
It's not super-easy to reproduce, but this has a 60% chance of reproducing it:
1) Create a new manifest that has an ARM64 installer in it.
2) Add the following section to the manifest's Installer.yaml:
```
InstallerSuccessCodes:
- 11
- -1073741515
- -2147450751
```
3) Submit it to Winget-pkgs.
4) Wait circa 3 hours.
5) See an error in the pipelines and/or GitHub PR thread that has at least 1 of the same error codes as the ones that are listed in `InstallerSuccessCodes`.
### Expected behavior
Winget-cli correctly processes InstallerSuccessCodes values when faced with any sort of exit codes, which would result in them being considered successes/passes.
### Actual behavior
Winget-cli seemingly fails to process InstallerSuccessCodes, and resultingly fails to treat matching exit codes as successes/passes instead of fails.
### Environment
```shell
Windows Package Manager v1.12.440
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.26200.7623
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.27.440.0
Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User) %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User) %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root C:\Program Files\WinGet\Packages
Portable Package Root (x86) C:\Program Files (x86)\WinGet\Packages
Installer Downloads %USERPROFILE%\Downloads
Configuration Modules %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules
Links
---------------------------------------------------------------------------
Privacy Statement https://aka.ms/winget-privacy
License Agreement https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
Admin Setting State
--------------------------------------------------
LocalManifestFiles Enabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride Enabled
LocalArchiveMalwareScanOverride Enabled
ProxyCommandLineOptions Disabled
DefaultProxy Disabled
```
Contributor guide
Research direction
Start by tracing how winget install handles InstallerSuccessCodes and how the winget-pkgs validation pipelines classify installer exit codes, using the ARM64 reproduction steps and the listed codes 11, -1073741515, and -2147450751. Done means matching codes are treated as successful in validation artifacts and GitHub PR results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- ci-cd
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100