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

Update PowerShell LTS release #8847

Closed
10 of 11 tasks
Jaykul opened this issue Nov 20, 2023 · 6 comments
Closed
10 of 11 tasks

Update PowerShell LTS release #8847

Jaykul opened this issue Nov 20, 2023 · 6 comments

Comments

@Jaykul
Copy link

Jaykul commented Nov 20, 2023

Tool name

PowerShell

Tool license

MIT

Add or update?

  • Add
  • Update

Desired version

7.4

Approximate size

No response

Brief description of tool

No response

URL for tool's homepage

https://github.com/PowerShell/PowerShell/releases

Provide a basic test case to validate the tool's functionality.

No response

Platforms where you need the tool

  • Azure DevOps
  • GitHub Actions

Runner images where you need the tool

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • Windows Server 2019
  • Windows Server 2022

Can this tool be installed during the build?

# Perhaps, but why should PowerShell developers be the only ones stuck in the dark ages?

Tool installation time in runtime

No response

Are you willing to submit a PR?

No response

@vpolikarpov-akvelon
Copy link
Contributor

Hey @Jaykul. Thank you for your request, we will definitely consider this.

@Manbearpiet
Copy link

Manbearpiet commented Nov 24, 2023

We can't release our code anymore :(, we have a version requirement.
We can't wait to see this implemented 👍🚀.

At C:\Users\runneradmin\Documents\PowerShell\Modules\PowerShellBuild\0.6.1\Public\Build-PSBuildMarkdown.ps1:35 char:19 + … oduleInfo = Import-Module "$ModulePath/$ModuleName.psd1" -Global -For … +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

[<<==>>] Exception: The version of PowerShell on this computer is '7.2.16'. The module 'D:\a\AzureDevOpsPowerShellAPI\AzureDevOpsPowerShellAPI\Output\AzureDevOpsPowerShell\AzureDevOpsPowerShell.psd1' requires a minimum PowerShell version of '7.3' to run. 
Verify that you have the minimum required version of PowerShell installed, and then try again.

For Ubuntu hosts we use:

      - name: Upgrade pwsh (Linux)
        if: runner.os	== 'Linux'
        run: sudo apt-get install --only-upgrade powershell

We tried manually upgrading the pwsh package on Windows but that fails:

      - name: Upgrade pwsh (Windows)
       if: runner.os	== 'Windows'
       shell: pwsh
       run: | 
         choco upgrade powershell-core -y -d
Installing powershell-core...
Ensuring 'C:\Users\runneradmin\AppData\Local\Temp\chocolatey' exists
Running Start-ChocolateyProcessAsAdmin -validExitCodes '0 3010 1641' -workingDirectory 'C:\Users\runneradmin\AppData\Local\Temp\chocolatey\powershell-core\7.4.0' -statements '/i "C:\Users\runneradmin\AppData\Local\Temp\chocolatey\powershell-core\7.4.0\PowerShell-7.4.0-win-x64.msi" /qn /norestart /l*v "C:\Users\runneradmin\AppData\Local\Temp\chocolatey\powershell-core.7.4.0.MsiInstall.log" ' -exeToRun 'C:\Windows\System32\msiexec.exe' 
Test-ProcessAdminRights: returning True
Elevating permissions and running ["C:\Windows\System32\msiexec.exe" /i "C:\Users\runneradmin\AppData\Local\Temp\chocolatey\powershell-core\7.4.0\PowerShell-7.4.0-win-x64.msi" /qn /norestart /l*v "C:\Users\runneradmin\AppData\Local\Temp\chocolatey\powershell-core.7.4.0.MsiInstall.log" ]. This may take a while, depending on the statements.
Error: Process completed with exit code 1.

@JustinGrote
Copy link

@vpolikarpov-akvelon

The issue is here:

$release = $metadata.LTSReleaseTag[0] -replace '^v'

Current value is:
"LTSReleaseTag" : ["v7.2.17", "v7.4.0"],

There are two LTS releases, and this should be selecting the [-1] index rather than the [0] index. To be extremely sure, it should be cast to either [Version] or [SemanticVersion] and sorted descending to select the latest LTS release.

Once this is fixed, the build step should start grabbing 7.4 LTS instead of 7.2 LTS automatically.

I am willing to submit a PR fix if there is interest.

@vpolikarpov-akvelon
Copy link
Contributor

Hey @JustinGrote, thank you for your investigation, but we already knew it. Unfortunately we can't just update Powershell right now because of a number of breaking changes. We are investigating possible impact. Once we done investigating we will either comment here or create PR to update current version. If you want, you may create PR yourself, any help is very appreciated, but we still may decide to stay on the current version.

@JustinGrote
Copy link

@vpolikarpov-akvelon thanks, how about you do your regression/breaking tests instead, and then once you decide that it's OK to bump, mark this issue as up-for-grabs and I will be happy to do a PR, but I'm not going to invest that time if there isn't a reasonable certainly it will be accepted.

@mikhailkoliada
Copy link
Contributor

Hey, I've prepared the announcement, the whole effort will be tracked here: #9115 so please follow that ticket for updates and thank you for heads up!

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

No branches or pull requests

5 participants