ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
21.22k stars 1.41k forks source link

BUG: Cannot install fixed version of git (except current one) #3933

Closed tharilya closed 2 years ago

tharilya commented 4 years ago

Hi There,

Problem in short:

It is currently impossible to install any Version of git which is not the current one.

Similar issue:

System-Setup (Steps to reproduce):

I have a Dockerfile with the following context:

FROM mcr.microsoft.com/powershell:windowsservercore-1909

RUN pwsh.exe -Command \
    Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

RUN pwsh.exe -Command \
    scoop install --global git@2.26.0.windows.1

This command will fail with:

WARN  Given version (2.26.0.windows.1) does not match manifest (2.26.1.windows.1)
WARN  Attempting to generate manifest for 'git' (2.26.0.windows.1)
Autoupdating git
Searching hash for PortableGit-$matchVer-32-bit.7z.exe in https://github.com/git-for-windows/git/releases/latest
Could not find hash in https://github.com/git-for-windows/git/releases/latest
Downloading PortableGit-$matchVer-32-bit.7z.exe to compute hashes!
The remote server returned an error: (404) Not Found.
URL https://github.com/git-for-windows/git/releases/download/v2.26.0.windows.1/PortableGit-$matchVer-32-bit.7z.exe#/dl.7z is not valid
Could not find hash!
Could not install git@2.26.0.windows.1
Couldn't find manifest for ''.

The behavior is the same for all releases. There is no "fixed" version of git which can be installed this way (except the current one). I wrote some suggestions in Comment-2702 There is a simple way to fix at least the stable versions of git.

niheaven commented 4 years ago

There's something wrong with generate_user_manifest@lib/manifest.ps1, so let's check it and think if there's some solutions.

h0lg commented 3 years ago

I have the same issue for gcc: I need it to build another project I'm working on and the current gcc version 9.3.0-2 runs into an error. So I tried to find what versions of gcc are available via scoop and found that this is the only one, unless I'm missing something. I tried the following:

scoop bucket add versions
scoop search gcc
'main' bucket:
    avr-gcc (10.2.0)
    gcc (9.3.0-2)

'versions' bucket:
    gcc45 (4.5.2)

Looking at the history of gcc.json in the main bucket though I found it was updated from gcc 8.1.0.0 about 8 months ago in this commit.

So I ended up installing gcc 8.1.0.0 as follows:

  1. reset the master branch of the ~/scoop/buckets/main repo to the parent of above mentioned commit (i.e. the last commit using version 8.1.0.0)
  2. run scoop install gcc
  3. revert step 1., i.e. reset the master back to the origin/master

At that point you can install gcc 9.3.0-2 in parallel running scoop install gcc@9.3.0-2 and then switch in between gcc versions using scoop reset gcc@8.1.0.0 and scoop reset gcc@9.3.0-2 respectively.

h0lg commented 3 years ago

At that point you can install gcc 9.3.0-2 in parallel running scoop install gcc@9.3.0-2 and then switch in between gcc versions using scoop reset gcc@8.1.0.0 and scoop reset gcc@9.3.0-2 respectively.

One thing I've noticed about this parallel gcc installation though is that scoop list will invariably show 9.3.0-2 even if I reset gcc to version 8.1.0.0:

scoop reset gcc@8.1.0.0
scoop list
Installed apps:

  7zip 19.00 [main]
  gcc 9.3.0-2 [~\scoop\buckets\main\bucket\gcc.json]
  go 1.15.6 [main]

Notice also how the bucket name is replaced with the path to the json manifest file. I don't know what's up with that.

rashil2000 commented 2 years ago

ScoopInstaller/Main#3292