ScoopInstaller / Main

📦 The default bucket for Scoop.
https://scoop.sh
The Unlicense
1.58k stars 946 forks source link

[Bug]: installing python versions via @ does not work #4144

Closed ifeelagood closed 1 year ago

ifeelagood commented 1 year ago

Prerequisites

Package Name

python@3.10.8

Expected/Current Behaviour

Until recently, installing python 3.10.8 via scoop install python@3.10.8 worked properly. however, this no longer works, and returns a 404 error. I believe this is due to scoop attempting to download the arm64 build rather than the amd64 build.

this was tested on fresh installs of scoop on 2 machines.


Steps to Reproduce

scoop install python@3.10.0
WARN  Given version (3.10.0) does not match manifest (3.11.0)
WARN  Attempting to generate manifest for 'python' (3.10.0)
Autoupdating python
Searching hash for python-3.10.0.exe in https://www.python.org/downloads/release/python-3100/
Found: md5:133aa48145032e341ad2a000cd3bff50 using Extract Mode
Searching hash for python-3.10.0-amd64.exe in https://www.python.org/downloads/release/python-3100/
Found: md5:c3917c08a7fe85db7203da6dcaa99a70 using Extract Mode
Searching hash for python-3.10.0-arm64.exe in https://www.python.org/downloads/release/python-3100/
Could not find hash in https://www.python.org/downloads/release/python-3100/
Downloading python-3.10.0-arm64.exe to compute hashes!
The remote server returned an error: (404) Not Found.
URL https://www.python.org/ftp/python/3.10.0/python-3.10.0-arm64.exe#/setup.exe is not valid
Could not install python@3.10.0
Select-CurrentVersion : Cannot bind argument to parameter 'AppName' because it is an empty string.
At C:\Users\thicccatto\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

WARN  Scoop uses 'aria2c' for multi-connection downloads.
WARN  Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
WARN  To disable this warning, run 'scoop config aria2-warning-enabled false'.
You cannot call a method on a null-valued expression.
At C:\Users\thicccatto\scoop\apps\scoop\current\lib\manifest.ps1:36 char:5
+     $app = $app.TrimStart('/')
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Couldn't find manifest for ''.

### Possible Solution

`https://www.python.org/ftp/python/3.10.0/python-3.10.0-arm64.exe#/setup.exe` returns a 404. I am not running an ARM machine. The correct URL for my architecture should be `https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe#/setup.exe`, which return 200 and is a valid URL.

### Scoop and Buckets Version

```console
# Machine 1
Current Scoop version:
v0.3.1 - Released at 2022-11-15

'extras' bucket:
8495d179a (HEAD -> master, origin/master, origin/HEAD) mpv-git: Update to version 20221120

'main' bucket:
659b55ddc (HEAD -> master, origin/master, origin/HEAD) oh-my-posh: Update to version 12.16.1

'versions' bucket:
c6c74e48 (HEAD -> master, origin/master, origin/HEAD) zig-dev: Update to version 0.11.0-dev.228
---
# Machine 2Current Scoop version:
v0.3.1 - Released at 2022-11-15

'extras' bucket:
8495d179a (HEAD -> master, origin/master, origin/HEAD) mpv-git: Update to version 20221120

'main' bucket:
659b55ddc (HEAD -> master, origin/master, origin/HEAD) oh-my-posh: Update to version 12.16.1

'versions' bucket:
c6c74e48 (HEAD -> master, origin/master, origin/HEAD) zig-dev: Update to version 0.11.0-dev.228

Scoop Config

# Machine 1

last_update                       scoop_branch scoop_repo
-----------                       ------------ ----------
2022-11-20T11:55:42.2398047+11:00 master       https://github.com/lukesampson/scoop

Machine 2

last_update                       scoop_branch scoop_repo
-----------                       ------------ ----------
2022-11-20T11:54:48.8550978+11:00 master       https://github.com/ScoopInstaller/Scoop

### PowerShell Version

```console
# Machine 1

Name                           Value
----                           -----
PSVersion                      5.1.19041.1682
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1682
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Machine 2

Name Value


PSVersion 5.1.19041.1320 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.19041.1320 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1



### Additional Softwares

_No response_
rashil2000 commented 1 year ago

Yes. You will have to use the Versions bucket to install older versions of python now.

ifeelagood commented 1 year ago

sorry, do you mind providing context? why does the older method no longer work? seems to be a bug that can be fixed, and the versions bucket does not work for me either, as well as not having the specific version i need

nevermind, using scoop install python310@3.10.8 worked. Perhaps a message to explain this/removal of the autoupdate?

rashil2000 commented 1 year ago

The addition of ARM build in the manifest is the reason. When an older manifest is auto-generated (which doesn't have ARM support), Scoop errors out because it can't find the file to compute its hash.