os icon indicating copy to clipboard operation
os copied to clipboard

powershell/7.4.5 package update

Open octo-sts[bot] opened this issue 1 year ago • 6 comments

octo-sts[bot] avatar Aug 20 '24 21:08 octo-sts[bot]

Open AI suggestions to solve the build error:

The error message is: "CSC : error CS9057: The analyzer assembly '/home/build/powershell/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/bin/Linux/netstandard2.0/SMA.Generator.dll' references version '4.9.0.0' of the compiler, which is newer than the currently running version '4.8.0.0'."

Steps to Fix:
1. Update the compiler to version 4.9.0.0 or higher.
2. Ensure all dependencies are compatible with the new compiler version.
3. Rebuild the project to verify the error is resolved.

octo-sts[bot] avatar Aug 20 '24 21:08 octo-sts[bot]

This PR supersedes https://github.com/wolfi-dev/os/pull/24782 which has some more context and comments on the build issues and possible solutions

philroche avatar Aug 21 '24 07:08 philroche

Open AI suggestions to solve the build error:

The error message is: "CSC : error CS9057: The analyzer assembly '/home/build/powershell/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/bin/Linux/netstandard2.0/SMA.Generator.dll' references version '4.9.0.0' of the compiler, which is newer than the currently running version '4.8.0.0'."

To fix this error:
1. Update the compiler to version 4.9.0.0 or higher.
2. Alternatively, downgrade the analyzer assembly to be compatible with the current compiler version 4.8.0.0.

octo-sts[bot] avatar Aug 21 '24 07:08 octo-sts[bot]

Open AI suggestions to solve the build error:

The error message is: "CSC : error CS9057: The analyzer assembly '/home/build/powershell/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/bin/Linux/netstandard2.0/SMA.Generator.dll' references version '4.9.0.0' of the compiler, which is newer than the currently running version '4.8.0.0'."

1. Update your compiler to version 4.9.0.0 or higher.
2. Ensure all project dependencies are compatible with the new compiler version.
3. Rebuild the project to verify the error is resolved.

octo-sts[bot] avatar Sep 20 '24 17:09 octo-sts[bot]

Open AI suggestions to solve the build error:

The error message is: "CSC : error CS9057: The analyzer assembly '/home/build/powershell/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/bin/Linux/netstandard2.0/SMA.Generator.dll' references version '4.9.0.0' of the compiler, which is newer than the currently running version '4.8.0.0'."

Steps to Fix:
1. Update the compiler to version 4.9.0.0 or higher.
2. Ensure all dependencies are compatible with the new compiler version.
3. Rebuild the project to verify the error is resolved.

octo-sts[bot] avatar Oct 01 '24 20:10 octo-sts[bot]

I went through the history and ran some additional tests; here is a summary of my findings:

  • Despite trying to update versions, the latest PowerShell appears to depend on a dotnet compiler version that's newer than the latest available (still in prerelease phase) and it's not something that we build.
  • This was previously discovered and deferred to later with the hopes that updates would solve it. This does not appear to have been the case yet.
  • Phil wrote a good summary of our options. I've replicated them below as potential next steps.
  • The latest Powershell and .NET builds are from mid August. Perhaps a new version is around the corner with .NET 9 now up to RC1.

Next steps and options:

One way or another, this will require more in-depth conversations to decide which path to take. Options include:

  • Build a new SDK package from a different source to the runtime so we have an SDK version newer than that packaged currently?
    • May make sense as I think we're doing this already for other packages. But as far as I can tell, this still won't solve the fact that it wants a compiler version only found in the prerelease SDK.
  • Patch the SDK requirement in powershell and hope nothing breaks?
    • Doesn't seem like best practice, and at best a bit of a hacky workaround without proper testing.
  • Propose an upstream patch to powershell to not depend on an SDK version that is not packaged by Wofli or Ubuntu
    • Not sure why but it doesn't seem like this is really happening or reported elsewhere with powershell specifically, so this may make sense to do regardless.

References:

  • https://github.com/wolfi-dev/os/pull/24782
    • Previous PR with some findings I ported here. This PR (#26775) supersedes the linked PR (#24782).
  • https://github.com/chainguard-dev/internal-dev/issues/24
    • Internal discussions with additional info not necessarily all ported here.
  • https://github.com/PowerShell/PowerShell/releases/tag/v7.4.5
    • Shows minimum .NET SDK version of 8.0.400, which appears to require compiler version 4.9.0.0 based on running the image build.
  • https://github.com/dotnet/dotnet/releases/tag/v8.0.8
    • I would think since 8 > 400, this would provide the required compiler, but it seems to only provide version 4.8.0.0.
  • https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-9/sdk#analyzer-mismatch
    • This help article discusses the exact error we're getting. .NET 9 will "detect and automatically adjust for this problem scenario", meaning that once it's out of prerelease and we can use it, it may resolve the issue all by itself.

hbh7 avatar Oct 02 '24 17:10 hbh7

superseded by https://github.com/wolfi-dev/os/pull/31616

octo-sts[bot] avatar Oct 22 '24 22:10 octo-sts[bot]