-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Use apphost for core compiler #80026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/Compilers/Core/MSBuildTaskTests/TestUtilities/IntegrationTestBase.cs
Show resolved
Hide resolved
src/Compilers/Core/MSBuildTaskTests/TestUtilities/IntegrationTestBase.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/InternalUtilities/PlatformInformation.cs
Outdated
Show resolved
Hide resolved
} | ||
return success; | ||
logger.Log("Setting {0} to '{1}'", RuntimeHostInfo.DotNetRootEnvironmentName, dotNetRoot); | ||
Environment.SetEnvironmentVariable(RuntimeHostInfo.DotNetRootEnvironmentName, dotNetRoot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you going this approach vs. just customizing the environment variables in the process start info? MSBuild is looking hard into single process execution in the future, this would be a code path we'd have to come back and revisit if that happened as they'd ban global env changing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the Windows code path uses P/Invoke and customizing the environment variables there seems non-trivial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's take a follow up item to fix that post .NET 10 RTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've investigated more and seems the problem is the "inherit handles" flag which is hardcoded to true in the runtime whereas we need false
there otherwise the Csc task just hangs (waiting for the spawned VBCSCompiler process to exit I guess?)
Anyway, opened #80079.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure @agocke dug into the inherits handle flag at one point. He might have context here.
} | ||
|
||
[Theory, CombinatorialData] | ||
public void SdkBuild_Csc(bool useSharedCompilation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests failing in some CI legs reveal possible regressions if we take this change:
- The single machine Linux leg fails due to missing .NET 9 runtime. I'm not sure why
dotnet csc.dll
didn't fail andDOTNET_ROOT=... csc
fails, perhaps I'm doing something wrong here.
Logs
CoreCompile:
/mnt/vss/_work/1/s/artifacts/bin/Microsoft.Build.Tasks.CodeAnalysis.UnitTests/Debug/net9.0/bincore/csc /noconfig /unsafe- /checked- /nowarn:1701,1702,1701,1702 /fullpaths /nostdlib+ /errorreport:prompt /define:TRACE;DEBUG;NETSTANDARD;NETSTANDARD2_0;NETSTANDARD1_0_OR_GREATER;NETSTANDARD1_1_OR_GREATER;NETSTANDARD1_2_OR_GREATER;NETSTANDARD1_3_OR_GREATER;NETSTANDARD1_4_OR_GREATER;NETSTANDARD1_5_OR_GREATER;NETSTANDARD1_6_OR_GREATER;NETSTANDARD2_0_OR_GREATER /highentropyva+ /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/Microsoft.Win32.Primitives.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/mscorlib.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/netstandard.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.AppContext.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Collections.Concurrent.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Collections.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Collections.NonGeneric.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Collections.Specialized.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ComponentModel.Composition.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ComponentModel.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ComponentModel.EventBasedAsync.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ComponentModel.Primitives.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ComponentModel.TypeConverter.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Console.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Core.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Data.Common.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Data.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.Contracts.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.Debug.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.FileVersionInfo.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.Process.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.StackTrace.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.TextWriterTraceListener.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.Tools.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.TraceSource.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.Tracing.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Drawing.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Drawing.Primitives.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Dynamic.Runtime.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Globalization.Calendars.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Globalization.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Globalization.Extensions.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.Compression.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.Compression.FileSystem.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.Compression.ZipFile.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.FileSystem.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.FileSystem.DriveInfo.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.FileSystem.Primitives.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.FileSystem.Watcher.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.IsolatedStorage.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.MemoryMappedFiles.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.Pipes.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.UnmanagedMemoryStream.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Linq.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Linq.Expressions.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Linq.Parallel.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Linq.Queryable.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Http.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.NameResolution.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.NetworkInformation.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Ping.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Primitives.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Requests.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Security.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Sockets.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.WebHeaderCollection.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.WebSockets.Client.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.WebSockets.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Numerics.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ObjectModel.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Reflection.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Reflection.Extensions.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Reflection.Primitives.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Resources.Reader.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Resources.ResourceManager.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Resources.Writer.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.CompilerServices.VisualC.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Extensions.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Handles.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.InteropServices.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.InteropServices.RuntimeInformation.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Numerics.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Serialization.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Serialization.Formatters.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Serialization.Json.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Serialization.Primitives.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Serialization.Xml.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Claims.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Cryptography.Algorithms.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Cryptography.Csp.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Cryptography.Encoding.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Cryptography.Primitives.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Cryptography.X509Certificates.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Principal.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.SecureString.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ServiceModel.Web.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Text.Encoding.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Text.Encoding.Extensions.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Text.RegularExpressions.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.Overlapped.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.Tasks.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.Tasks.Parallel.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.Thread.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.ThreadPool.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.Timer.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Transactions.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ValueTuple.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Web.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Windows.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.Linq.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.ReaderWriter.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.Serialization.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.XDocument.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.XmlDocument.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.XmlSerializer.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.XPath.dll /reference:/home/cloudtest/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.XPath.XDocument.dll /debug+ /debug:portable /filealign:512 /optimize- /out:obj/Debug/netstandard2.0/Test.dll /target:library /warnaserror- /utf8output /deterministic+ /langversion:7.3 /analyzerconfig:obj/Debug/netstandard2.0/Test.GeneratedMSBuildEditorConfig.editorconfig File.cs "obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs" obj/Debug/netstandard2.0/Test.AssemblyInfo.cs /warnaserror+:NU1605
Setting DOTNET_ROOT to '/mnt/vss/_work/1/s/.dotnet'
Compilation request Test (netstandard2.0), PathToTool=/mnt/vss/_work/1/s/artifacts/bin/Microsoft.Build.Tasks.CodeAnalysis.UnitTests/Debug/net9.0/bincore/csc
CompilerServer: tool - using command line tool by design '/mnt/vss/_work/1/s/artifacts/bin/Microsoft.Build.Tasks.CodeAnalysis.UnitTests/Debug/net9.0/bincore/csc' - Test (netstandard2.0)
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : You must install or update .NET to run this application. [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : App: /mnt/vss/_work/1/s/artifacts/bin/Microsoft.Build.Tasks.CodeAnalysis.UnitTests/Debug/net9.0/bincore/csc [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : Architecture: x64 [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : Framework: 'Microsoft.NETCore.App', version '9.0.0' (x64) [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : .NET location: /usr/lib/dotnet [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : The following frameworks were found: [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : 6.0.36 at [/usr/lib/dotnet/shared/Microsoft.NETCore.App] [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : Learn about framework resolution: [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : https://aka.ms/dotnet/app-launch-failed [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : To install missing framework, download: [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>/mnt/vss/_work/1/s/.dotnet/sdk/10.0.100-preview.6.25358.103/Roslyn/Microsoft.CSharp.Core.targets(84,5): error : https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=9.0.0&arch=x64&rid=ubuntu.22.04-x64 [/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj]
1>Done Building Project "/tmp/RoslynTests/aef9b98c-4f0e-4855-a96a-ea07f646f61e/Test.csproj" (Build target(s)) -- FAILED.
- If the executables are copied without
chmod +x
, they will fail to start. That was happening in our CI as well until I changed the rehydration utility (see changes insrc/Tools/PrepareTests/MinimizeUtil.cs
). - When the Csc task is built on Linux and executed on macOS, previously that worked fine, now it fails with "Exec format error". I guess that's because the macOS runs on ARM so needs a different apphost which makes sense, but someone could be relying on this behavior (like our CI currently is!)
@jaredpar are those breaks acceptable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with both (2) and (3). The rational is that this is how the .NET SDK generally works today for any other component hence we're just falling in line with that behavior.
The single machine Linux leg fails due to missing .NET 9 runtime. I'm not sure why dotnet csc.dll didn't fail and DOTNET_ROOT=... csc fails, perhaps I'm doing something wrong here.
That is odd. Not sure why an apphost would bake in a stronger .NET runtime requirement than the dotnet exec
approach. @jkoritzinsky, @agocke any thoughts on why this would happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best guess is something in the runtimeconfig.json changed (or the file appeared for the first time). Can you see what it says inside? If you want to run on net8+ it should be net8 with roll forward major.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file is the same before and after.
{
"runtimeOptions": {
"tfm": "net9.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "9.0.0"
},
"rollForward": "Major",
"configProperties": {
"System.GC.Server": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized only csc/vbc fails, VBCSCompiler seems to work fine, so I guess there is really something different in the way we launch them, will investigate more...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe enum values are parsed case-insensitive, but I notice on https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#rollforward that the casing is lower case, i.e. rollForward": "major"
. Might be worth changing that just in case this is working by accident.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm just setting DOTNET_ROOT incorrectly when invoking csc/vbc, will fix.
Regarding casing, I believe the runtimeconfig.json file is generated by the build...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, it's flowed in through MSBuild using different casing: https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#rollforward
This must be case-insensitive and undocumented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, just saw this part:
When the Csc task is built on Linux and executed on macOS, previously that worked fine, now it fails with "Exec format error". I guess that's because the macOS runs on ARM so needs a different apphost which makes sense, but someone could be relying on this behavior (like our CI currently is!)
Right, the apphost is a native binary so it needs to match the platform you're building for. Meaning you'll need a different package for each target platform.
@RikkiGibson, @JoeRobich PTAL |
@@ -16,6 +16,8 @@ internal static class MinimizeUtil | |||
{ | |||
internal record FilePathInfo(string RelativeDirectory, string Directory, string RelativePath, string FullPath); | |||
|
|||
private static readonly Guid s_executablesGroup = new Guid("2665eb42-0a7d-4ea2-bb92-e4251d48df44"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you document this?
The trick is to set DOTNET_ROOT based on the DOTNET_HOST_PATH which we already have available. Then
csc.exe
/vbc.exe
/VBCSCompiler.exe
should behave just like thedotnet exec *.dll
equivalent behaved previously. Plus there are benefits - quoting @jaredpar: with this we get named processes back and all the benefits that come with it: better perf bucketing, Watson, kill VBCSCompiler.exe keeps working, etc.Part of dotnet/msbuild#11142.