PolySharp icon indicating copy to clipboard operation
PolySharp copied to clipboard

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

Open valadas opened this issue 1 year ago • 7 comments
trafficstars

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 ?

valadas avatar Dec 31 '23 19:12 valadas

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: https://github.com/Sergio0694/PolySharp/blob/a7a92a9ddd050275c91c42b711d22cb41c3fbf3d/src/PolySharp.SourceGenerators/PolySharp.targets#L41-L43

YoshiRulz avatar Jan 09 '24 13:01 YoshiRulz

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

valadas avatar Jan 09 '24 18:01 valadas

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

YoshiRulz avatar Jan 10 '24 01:01 YoshiRulz

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...

valadas avatar Jan 10 '24 03:01 valadas

It definitely works on both windows and Linux.

sungam3r avatar Jan 10 '24 10:01 sungam3r

https://github.com/graphql-dotnet/graphql-dotnet/blob/338db03214e72e3251a0514a8d4caa3ae7120a8d/src/Directory.Build.props#L29

sungam3r avatar Jan 10 '24 10:01 sungam3r

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.

valadas avatar Jan 10 '24 20:01 valadas