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]: Some manifests' installer and uninstaller scripts have some invalid operations #13212

Closed
3 tasks done
Capella87 opened this issue May 2, 2024 · 0 comments · Fixed by #13246
Closed
3 tasks done
Labels

Comments

@Capella87
Copy link
Contributor

Capella87 commented May 2, 2024

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues/PRs to ensure it has not already been reported or fixed.
  • I have verified that I am using the latest version of Scoop and corresponding bucket.

Package Name

sdl2, sdl2-ttf, sdl2-mixer, sdl2-image, raylib, raylib-mingw, libsndfile

Expected/Current Behaviour

There are script errors when running installer and uninstaller script. installation and update themselves are working with those problems. Also, it would be better to remove deprecated things in the scripts..

Steps to Reproduce

PS> scoop update sdl2
Uninstalling 'sdl2' (2.30.2)
Running uninstaller script...
WARN  "env" will be deprecated. Please change your code/manifest to use "Get-EnvVar"
      -> :4:38
WARN  "strip_path" will be deprecated. Please change your code/manifest to use "Split-PathLikeEnvVar"
      -> :4:26
InvalidOperation: C:\Users\[redacted]\scoop\apps\scoop\current\lib\system.ps1:85
Line |
  85 |          $splitPattern = $Pattern.Split(';', [System.StringSplitOption|          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
WARN  "env" will be deprecated. Please change your code/manifest to use "Get-EnvVar"
      -> :9:38
WARN  "strip_path" will be deprecated. Please change your code/manifest to use "Split-PathLikeEnvVar"
      -> :9:26
InvalidOperation: C:\Users\[redacted]\scoop\apps\scoop\current\lib\system.ps1:85
Line |
  85 |          $splitPattern = $Pattern.Split(';', [System.StringSplitOption|          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
WARN  "strip_path" will be deprecated. Please change your code/manifest to use "Split-PathLikeEnvVar"
      -> :15:26
InvalidOperation: C:\Users\[redacted]\scoop\apps\scoop\current\lib\system.ps1:85
Line |
  85 |          $splitPattern = $Pattern.Split(';', [System.StringSplitOption|          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
WARN  "strip_path" will be deprecated. Please change your code/manifest to use "Split-PathLikeEnvVar"
      -> :17:26
InvalidOperation: C:\Users\[redacted]\scoop\apps\scoop\current\lib\system.ps1:85
Line |
  85 |          $splitPattern = $Pattern.Split(';', [System.StringSplitOption|          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
Unlinking ~\scoop\apps\sdl2\current
Installing 'sdl2' (2.30.3) [64bit] from 'extras' bucket
Loading SDL2-devel-2.30.3-VC.zip from cache.
Loading SDL2-2.30.3.zip from cache.
Extracting SDL2-devel-2.30.3-VC.zip ... done.
Extracting SDL2-2.30.3.zip ... done.
Running installer script...
WARN  "env" will be deprecated. Please change your code/manifest to use "Get-EnvVar"
      -> :33:32
WARN  "strip_path" will be deprecated. Please change your code/manifest to use "Split-PathLikeEnvVar"
      -> :33:20
InvalidOperation: C:\Users\[redacted]\scoop\apps\scoop\current\lib\system.ps1:85
Line |
  85 |          $splitPattern = $Pattern.Split(';', [System.StringSplitOption|          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
WARN  "env" will be deprecated. Please change your code/manifest to use "Set-EnvVar"
      -> :34:1
WARN  "env" will be deprecated. Please change your code/manifest to use "Get-EnvVar"
      -> :35:32
WARN  "strip_path" will be deprecated. Please change your code/manifest to use "Split-PathLikeEnvVar"
      -> :35:20
InvalidOperation: C:\Users\[redacted]\scoop\apps\scoop\current\lib\system.ps1:85
Line |
  85 |          $splitPattern = $Pattern.Split(';', [System.StringSplitOption|          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
WARN  "env" will be deprecated. Please change your code/manifest to use "Set-EnvVar"
      -> :36:1
WARN  "strip_path" will be deprecated. Please change your code/manifest to use "Split-PathLikeEnvVar"
      -> :38:31
InvalidOperation: C:\Users\[redacted]\scoop\apps\scoop\current\lib\system.ps1:85
Line |
  85 |          $splitPattern = $Pattern.Split(';', [System.StringSplitOption|          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
WARN  "strip_path" will be deprecated. Please change your code/manifest to use "Split-PathLikeEnvVar"
      -> :40:33
InvalidOperation: C:\Users\[redacted]\scoop\apps\scoop\current\lib\system.ps1:85
Line |
  85 |          $splitPattern = $Pattern.Split(';', [System.StringSplitOption|          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
Linking ~\scoop\apps\sdl2\current => ~\scoop\apps\sdl2\2.30.3
'sdl2' (2.30.3) was installed successfully!

Like this, other manifests mentioned above which contains scripts including strip_path are trouble.

Possible Solution

Update scripts in the manifest and code on Scoop.

Both installer and uninstaller scripts have deprecated functions, strip_path and env, which are implemented at lib/System.ps1 in Scoop. Originally strip_path invoked Test-PathLikeEnvVar internally, but in recent commit, it it changed to Split-PathLikeEnvVar and the new one receives the parameter as a string array named -Pattern instead of -Name.

Although Split-PathLikeEnvVar has a change in its parameters, strip_path function is not responded to the change yet.

Thus, both scripts and Scoop code should be updated to troubleshoot this issue.

Scoop and Buckets Version

PS> scoop --version
Current Scoop version:
d285bb08 (HEAD -> master, tag: v0.4.1, origin/master, origin/HEAD) chore(release): Bump to version 0.4.1 (#5924)

'main' bucket:
beb95ba0c (HEAD -> master, origin/master, origin/HEAD) firebase: Update to version 13.8.0

'extras' bucket:
f973734d8 (HEAD -> master, origin/master, origin/HEAD) kakaotalk@4.0.0.3881: Fix hash (Closes #13211)

'versions' bucket:
9297fe804 (HEAD -> master, origin/master, origin/HEAD) vim-nightly: Update to version 9.1.0386

'nirsoft' bucket:
08dbf0e (HEAD -> master, origin/master, origin/HEAD) 'updated'

'java' bucket:
469998e8 (HEAD -> master, origin/master, origin/HEAD) zulufx8-jre: Update to version 8.78.0.19

'games' bucket:
0b604611f (HEAD -> master, origin/master, origin/HEAD) steam-rom-manager: Update to version 2.4.26

Scoop Config

PS> scoop config

last_update           : 2024-05-02 11:52:06
debug                 : True
aria2-enabled         : True
aria2-warning-enabled : False
use_external_7zip     : True
scoop_branch          : master
scoop_repo            : https://github.com/ScoopInstaller/Scoop

PowerShell Version

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Additional Softwares

No response

@Capella87 Capella87 added the bug label May 2, 2024
@Capella87 Capella87 changed the title [Bug]: sdl2's installer and uninstaller scripts have some invalid operations [Bug]: Some manifests' installer and uninstaller scripts have some invalid operations May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant