Skip to content

Migrate projects to .NET 10 and align SDK tooling - #1174

Open
FibonacciFox wants to merge 10 commits into
peachpiecompiler:masterfrom
FibonacciFox:chore/net10-migration-bootstrap
Open

Migrate projects to .NET 10 and align SDK tooling#1174
FibonacciFox wants to merge 10 commits into
peachpiecompiler:masterfrom
FibonacciFox:chore/net10-migration-bootstrap

Conversation

@FibonacciFox

Copy link
Copy Markdown

Summary

  • migrate the solution from net6.0 to net10.0
  • update obsolete APIs, package references, and analyzer hotspots uncovered by the runtime upgrade
  • fix Linux SDK consumer execution for packaged Peachpie.NET.Sdk
  • align CI, local cache tooling, and documentation with the new SDK/runtime baseline

What changed

  • switched single-target projects from TargetFrameworks to TargetFramework where appropriate
  • removed Peachpie.Runtime nullability attribute conflicts against newer System.Runtime
  • replaced obsolete crypto, hosting, TLS, and related APIs with current .NET equivalents
  • ported curl HTTP transport from HttpWebRequest to HttpClient
  • updated vulnerable and outdated package references surfaced by net10.0
  • fixed cross-platform test assumptions in App tests
  • updated update-cache.ps1 and added build/update-cache.sh for Linux workflows
  • fixed packaged SDK compiler launch on non-Windows systems
  • added a CI smoke test that validates a consumer project using the packed SDK from .nugs
  • refreshed build documentation and SDK package metadata for the new target framework

Impact

  • moves the repository to a supported .NET runtime baseline
  • restores clean solution builds on .NET 10 with no warnings or errors
  • improves portability for Linux contributors and SDK consumers
  • reduces regression risk by validating both solution tests and the packaged SDK path in CI

Validation

  • dotnet build Peachpie.sln -nologo -v minimal
  • dotnet test Peachpie.sln -nologo -v minimal --no-build
  • dotnet test src/Tests/Peachpie.NET.SdkTests/Peachpie.NET.SdkTests.csproj -nologo -v minimal --no-build
  • local consumer smoke test via dotnet run against Peachpie.NET.Sdk/1.2.0-dev packages from .nugs

Notes

  • package readme warnings were left unchanged and are outside the scope of this migration.

Move the single-target projects from TargetFrameworks to TargetFramework and finish the net10 migration bootstrap across the solution.

Update package references to current versions, remove redundant framework packages, and address net10 analyzer and obsolete API warnings in the compiler, runtime libraries, and HTTP stream handling.

Adjust the App tests for platform-neutral line endings and glob path expectations so the full test suite passes on the current environment.
Replace the remaining HttpWebRequest-based curl execution path with HttpClient and HttpRequestMessage.

Introduce an internal request adapter so existing CURLOPT handling can continue to map onto the modern HTTP stack, and update curl response processing to use HttpResponseMessage while preserving headers, cookies, redirects, and request metadata.

Validated with a clean solution build and the full test suite on the current environment.
Refresh the GitHub Actions workflow to build and test the solution on .NET 10 using current setup-dotnet and checkout actions.

Update the dummy cache-restore project to net10, add the Linux update-cache shell script to the solution, and align the PowerShell and shell cache scripts with the current package ids and PeachpieVersion restore properties.

Validated with a clean solution build and full solution test run on the current environment.
@FibonacciFox

Copy link
Copy Markdown
Author

@dotnet-policy-service agree

@jakubmisek

Copy link
Copy Markdown
Member

Hello Maxim,

Thank you for the hard work. I'll update our build pipelines with .NET 10 SDKs and re-run the tests. Then let me check if everything is alright.

Please keep in mind, in order to be able to compile PeachPie MSBuild projects inside Visual Studio, the SDK itself (Peachpie.NET.Sdk) must be netstandard2.0.

To achieve full .NET 10 across the toolchain, there is also https://github.com/peachpiecompiler/Peachpie.Microsoft.CodeAnalysis, a fork of Microsoft's Roslyn CodeAnalysis that lacks a few modern .NET 5+ features. We're continuously updating it as needed to support a later .NET feature.

@FibonacciFox

Copy link
Copy Markdown
Author

Hello Jakub,

Thank you for the clarification.

Understood on Peachpie.NET.Sdk: I will keep the SDK layer on netstandard2.0, while treating the .NET 10 migration as applying to the compiler/runtime/libraries rather than the MSBuild SDK target itself. The current split in this PR follows that model: the SDK/task layer stays on netstandard2.0, while the compiler payload runs on net10.0.

Before I prepare any follow-up changes, could you clarify:

  1. Is there any part of this PR you would prefer to keep out of the current .NET 10 migration scope?
  2. Are there specific areas in this PR that you would like me to improve or adjust before merge?
  3. After this PR, would you prefer follow-up work to stay in this repository, or should I start looking at .NET 10 porting work in peachpiecompiler/Peachpie.Microsoft.CodeAnalysis next?

@FibonacciFox

FibonacciFox commented May 5, 2026

Copy link
Copy Markdown
Author

To achieve full .NET 10 across the toolchain, there is also https://github.com/peachpiecompiler/Peachpie.Microsoft.CodeAnalysis, a fork of Microsoft's Roslyn CodeAnalysis that lacks a few modern .NET 5+ features. We're continuously updating it as needed to support a later .NET feature.

I think the right path for full .NET 10 support is not to update the current Peachpie.Microsoft.CodeAnalysis fork in place, but to rebase PeachPie’s customizations onto a current dotnet/roslyn branch.
The existing fork is still based on an old Roslyn 3.7-era toolchain with outdated SDK/TFM/build assumptions. Patching that codebase forward to .NET 10 would likely mean manually redoing a large part of Roslyn’s later toolchain evolution.
A more practical approach is to start from a modern dotnet/roslyn base that already supports .NET 10, and then reapply only the PeachPie-specific delta:

InternalsVisibleTo for PeachPie

package/assembly identity changes for Peachpie.Microsoft.CodeAnalysis

any remaining PeachPie-specific compatibility fixes that are still needed on top of current Roslyn
So I think the more practical migration target would be “PeachPie patches on top of modern Roslyn”, rather than “bringing the old PeachPie Roslyn fork itself up to .NET 10”. I can try to take this on from my side if that direction makes sense to you.

@FibonacciFox

Copy link
Copy Markdown
Author

We could do this in a separate branch of the current fork and then send a PR. My idea would be to use that branch to rebase onto a current dotnet/roslyn base first, and then reapply only the PeachPie-specific changes on top of it, instead of trying to evolve the existing old Roslyn-based branch in place.

@jakubmisek

jakubmisek commented May 8, 2026

Copy link
Copy Markdown
Member

@FibonacciFox great thoughts -

You are right with the Microsoft.CodeAnalysis, I'm just afraid that there were so many changes that it will require quite a lot of work. If you are willing to take a look at that, I'll be happy to help.


Awesome work with the PR; there are some not-related changes that I need to check.

Additionally, the github workflow needs to have caching disabled, I think - that's why it's probably failing.

I'll add some notes to the code if I find anything that I don't understand :)

@FibonacciFox

Copy link
Copy Markdown
Author

Thanks, Jakub — I’ll work to contribute to the migration toward a newer Roslyn base.

@FibonacciFox

FibonacciFox commented May 11, 2026

Copy link
Copy Markdown
Author

@jakubmisek
Could you please take a look here? =)
https://github.com/FibonacciFox/Peachpie.Microsoft.CodeAnalysis/tree/port-peachpie-patches
https://github.com/FibonacciFox/peachpie/tree/validation/pmca-net10-migration-check
I’ve started working on porting the PeachPie patches and would appreciate any feedback or guidance.
image

@jakubmisek

Copy link
Copy Markdown
Member

That's amazing @FibonacciFox - I understand how much work it must have been. So far it looks alright, tests passing, and we would have the new Roslyn! which is awesome. (it may allow us to create a proper language integration for IDE and we'll have all the new C# features)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants