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

[Package Issue]: MSYS2.MSYS2 #127282

Open
2 tasks done
HunterZ opened this issue Nov 18, 2023 · 12 comments
Open
2 tasks done

[Package Issue]: MSYS2.MSYS2 #127282

HunterZ opened this issue Nov 18, 2023 · 12 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.

Comments

@HunterZ
Copy link

HunterZ commented Nov 18, 2023

Please confirm these before moving forward

  • I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
  • I have not been informed if the issue is resolved in a preview version of the winget client.

Category of the issue

Installation issue.

Brief description of your issue

Upgrade from 20230718 to 20231026 fails silently with exit code 1.

Is MSYS2 not meant to be upgraded in this way, since it has an internal pacman-based updater?

Steps to reproduce

Install 20230718. Attempt to upgrade to 20231026.

Actual behavior

Upgrade fails with exit code 1 and no additional info.

Expected behavior

Successful update, or not listed as an available update if this is not a supported means of updating an existing MSYS2 installation.

Environment

Windows Package Manager v1.6.3133
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.2715
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.3133.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

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                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled

Screenshots and Logs

InstallationLog.txt says:

TargetDirectoryInUse : Error : The directory you selected already exists and contains an installation. Choose a different target for installation.

@HunterZ HunterZ added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Nov 18, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage This work item needs to be triaged by a member of the core team. label Nov 18, 2023
@microsoft microsoft deleted a comment from Smithjuanita Nov 20, 2023
@stephengillie stephengillie removed the Needs-Triage This work item needs to be triaged by a member of the core team. label Nov 20, 2023
@SpecterShell
Copy link
Contributor

SpecterShell commented Nov 21, 2023

Is MSYS2 not meant to be upgraded in this way, since it has an internal pacman-based updater?

Right

I tried to prevent it from being updated by WinGet by setting RequireExplicitUpgrade: true in the manifest but sometimes it doesn't work. You can try winget pin add MSYS2.MSYS2 to pin the package.

@tillig
Copy link

tillig commented Dec 8, 2023

Just ran into this myself. Is exit code 1 unique to the "the directory already exists and contains an installation" error? I wonder if the fileInUse expected error code tied to exit code 1 might provide something slightly more user friendly. It currently just fails and doesn't provide a pointer to the install log or anything.

 pwsh> winget upgrade --all
Name  Id          Version  Available Source
-------------------------------------------
MSYS2 MSYS2.MSYS2 20230526 20231026  winget
1 upgrades available.

Installing dependencies:
(1/1) Found MSYS2 [MSYS2.MSYS2] Version 20231026
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Starting package install...
Installer failed with exit code: 1

 pwsh> 

@SpecterShell
Copy link
Contributor

SpecterShell commented Dec 8, 2023

Just ran into this myself. Is exit code 1 unique to the "the directory already exists and contains an installation" error? I wonder if the fileInUse expected error code tied to exit code 1 might provide something slightly more user friendly. It currently just fails and doesn't provide a pointer to the install log or anything.

 pwsh> winget upgrade --all
Name  Id          Version  Available Source
-------------------------------------------
MSYS2 MSYS2.MSYS2 20230526 20231026  winget
1 upgrades available.

Installing dependencies:
(1/1) Found MSYS2 [MSYS2.MSYS2] Version 20231026
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Starting package install...
Installer failed with exit code: 1

 pwsh> 

No. The exit code 1 indicates a general installation failure instead of a specific one, according to the manual of Qt Installer Framework, the installer technology used by MSYS2 installer.

There is no switch to force the Qt Installer Framework installer to log into a specific file so WinGet doesn't know where the installer log to, and currently WinGet doesn't support capture the console output from the installer.

@bfcns
Copy link
Contributor

bfcns commented Jan 18, 2024

I think MSYS2 does not need upgrades as an installer. You can upgrade it via pacman -Suy inside its shell.

So does it mean we don't need this as a winget application?

@bfcns
Copy link
Contributor

bfcns commented Jan 18, 2024

This confirms winget is unnecessary for this package:
msys2/setup-msys2#359

@SpecterShell
Copy link
Contributor

SpecterShell commented Jan 18, 2024

I think MSYS2 does not need upgrades as an installer. You can upgrade it via pacman -Suy inside its shell.

So does it mean we don't need this as a winget application?

You can still do first-time install, or even install another copy of MSYS2 in a different directory if needed. 🤔

@bfcns
Copy link
Contributor

bfcns commented Jan 18, 2024

You can still do first-time install, or even install another copy of MSYS2 in a different directory if needed. 🤔

Then you have a nagging winget upgrade notifier in your hand, which doesn't work.

@SpecterShell
Copy link
Contributor

SpecterShell commented Jan 18, 2024

You can still do first-time install, or even install another copy of MSYS2 in a different directory if needed. 🤔

Then you have a nagging winget upgrade notifier in your hand, which doesn't work.

Not THEN. WinGet will always notify you as long as it detects a copy of MSYS2 from the registry.

I am thinking about modifying the package so it can still install new copies but never detect and update them. Currently I am using RequireExplicitUpgrade: true but it appears to be working only when it was installed through WinGet, and WinGet will still try to update them if it is installed by downloading and running the installer manually.

(AFAIK the counterpart on Chocolatey upgrades by invoking pacman directly, which can not be implemented here at the moment)

@bfcns
Copy link
Contributor

bfcns commented Jan 18, 2024

You can also install/extract MSYS2 from tar file.

@SpecterShell
Copy link
Contributor

You can also install/extract MSYS2 from tar file.

Currently WinGet doesn't support extracting tar file (as it doesn't rely on 7z for extracting archives). See microsoft/winget-cli#2899

The counterpart on Scoop installs in this way though but I don't know how they tackle the upgrading issue as it persists only the home directory.

@mdanish-kh
Copy link
Contributor

I am thinking about modifying the package so it can still install new copies but never detect and update them. Currently I am using RequireExplicitUpgrade: true but it appears to be working only when it was installed through WinGet, and WinGet will still try to update them if it is installed by downloading and running the installer manually.

When we have the 1.6.0 schema out, maybe UpgradeBehavior: deny can help with this one... 👀

@Aalivexy
Copy link

any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

7 participants