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

[BUG] MSYS2 installation via Chocolatey fails due to incompatibility with ZST packages #1970

Closed
triplef opened this issue May 21, 2020 · 8 comments
Labels

Comments

@triplef
Copy link

triplef commented May 21, 2020

Describe the bug

Installing MSYS2 via Chocolatey fails due to the pacman version that is bundled with the MSYS2 Chocolatey package being unable to install packages distributed in the zst format.

This is not strictly a bug with MSYS2 packages, but rather with an MSYS2 distribution, but this seemed like the best place to report it. Please let me know if I should report this somewhere else instead.

This is similar to #1960, but the fix here is probably to update the MSYS2 Chocolatey package with a pacman version that supports zst.

Steps to Reproduce the Problem

  1. Run choco install msys2

Expected behavior: MSYS2 installs without errors.

Additional Context

  • OS: Windows 10

Full output from Chocolatey command:

C:\Windows\system32>choco install msys2
Chocolatey v0.10.15
Installing the following packages:
msys2
By installing you accept licenses for the packages.

chocolatey-core.extension v1.3.5.1 [Approved]
chocolatey-core.extension package files install completed. Performing other installation steps.
 Installed/updated chocolatey-core extensions.
 The install of chocolatey-core.extension was successful.
  Software installed to 'C:\ProgramData\chocolatey\extensions\chocolatey-core'

msys2 v20190524.0.0.20191030 [Approved]
msys2 package files install completed. Performing other installation steps.
The package msys2 wants to run 'chocolateyinstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): Y

Installing to: C:\tools\msys64
Extracting 64-bit C:\ProgramData\chocolatey\lib\msys2\tools\msys2-base-x86_64-20190524.tar.xz to C:\tools\msys64...
C:\tools\msys64
Extracting C:\tools\msys64\msys2-base-x86_64-20190524.tar to C:\tools\msys64...
C:\tools\msys64
Invoking first run to setup things like bash profile, gpg etc...
Invoking msys2 shell command: -defterm -no-start -c "ps -ef | grep '[?]' | awk '{print $2}' | xargs -r kill"
mkdir: cannot change permissions of '/dev/shm': Permission denied
mkdir: cannot change permissions of '/dev/mqueue': Permission denied
Copying skeleton files.
These files are for the users to personalise their msys2 experience.

They will never be overwritten nor automatically updated.

'./.bashrc' -> '/home/me/.bashrc'
'./.bash_logout' -> '/home/me/.bash_logout'
'./.bash_profile' -> '/home/me/.bash_profile'
'./.inputrc' -> '/home/me/.inputrc'
'./.profile' -> '/home/me/.profile'
'C:\Windows\system32\drivers\etc\hosts' -> '/etc/hosts'
'C:\Windows\system32\drivers\etc\protocol' -> '/etc/protocols'
'C:\Windows\system32\drivers\etc\services' -> '/etc/services'
'C:\Windows\system32\drivers\etc\networks' -> '/etc/networks'
gpg: /etc/pacman.d/gnupg/trustdb.gpg: trustdb created
gpg: no ultimately trusted keys found
gpg: starting migration from earlier GnuPG versions
gpg: porting secret keys from '/etc/pacman.d/gnupg/secring.gpg' to gpg-agent
gpg: migration succeeded
gpg: Generating pacman keyring master key...
gpg: key EE86D7E6711192D2 marked as ultimately trusted
gpg: directory '/etc/pacman.d/gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '/etc/pacman.d/gnupg/openpgp-revocs.d/B61A26355ADA60C988E13055EE86D7E6711192D2.rev'
gpg: Done
==> Updating trust database...
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
==> Appending keys from msys2.gpg...
==> Locally signing trusted keys in keyring...
  -> Locally signing key D55E7A6D7CE9BA1587C0ACACF40D263ECA25678A...
  -> Locally signing key 123D4D51A1793859C2BE916BBBE514E53E0D0813...
  -> Locally signing key B91BCF3303284BF90CC043CA9F418C233E652008...
  -> Locally signing key 9DD0D4217D75A33B896159E6DA7EF2ABAEEA755C...
==> Importing owner trust values...
gpg: setting ownertrust to 4
gpg: setting ownertrust to 4
gpg: setting ownertrust to 4
gpg: inserting ownertrust of 4
==> Updating trust database...
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   4  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1  valid:   4  signed:   3  trust: 0-, 0q, 0n, 4m, 0f, 0u
gpg: depth: 2  valid:   3  signed:   0  trust: 3-, 0q, 0n, 0m, 0f, 0u
gpg: refreshing 8 keys from hkps://hkps.pool.sks-keyservers.net
gpg: keyserver refresh failed: Try again later
==> ERROR: A specified local key could not be updated from a keyserver.
--> Installing /usr/share/info/assuan.info.gz ... done
--> Installing /usr/share/info/autosprintf.info.gz ... done
--> Installing /usr/share/info/bash.info.gz ... done
--> Installing /usr/share/info/coreutils.info.gz ... done
--> Installing /usr/share/info/find.info.gz ... done
--> Installing /usr/share/info/find-maint.info.gz ... done
--> Installing /usr/share/info/flex.info.gz ... done
--> Installing /usr/share/info/gawk.info.gz ... done
--> Installing /usr/share/info/gawkinet.info.gz ... done
--> Installing /usr/share/info/gawkworkflow.info.gz ... done
--> Installing /usr/share/info/gcrypt.info.gz ... done
--> Installing /usr/share/info/gettext.info.gz ... done
--> Installing /usr/share/info/gmp.info.gz ... done
--> Installing /usr/share/info/gnupg.info.gz ... done
--> Installing /usr/share/info/gnutls.info.gz ... done
--> Installing /usr/share/info/gnutls-guile.info.gz ... done
--> Installing /usr/share/info/gpgme.info.gz ... done
--> Installing /usr/share/info/grep.info.gz ... done
--> Installing /usr/share/info/gzip.info.gz ... done
--> Installing /usr/share/info/history.info.gz ... done
--> Installing /usr/share/info/inetutils.info.gz ... done
--> Installing /usr/share/info/info-stnd.info.gz ... done
--> Installing /usr/share/info/ksba.info.gz ... done
--> Installing /usr/share/info/libffi.info.gz ... done
--> Installing /usr/share/info/libgomp.info.gz ... done
--> Installing /usr/share/info/libidn2.info.gz ... done
--> Installing /usr/share/info/libquadmath.info.gz ... done
--> Installing /usr/share/info/libtasn1.info.gz ... done
--> Installing /usr/share/info/libunistring.info.gz ... done
--> Installing /usr/share/info/m4.info.gz ... done
--> Installing /usr/share/info/mpfr.info.gz ... done
--> Installing /usr/share/info/nettle.info.gz ... done
--> Installing /usr/share/info/pinentry.info.gz ... done
--> Installing /usr/share/info/readline.info.gz ... done
--> Installing /usr/share/info/rluserman.info.gz ... done
--> Installing /usr/share/info/sed.info.gz ... done
--> Installing /usr/share/info/time.info.gz ... done
--> Installing /usr/share/info/wget.info.gz ... done
--> Installing /usr/share/info/which.info.gz ... done



###################################################################
#                                                                 #
#                                                                 #
#                   C   A   U   T   I   O   N                     #
#                                                                 #
#                  This is first start of MSYS2.                  #
#       You MUST restart shell to apply necessary actions.        #
#                                                                 #
#                                                                 #
###################################################################


Repeating system update until there are no more updates or max 5 iterations
Output is recorded in: C:\tools\msys64\update.log

================= SYSTEM UPDATE 1 =================

Invoking msys2 shell command: -defterm -no-start -c "pacman --noconfirm -Syuu | tee -a /update.log; ps -ef | grep '[?]' | awk '{print $2}' | xargs -r kill"
:: Synchronising package databases...
downloading mingw32.db...
downloading mingw32.db.sig...
downloading mingw64.db...
downloading mingw64.db.sig...
downloading msys.db...
downloading msys.db.sig...
:: Starting core system upgrade...
warning: terminate other MSYS2 programs before proceeding
resolving dependencies...
looking for conflicting packages...

Packages (8) bash-4.4.023-2  filesystem-2020.02-2  libzstd-1.4.4-2  mintty-1~3.1.4-1  msys2-runtime-3.1.4-2  pacman-5.2.1-7  pacman-mirrors-20200329-1  zstd-1.4.4-2

Total Download Size:   19.95 MiB
Total Installed Size:  66.40 MiB
Net Upgrade Size:      -3.32 MiB

:: Proceed with installation? [Y/n]
:: Retrieving packages...
downloading msys2-runtime-3.1.4-2-x86_64.pkg.tar.zst...
downloading bash-4.4.023-2-x86_64.pkg.tar.xz...
downloading filesystem-2020.02-2-x86_64.pkg.tar.xz...
downloading mintty-1~3.1.4-1-x86_64.pkg.tar.xz...
downloading pacman-mirrors-20200329-1-any.pkg.tar.xz...
downloading libzstd-1.4.4-2-x86_64.pkg.tar.xz...
downloading zstd-1.4.4-2-x86_64.pkg.tar.xz...
downloading pacman-5.2.1-7-x86_64.pkg.tar.zst...
checking keyring...
checking package integrity...
loading package files...
error: could not open file /var/cache/pacman/pkg/msys2-runtime-3.1.4-2-x86_64.pkg.tar.zst: Child process exited with status 127
error: could not open file /var/cache/pacman/pkg/pacman-5.2.1-7-x86_64.pkg.tar.zst: Child process exited with status 127
error: failed to commit transaction (cannot open package file)
Errors occurred, no packages were upgraded.

================= SYSTEM UPDATE 2 =================

Invoking msys2 shell command: -defterm -no-start -c "pacman --noconfirm -Syuu | tee -a /update.log; ps -ef | grep '[?]' | awk '{print $2}' | xargs -r kill"
:: Synchronising package databases...
 mingw32 is up to date
 mingw64 is up to date
 msys is up to date
:: Starting core system upgrade...
warning: terminate other MSYS2 programs before proceeding
resolving dependencies...
looking for conflicting packages...

Packages (8) bash-4.4.023-2  filesystem-2020.02-2  libzstd-1.4.4-2  mintty-1~3.1.4-1  msys2-runtime-3.1.4-2  pacman-5.2.1-7  pacman-mirrors-20200329-1  zstd-1.4.4-2

Total Installed Size:  66.40 MiB
Net Upgrade Size:      -3.32 MiB

:: Proceed with installation? [Y/n]
checking keyring...
checking package integrity...
loading package files...
error: could not open file /var/cache/pacman/pkg/msys2-runtime-3.1.4-2-x86_64.pkg.tar.zst: Child process exited with status 127
error: could not open file /var/cache/pacman/pkg/pacman-5.2.1-7-x86_64.pkg.tar.zst: Child process exited with status 127
error: failed to commit transaction (cannot open package file)
Errors occurred, no packages were upgraded.

================= SYSTEM UPDATE 3 =================

Invoking msys2 shell command: -defterm -no-start -c "pacman --noconfirm -Syuu | tee -a /update.log; ps -ef | grep '[?]' | awk '{print $2}' | xargs -r kill"
:: Synchronising package databases...
 mingw32 is up to date
 mingw64 is up to date
 msys is up to date
:: Starting core system upgrade...
warning: terminate other MSYS2 programs before proceeding
resolving dependencies...
looking for conflicting packages...

Packages (8) bash-4.4.023-2  filesystem-2020.02-2  libzstd-1.4.4-2  mintty-1~3.1.4-1  msys2-runtime-3.1.4-2  pacman-5.2.1-7  pacman-mirrors-20200329-1  zstd-1.4.4-2

Total Installed Size:  66.40 MiB
Net Upgrade Size:      -3.32 MiB

:: Proceed with installation? [Y/n]
checking keyring...
checking package integrity...
loading package files...
error: could not open file /var/cache/pacman/pkg/msys2-runtime-3.1.4-2-x86_64.pkg.tar.zst: Child process exited with status 127
error: could not open file /var/cache/pacman/pkg/pacman-5.2.1-7-x86_64.pkg.tar.zst: Child process exited with status 127
error: failed to commit transaction (cannot open package file)
Errors occurred, no packages were upgraded.

================= SYSTEM UPDATE 4 =================

Invoking msys2 shell command: -defterm -no-start -c "pacman --noconfirm -Syuu | tee -a /update.log; ps -ef | grep '[?]' | awk '{print $2}' | xargs -r kill"
:: Synchronising package databases...
 mingw32 is up to date
 mingw64 is up to date
 msys is up to date
:: Starting core system upgrade...
warning: terminate other MSYS2 programs before proceeding
resolving dependencies...
looking for conflicting packages...

Packages (8) bash-4.4.023-2  filesystem-2020.02-2  libzstd-1.4.4-2  mintty-1~3.1.4-1  msys2-runtime-3.1.4-2  pacman-5.2.1-7  pacman-mirrors-20200329-1  zstd-1.4.4-2

Total Installed Size:  66.40 MiB
Net Upgrade Size:      -3.32 MiB

:: Proceed with installation? [Y/n]
checking keyring...
checking package integrity...
loading package files...
error: could not open file /var/cache/pacman/pkg/msys2-runtime-3.1.4-2-x86_64.pkg.tar.zst: Child process exited with status 127
error: could not open file /var/cache/pacman/pkg/pacman-5.2.1-7-x86_64.pkg.tar.zst: Child process exited with status 127
error: failed to commit transaction (cannot open package file)
Errors occurred, no packages were upgraded.

================= SYSTEM UPDATE 5 =================

Invoking msys2 shell command: -defterm -no-start -c "pacman --noconfirm -Syuu | tee -a /update.log; ps -ef | grep '[?]' | awk '{print $2}' | xargs -r kill"
:: Synchronising package databases...
 mingw32 is up to date
 mingw64 is up to date
 msys is up to date
:: Starting core system upgrade...
warning: terminate other MSYS2 programs before proceeding
resolving dependencies...
looking for conflicting packages...

Packages (8) bash-4.4.023-2  filesystem-2020.02-2  libzstd-1.4.4-2  mintty-1~3.1.4-1  msys2-runtime-3.1.4-2  pacman-5.2.1-7  pacman-mirrors-20200329-1  zstd-1.4.4-2

Total Installed Size:  66.40 MiB
Net Upgrade Size:      -3.32 MiB

:: Proceed with installation? [Y/n]
checking keyring...
checking package integrity...
loading package files...
error: could not open file /var/cache/pacman/pkg/msys2-runtime-3.1.4-2-x86_64.pkg.tar.zst: Child process exited with status 127
error: could not open file /var/cache/pacman/pkg/pacman-5.2.1-7-x86_64.pkg.tar.zst: Child process exited with status 127
error: failed to commit transaction (cannot open package file)
Errors occurred, no packages were upgraded.
PATH environment variable does not have C:\tools\msys64 in it. Adding...
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of msys2 was successful.
  Software installed to 'C:\tools\msys64'

Chocolatey installed 0/0 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Second path fragment must not be a drive or UNC name.
Parameter name: path2
@triplef triplef added the bug label May 21, 2020
@mati865
Copy link
Collaborator

mati865 commented May 21, 2020

Duplicate of #1960 #1962 #1967

@triplef
Copy link
Author

triplef commented May 21, 2020

Thanks for your feedback @mati865. The problem, and why I opened another issue specific to the Chocolatey package, is that:

  • Updating pacman as suggested in these other issues doesn’t work when installing via Chocolatey, as the issue occurs before MSYS2 is even installed. Unless there’s e.g. a command-line option that lets me do that?
  • I’d prefer to continue using Chocolatey instead of switching to another installer / method of installation, and I’m sure lots of others do too (e.g. using Chocolatey is the recommended way to install MSYS2 on Travis CI, so I’m sure many will run into this once their build caches go stale and their CI does a fresh reinstall of MSYS2).

@still-flow
Copy link

still-flow commented May 21, 2020

Just to add my 5 cents: there is a /NoUpdate option for package installation, and installing with

choco install --no-progress -y msys2 --params "/NoUpdate:1"

seems to prevent the error during Chocolatey package installation (note that just --params "/NoUpdate", as per instructions, isn't sufficient if I understand the package source correctly -- at least for me /NoUpdate didn't do anything).

I kind of tried the workaround suggested by mati865 (doing it right after installation, and then running choco upgrade --no-progress -y msys2), but it didn't work out for me. Maybe you'll find some success?

@mati865
Copy link
Collaborator

mati865 commented May 21, 2020

Pacman was repackaged with zstd not long after I posted the workaround. Use this for now #1967 (comment)

@triplef
Copy link
Author

triplef commented May 22, 2020

Thank you both, I’ll give this a try.

@petemounce and @userzimmermann, as you are listed as maintainers for the MSYS2 Chocolatey package, may I ask if you’d be able to update the package to include the updated pacman in order to resolve this? 🙏

@lazka
Copy link
Member

lazka commented May 22, 2020

Things should work now. Can anyone confirm?

@lazka lazka added the needinfo label May 22, 2020
@triplef
Copy link
Author

triplef commented May 22, 2020

Yes, choco install msys2 works again for me. Thank you!

@lazka
Copy link
Member

lazka commented May 22, 2020

Thanks for testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants