Sergio0694/PolySharp

Is it possible to use PolySharp on a github Ubuntu Runner ?

Opened this issue · 7 comments

Basically, I just started using PolySharp on a project and find it amazing. Now that project repository is setup to build on Ubuntu runners on github actions and I am getting this error:

     /home/runner/.nuget/packages/polysharp/1.14.1/buildTransitive/PolySharp.targets(45,5): error POLYSPCFG0001: The PolySharp source generators have been disabled on the current configuration, as they need Roslyn 4.3 in order to work. PolySharp requires the source generators to run in order to generate polyfills, so the library cannot be used without a more up to date IDE (eg. VS 2022 17.3 or greater) or .NET SDK version (.NET 6.0.400 SDK or greater). [/home/runner/work/some-module/some-module/Module.csproj]

The build process uses .Net 7 but the actual built project is .Net Framework.

Is there thing I could try to fix that or is this scenario just not a supported one ?

Are you sure it's configured to use version 7.x.x of the .NET SDK?
For reference, the error is bespoke and comes from here.


at maintainers: Is it necessary to manually check Roslyn's version? IIRC if you compile against a certain version of Microsoft.CodeAnalysis.Analyzers, trying to use an older SDK will result in the Source Generator failing to load. Nevermind, I kept reading:

If the source generators are disabled, also emit an error. This would've been produced by MSBuild itself as well, but
emitting this manually lets us customize the message to inform developers as to why exactly the generators have been
disabled, and that PolySharp will not work at all unless a more up to date IDE or compiler version are used.

Sooo it means it would not work without Visual Studio, so should work on a windows runner but not ubuntu right ?

I didn't say that. Roslyn is cross-platform.

Are you aware of any usage in a ubuntu pipeline ? If it could be a bug, I am happy to create a public repo with minimal reproduction scenario...

It definitely works on both windows and Linux.

Thanks @sungam3r I'll dig further here mainly wanted to figure out if it was pursuing or if it was just not supported. I'll try to create a minimal repo to reproduce the issue and try to figure out what I am doing differently.