microsoft / linux-package-repositories

Microsoft Packaged Linux Software (DEBs, RPMs, etc) are hosted on packages.microsoft.com (PMC) made available as native Linux repositories for use with package managers like APT, YUM, etc.
https://packages.microsoft.com
MIT License
64 stars 17 forks source link

powershell version 7.4 incorrectly built/packaged for RHEL7 #99

Closed Chris-Marcantonio closed 9 months ago

Chris-Marcantonio commented 10 months ago

Describe the issue It looks like powershell version 7.4 has a dependency on a newer version of GLIBC/libstdc++ than is available in RHEL7. When trying to run it, it spits out an error and fails to launch:

[chmarc@foo ~]$ rpm -q powershell
powershell-7.4.0-1.rh.x86_64
[chmarc@foo ~]$
[chmarc@foo ~]$ pwsh
pwsh: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by pwsh)
pwsh: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by pwsh)
[chmarc@foo ~]$

The versions of GLIBC supported on RHEL7 appear to be:

[chmarc@foo ~]$ strings /lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_DEBUG_MESSAGE_LENGTH
[chmarc@foo ~]$

Interestingly, the documentation here seems to show that powershell version 7.4 is not supported on RHEL7: https://learn.microsoft.com/en-us/powershell/scripting/install/install-rhel?view=powershell-7.4#supported-versions

And looking through the contents of the repo, there is only a single version of 7.4, and it has been built in the past 2 weeks:

[chmarc@foo ~]$ yum list --showduplicates powershell | tail -n 10
powershell.x86_64          7.3.2-1.rh               packages-microsoft-com-prod
powershell.x86_64          7.3.3-1.rh               packages-microsoft-com-prod
powershell.x86_64          7.3.4-1.rh               packages-microsoft-com-prod
powershell.x86_64          7.3.5-1.rh               packages-microsoft-com-prod
powershell.x86_64          7.3.6-1.rh               packages-microsoft-com-prod
powershell.x86_64          7.3.7-1.rh               packages-microsoft-com-prod
powershell.x86_64          7.3.8-1.rh               packages-microsoft-com-prod
powershell.x86_64          7.3.9-1.rh               packages-microsoft-com-prod
powershell.x86_64          7.3.10-1.rh              packages-microsoft-com-prod
powershell.x86_64          7.4.0-1.rh               packages-microsoft-com-prod
[chmarc@foo ~]$
[chmarc@foo ~]$ rpm -qi powershell | grep "Build Date"
Build Date  : Fri 10 Nov 2023 08:58:25 PM EST
[chmarc@foo ~]$

So this seems like a new problem, and an obvious error to have built a powershell version 7.4 RPM for RHEL7 and included it in your repo. Anyone who runs "yum update" with your repo enabled will get a broken version of powershell now.

When did the issue occur? Within the last 2 weeks.

If applicable, what package did you attempt to install, and from which repo? The exact package is: powershell-7.4.0-1.rh.x86_64

Installed from the repo at https://packages.microsoft.com/rhel/7/prod

Steps to Reproduce 1) Run "yum update" with the https://packages.microsoft.com/rhel/7/prod/ repo enabled. 2) Attempt to run the "pwsh" binary.

Actual Result

[chmarc@foo ~]$ pwsh
pwsh: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by pwsh)
pwsh: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by pwsh)
[chmarc@foo ~]$

Expected Result The binary should obviously be able to execute.

Klaas- commented 10 months ago

I think this needs to go here: https://github.com/PowerShell/PowerShell -- and they should properly include the requirements in the rpm spec, that way it would not install :)

Chris-Marcantonio commented 10 months ago

As far as I can tell, all of the powershell 7.4 RPMs are identical...so whether it is the RPM for use on CentOS8, or RHEL7, or whatever other flavor...the package is actually identical.

While I would agree that Microsoft should include proper requirements in the RPM spec, that's only a partial solution (and probably expecting too much out of them, from what I've seen from other packaging complaints I've had). If a dependency existed, then yum would fail to depsolve and the RPM wouldn't be installed. Which means you wouldn't get a broken install, but instead trying to run "yum update" to fully patch a box will just fail and require you to work around what seems like an obvious problem in the repo.

So in the end, I still feel like there is some requirement to solve this at the repo level as well. Including an RPM that can't ever run on the platform you are publishing a repo for just seems bad and wrong.

adityapatwardhan commented 10 months ago

RHEL7 is not a supported platform for PowerShell 7.4.

Please have a look at https://learn.microsoft.com/en-us/powershell/scripting/install/powershell-support-lifecycle?view=powershell-7.4#red-hat-enterprise-linux-rhel for more details.

Chris-Marcantonio commented 10 months ago

Yeah, I mentioned that in the first comment.

All the more reason it should not be included in an official published Microsoft repo for RHEL7.

Klaas- commented 10 months ago

@adityapatwardhan

https://github.com/PowerShell/PowerShell/blob/094e22e97ddcb982687f5e7a66c2567907e51124/tools/packages.microsoft.com/mapping.json#L24-L30

I am guessing that needs to be removed? :)

and about setting proper rpm requirements, at least on first glance I did not find the spec file for building the powershell rpm package, but you should be able to set Requirements for glibc easily -- https://rpm-packaging-guide.github.io/

Klaas- commented 9 months ago

I created a support case with microsoft: 2312010050002462 some of my customers had to versionlock powershell because of this mishap...

esvmicrosoft commented 9 months ago

powershell 7.4 has been removed from the RHEL7 repository in packages.microsoft.com.

thank you for the feedback.

daviddavis commented 9 months ago

I think this issue is solved.