ScoopInstaller / Scoop

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

[Bug] scoop install of older version of extras/filelight failed #5587

Closed hgkamath closed 1 year ago

hgkamath commented 1 year ago

Bug Report

After a scoop update, I encountered upstream bug: filelight https://bugs.kde.org/show_bug.cgi?id=472546 and needed to go back to version 23.04.3-1416 But scoop install had a download URL string formation problem where the variable $matchLib is not substituted. (=msvc2019)

The filelight download location for the older version is https://binary-factory.kde.org/job/Filelight_Release_win64/1416/artifact/

Unsure if this is a scoop install script problem or a manifest file formation problem. i.e. which script's responsibility is it to properly substitute the $matchLib variable?

Current Behavior

PS C:\lmgmt\M_Capella-PC\scripts>  scoop install -s -g filelight@23.04.3-1416
WARN  Given version (23.04.3-1416) does not match manifest (23.04.3-1417)
WARN  Attempting to generate manifest for 'filelight' (23.04.3-1416)
Autoupdating filelight
Searching hash for filelight-23.04.3-1416-windows-cl-$matchLib-x86_64.7z in https://binary-factory.kde.org/job/Filelight_Release_win64/1416/artifact/filelight-23.04.3-1416-windows-cl-$matchLib-x86_64.7z.sha256
The remote server returned an error: (404) Not Found.
URL https://binary-factory.kde.org/job/Filelight_Release_win64/1416/artifact/filelight-23.04.3-1416-windows-cl-$matchLib-x86_64.7z.sha256 is not valid
Could not find hash in https://binary-factory.kde.org/job/Filelight_Release_win64/1416/artifact/filelight-23.04.3-1416-windows-cl-$matchLib-x86_64.7z.sha256
Downloading filelight-23.04.3-1416-windows-cl-$matchLib-x86_64.7z to compute hashes!
The remote server returned an error: (404) Not Found.
URL https://binary-factory.kde.org/job/Filelight_Release_win64/1416/artifact/filelight-23.04.3-1416-windows-cl-$matchLib-x86_64.7z is not valid
Could not install filelight@23.04.3-1416
Select-CurrentVersion : Cannot bind argument to parameter 'AppName' because it is an empty string.
At C:\vol\scoop_01\SCOOP\apps\scoop\current\lib\core.ps1:239 char:54
+     return $null -ne (Select-CurrentVersion -AppName $app -Global:$gl ...
+                                                      ~~~~
    + CategoryInfo          : InvalidData: (:) [Select-CurrentVersion], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Select-CurrentVersion

You cannot call a method on a null-valued expression.
At C:\vol\scoop_01\SCOOP\apps\scoop\current\lib\manifest.ps1:36 char:5
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Couldn't find manifest for ''.

Expected Behavior

install of older version should succeed

Additional context/output

NA

Possible Solution

workaround

Temporarily overwrite the $matchLib variable in the json manifest file PS C:\vol\scoop_01\scoop\buckets\extras\bucket> nvim .\filelight.json overwrite the string $matchLib in [0].autoupdate.architecture.64-bit.url with the proper lib string msvc2019 After install, I later undid the change and saved For the time being I have done a scoop hold -g filelight in order to prevent automatic update until the upstream bug is resolved.

System details

Windows version: [e.g. 7, 8, 10, 11]
10

OS architecture: [e.g. 32bit, 64bit, arm64] 64bit

PowerShell version: [output of "$($PSVersionTable.PSVersion)"] 5.1.19041.3031

Additional software: [(optional) e.g. ConEmu, Git] NA

Scoop Configuration

NA

//# Your configuration here

additional information

Quite a few manifest files in extras bucket have this $matchLib variable They all seem to be apps from kde.org

PS C:\vol\scoop_01\scoop\buckets\extras\bucket> grep matchLib -d recurse .
./dolphin.json:                "url": "https://binary-factory.kde.org/job/Dolphin_Release_win64/$preReleaseVersion/artifact/dolphin-$version-windows-cl-$matchLib-x86_64.7z",
./elisa.json:                "url": "https://binary-factory.kde.org/job/Elisa_Release_win64/$preReleaseVersion/artifact/elisa-$version-windows-cl-$matchLib-x86_64.7z",
./filelight.json:                "url": "https://binary-factory.kde.org/job/Filelight_Release_win64/$preReleaseVersion/artifact/filelight-$version-windows-cl-$matchLib-x86_64.7z",
./kate.json:                "url": "https://binary-factory.kde.org/job/Kate_Release_win64/$preReleaseVersion/artifact/kate-$version-windows-cl-$matchLib-x86_64.7z",
./kdeconnect.json:                "url": "https://download.kde.org/stable/release-service/$matchRelease/windows/kdeconnect-kde-$version-windows-$matchLib.exe#/dl.7z",
./okular.json:                "url": "https://binary-factory.kde.org/job/Okular_Release_win64/$preReleaseVersion/artifact/okular-$version-windows-cl-$matchLib-x86_64.7z",
hgkamath commented 1 year ago

5573 seems similar, maybe substitution failure on $matchCommit, $matchTag

suggested workaround: first do scoop download <corrected_url>
So does one need dotnet6 for pattern matching?
Actually I do have it installed via chocolatey, so that's not it.

PS C:\vol\scoop_01\scoop\buckets\extras\bucket> choco list dotnet-6.0-desktopruntime
Chocolatey v2.1.0
dotnet-6.0-desktopruntime 6.0.20

I run scoop using the windows-stock-version powershell-5.119041.3031 and not powershell-7.3.6.
Q1) does powershell version have something to do with it?

also #3292 ?
also #3045 ? says every manifest that uses custom capture groups will not work.

Q2) so how to make custom capture groups work?

Q3) perhaps dup?

Ref

HUMORCE commented 1 year ago

does powershell version have something to do with it?

no

so how to make custom capture groups work?

I don't think it should be implemented, it needs to be compatible for different sites and it may still keep the most of manifests unavailable like now.


Related: https://github.com/ScoopInstaller/Scoop/issues/3894

rashil2000 commented 1 year ago

Tracked in https://github.com/ScoopInstaller/Scoop/issues/3045