postsharp / Metalama

Metalama is a Roslyn-based meta-programming framework. Use this repo to report bugs or ask questions.
164 stars 4 forks source link

Can not build at Build Server #293

Closed devperson closed 2 months ago

devperson commented 2 months ago

Hello, I am using the OverrideMethodAspect of the Metalama framework to create a logging attribute. It works and I can build in my Visual Studio 2022 and run the app(I see logging works in output). I would like to use it in my projects but I have one issue: The source code with Metalama framework fails to build at Build Server. I use AppCenter.ms to build all my projects. Here is the error that I see in the AppCenter build logs:

/Users/runner/.nuget/packages/metalama.compiler/2024.1.7/tasks/net472/csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1701,1702 /fullpaths /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE;METALAMA;RELEASE;NETSTANDARD;NETSTANDARD2_0 /highentropyva+ /reference:/Users/runner/.nuget/packages/jetbrains.annotations/2022.3.1/lib/netstandard2.0/JetBrains.Annotations.dll /reference:/Users/runner/.nuget/packages/metalama.extensions.dependencyinjection/2024.1.14/lib/netstandard2.0/Metalama.Extensions.DependencyInjection.dll /reference:/Users/runner/.nuget/packages/metalama.framework.redist/2024.1.14/lib/netstandard2.0/Metalama.Framework.dll /reference:/Users/runner/.nuget/packages/metalama.framework.runtime/2024.1.4/lib/netstandard2.0/Metalama.Framework.RunTime.dll /reference:/Users/runner/.nuget/packages/metalama.framework.redist/2024.1.14/lib/netstandard2.0/Metalama.SystemTypes.dll /reference:/Users/runner/.nuget/packages/microsoft.csharp/4.7.0/ref/netstandard2.0/Microsoft.CSharp.dll /reference:/Users/run...
  CompilerServer: server failed - server rejected the request 'Error reading response: Reached end of stream before end of read.' - eaea0f2c-9cf4-4772-9046-ec3056d2429c
/Users/runner/.nuget/packages/metalama.compiler/2024.1.7/tasks/net472/Microsoft.CSharp.Core.targets(113,5): error :  [/Users/runner/work/1/s/App.Common.Services/App.Common.Services.csproj]
/Users/runner/.nuget/packages/metalama.compiler/2024.1.7/tasks/net472/Microsoft.CSharp.Core.targets(113,5): error : ================================================================= [/Users/runner/work/1/s/App.Common.Services/App.Common.Services.csproj]
/Users/runner/.nuget/packages/metalama.compiler/2024.1.7/tasks/net472/Microsoft.CSharp.Core.targets(113,5): error :     External Debugger Dump: [/Users/runner/work/1/s/App.Common.Services/App.Common.Services.csproj]
/Users/runner/.nuget/packages/metalama.compiler/2024.1.7/tasks/net472/Microsoft.CSharp.Core.targets(113,5): error : ================================================================= [/Users/runner/work/1/s/App.Common.Services/App.Common.Services.csproj]
Done Building Project "/Users/runner/work/1/s/App.Common.Services/App.Common.Services.csproj" (default targets) -- FAILED.

Metalama version 2024.1.14 AppCenter uses Mono 6.12 to build .Net projects

gfraiteur commented 2 months ago

It seems that the compiler background process crashed.

You can try disabling this background adding this to your project: <UseSharedCompilation>False</UseSharedCompilation> but this makes the build significantly slower.

Note that running the compiler under Mono is neither tested nor supported. There is little chance we might support it since I see that the platform is scheduled for deprecation.

devperson commented 2 months ago

Hi @gfraiteur I tried to use <UseSharedCompilation>False</UseSharedCompilation> but this didn't help. Can you please suggest any CI service like AppCenter.ms that can compile the Metalama? Maybe Azure DevOps?

prochan2 commented 2 months ago

Hi @devperson, you can compile projects with Metalama using any continuous integration tool, that uses .NET SDK on its build agents. Here are some examples to choose from: Azure Pipelines on Azure DevOps, GitHub Actions, TeamCity, Jenkins, Bamboo, GoCD, BuildKite, CircleCI, Semaphore CI, Travis CI.

gfraiteur commented 2 months ago

@devperson With UseSharedCompilation I hoped you would get a better error message. Did you get any?

devperson commented 2 months ago

Hi gfraiteur, Thanks for the CI list. When I use the <UseSharedCompilation>False</UseSharedCompilation> attribute I get the same error. Also, I could reproduce the issue in my Macbook with Visual Studio for Mac.

gfraiteur commented 2 months ago

Thank you for the feedback.

Our decision is that the scenario (running Metalama under Mono) is not and will not be supported.