stryker-net: Stryker fails with .NET 8 RC2 SDK
Describe the bug
Stryker fails to compile code when run with the .NET 8 SDK.
Having updated Polly to use the .NET 8 SDK to build and adopt some C# 12 language syntax to resolve analyser warnings, our mutation tests that use Stryker are no longer working. This was working in earlier previews, but seems to have stopped working since RC1.
The latest attempt at upgrading with minimal changes to reduce the number of variables that could have broken things can be found here.
An older PR that’s had various force pushes over the last few months can be found here, which contains more changes related to actually using .NET 8. We tried a few things in that PR to fix things, such as having Stryker use .NET 6, 7 and 8 to see if it was a configuration issue, or something we could side-step.
We have some .NET 8-specific changes we’d like to release in November once 8.0.0 is available, so if we can’t get things working we’re likely going to have to disable our mutation tests as otherwise it will be a blocker for that release as we have to use the .NET 8 SDK for those changes.
I happened to notice in the last hour that there was a new version of Stryker available, so I’m in the process of applying that update too in case that would resolve it.
Logs
Failed build logs here: logs
I’ll attempt to produce a log file at a later point.
Expected behavior
The tests succeed the same way they do for us with the .NET 7 SDK.
Desktop (please complete the following information):
- OS: Ubuntu 22.04
- Type of project: .NET library
- Framework Version: .NET 8.0.100 RC2 SDK
- Stryker Version: 3.10.0
Additional context
None.
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Reactions: 1
- Comments: 16 (8 by maintainers)
Commits related to this issue
- test: use preview language tag of Stryker to get C# 12 support See https://github.com/stryker-mutator/stryker-net/issues/2741 — committed to mu88/RaspiFanController by mu88 7 months ago
- test: use preview language tag of Stryker to get C# 12 support See https://github.com/stryker-mutator/stryker-net/issues/2741 — committed to mu88/ScreenshotCreator by mu88 7 months ago
- Bump dotnet-stryker to 3.12.0 See https://github.com/stryker-mutator/stryker-net/issues/2741. — committed to App-vNext/Polly by martincostello 7 months ago
- Bump dotnet-stryker to 3.12.0 See https://github.com/stryker-mutator/stryker-net/issues/2741. — committed to App-vNext/Polly by martincostello 7 months ago
- chore(deps): update Stryker and remove C# 12 workaround See stryker-mutator/stryker-net#2741 — committed to mu88/ScreenshotCreator by mu88 7 months ago
- chore(deps): update Stryker and remove C# 12 workaround See stryker-mutator/stryker-net#2741 — committed to mu88/ThisIsYourLife by mu88 7 months ago
- chore(deps): update Stryker and remove C# 12 workaround See stryker-mutator/stryker-net#2741 — committed to mu88/RaspiFanController by mu88 7 months ago
The stable build of the open source roslyn (compiler) package does not yet have support for dotnet 8, so until Microsoft releases this you’ll have to set the language version to preview. Unfortunately the release of the compiler package is never done before the release of the new dotnet version and language version so we’re always at least a couple days behind…
@mu88 I doubt they’re aware of this. But they’re usually not this late anyway, usually a couple days at most. Most users don’t experience issues with this because they’re not going to be updating on release day. I doubt they can do anything for those couple users on the bleeding edge as they have more or less the same issue we have. They have to release the proprietary version first, after which they can update and release the open source SDK packages.
Let’s hope the Roslyn update is released sooner next language update 😃
3.12.0 appears to resolve the issue 🙇
3.12.0 is being released and should be available within the hour, please let me know if this fixes both issues @martincostello @mu88
#2773
Thanks. I was looking for an error message I though I added a few months ago, but I failed to see it. And I don’t see it in Stryker source files. I guess it is in some yet to be merged PR. That being said, that error message would not have been super helpful, merely a confirmation of what is happening. Compilation error messages point toward Stryker/Builadalyzer failing to properly capture project references. We have no clear cause for this as of now.
could you adjust log levels for Stryker? Ideally, using
--logToFile
and providing us the resulting log? Stryker fails at analyzing the projects, clearly failing to capture dependencies. There is also a warning that net7.0 is requested while there is no configuration supporting it. SDK resolution is tricky and not handled by Stryker, and this is a crucial step. Changing C# version will not change a bit, I am afraid.