-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix SupportedRuntimeIdentifiers substitution in Directory.Build.targets.in. #48022
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
|
Thanks for your PR, @tmds. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
I was under the assumption that the tests only fail in Helix because we only run the Helix tests against the Windows-built runtime pack / shared framework. They should pass in a local build. @tmds - what error are you seeing when they run? |
|
I have not run them on my machine, on our Linux CI server I see: <test name="Templates.Test.GrpcTemplateTest.GrpcTemplateNativeAot" type="Templates.Test.GrpcTemplateTest" method="GrpcTemplateNativeAot" time="94.2551574" result="Fail">
<output><![CDATA[| [0.001s] TestLifetime Information: Starting test GrpcTemplateNativeAot at 2023-05-01T23:40:29
| [0.002s] Templates.Test.GrpcTemplateTest Information: ==> /home/tester/aspnetcore/.dotnet/dotnet new grpc --debug:disable-sdk-templates --debug:custom-hive "/home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/Hives/b473dcd1-4727-479d-acb1-25d79f0e2d27/.templateengine" --aot -o /home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman [/home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/]
| [0.948s] Templates.Test.GrpcTemplateTest Information: The template "ASP.NET Core gRPC Service" was created successfully.
| [0.949s] Templates.Test.GrpcTemplateTest Information:
| [0.949s] Templates.Test.GrpcTemplateTest Information: Processing post-creation actions...
| [0.950s] Templates.Test.GrpcTemplateTest Information: Restoring /home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman/AspNet.Pgpzatoryman.csproj:
| [1.996s] Templates.Test.GrpcTemplateTest Information: Determining projects to restore...
| [56.579s] Templates.Test.GrpcTemplateTest Information: Restored /home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman/AspNet.Pgpzatoryman.csproj (in 53.68 sec).
| [56.624s] Templates.Test.GrpcTemplateTest Information: Restore succeeded.
| [56.624s] Templates.Test.GrpcTemplateTest Information:
| [56.626s] Templates.Test.GrpcTemplateTest Information:
| [56.627s] Templates.Test.GrpcTemplateTest Information: [ERROR] Failed to check update for Microsoft.DotNet.Web.ProjectTemplates.8.0::8.0.0-ci: Failed to check the update for the package Microsoft.DotNet.Web.ProjectTemplates.8.0::8.0.0-ci.
| [56.627s] Templates.Test.GrpcTemplateTest Information: [ERROR] Details: Value cannot be null. (Parameter 'releasePrefix')..
| [56.627s] Templates.Test.GrpcTemplateTest Information: [ERROR]
| [56.649s] Templates.Test.GrpcTemplateTest Information: Process exited.
| [56.650s] Templates.Test.GrpcTemplateTest Information: Publishing ASP.NET Core application...
| [56.650s] Templates.Test.GrpcTemplateTest Information: ==> /home/tester/aspnetcore/.dotnet/dotnet publish -c Release /bl [/home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman]
| [56.879s] Templates.Test.GrpcTemplateTest Information: MSBuild version 17.7.0-preview-23225-01+6300d22b2 for .NET
| [58.085s] Templates.Test.GrpcTemplateTest Information: Determining projects to restore...
| [93.857s] Templates.Test.GrpcTemplateTest Information: Restored /home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman/AspNet.Pgpzatoryman.csproj (in 34.97 sec).
| [93.996s] Templates.Test.GrpcTemplateTest Information: /home/tester/aspnetcore/.dotnet/sdk/8.0.100-preview.5.23226.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(287,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman/AspNet.Pgpzatoryman.csproj]
| [94.150s] Templates.Test.GrpcTemplateTest Information: /home/tester/aspnetcore/.dotnet/sdk/8.0.100-preview.5.23226.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(478,5): error NETSDK1082: There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'linux-x64'. [/home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman/AspNet.Pgpzatoryman.csproj]
| [94.252s] Templates.Test.GrpcTemplateTest Information: Process exited.
| [94.257s] Templates.Test.GrpcTemplateTest Error: Test threw an exception.
| Xunit.Sdk.TrueException: Project new grpc --aot failed to publish. Exit code 1.
| /home/tester/aspnetcore/.dotnet/dotnet publish -c Release /bl \nStdErr: \nStdOut: MSBuild version 17.7.0-preview-23225-01+6300d22b2 for .NET
| Determining projects to restore...
| Restored /home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman/AspNet.Pgpzatoryman.csproj (in 34.97 sec).
| /home/tester/aspnetcore/.dotnet/sdk/8.0.100-preview.5.23226.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(287,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman/AspNet.Pgpzatoryman.csproj]
| /home/tester/aspnetcore/.dotnet/sdk/8.0.100-preview.5.23226.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(478,5): error NETSDK1082: There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'linux-x64'. [/home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman/AspNet.Pgpzatoryman.csproj]
| Expected: True
| Actual: False
| at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/xunit.assert/Asserts/BooleanAsserts.cs:line 132
| at Xunit.Assert.True(Boolean condition, String userMessage) in /_/src/xunit.assert/Asserts/BooleanAsserts.cs:line 116
| at Templates.Test.Helpers.Project.RunDotNetPublishAsync(IDictionary`2 packageOptions, String additionalArgs, Boolean noRestore) in /_/src/ProjectTemplates/Shared/Project.cs:line 152
| at Templates.Test.GrpcTemplateTest.GrpcTemplateCore(String[] args) in /_/src/ProjectTemplates/test/Templates.Tests/GrpcTemplateTest.cs:line 91
| at Templates.Test.GrpcTemplateTest.GrpcTemplateNativeAot() in /_/src/ProjectTemplates/test/Templates.Tests/GrpcTemplateTest.cs:line 52
| at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_0.<<InvokeTestMethodAsync>b__1>d.MoveNext() in /_/src/xunit.execution/Sdk/Frameworks/Runners/TestInvoker.cs:line 264
| --- End of stack trace from previous location ---
| at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in /_/src/xunit.execution/Sdk/Frameworks/ExecutionTimer.cs:line 48
| at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in /_/src/xunit.core/Sdk/ExceptionAggregator.cs:line 90
| [94.259s] TestLifetime Information: Finished test GrpcTemplateNativeAot in 94.2583206s
]]></output>
<failure exception-type="Xunit.Sdk.TrueException">
<message><![CDATA[Project new grpc --aot failed to publish. Exit code 1.\n/home/tester/aspnetcore/.dotnet/dotnet publish -c Release /bl \\nStdErr: \\nStdOut: MSBuild version 17.7.0-preview-23225-01+6300d22b2 for .NET\n Determining projects to restore...\n Restored /home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman/AspNet.Pgpzatoryman.csproj (in 34.97 sec).\n/home/tester/aspnetcore/.dotnet/sdk/8.0.100-preview.5.23226.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(287,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman/AspNet.Pgpzatoryman.csproj]\n/home/tester/aspnetcore/.dotnet/sdk/8.0.100-preview.5.23226.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(478,5): error NETSDK1082: There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'linux-x64'. [/home/tester/aspnetcore/src/ProjectTemplates/test/Templates.Tests/bin/Release/net8.0/TestTemplates/AspNet.Pgpzatoryman/AspNet.Pgpzatoryman.csproj]\n\nExpected: True\nActual: False]]></message>
<stack-trace><![CDATA[ at Templates.Test.Helpers.Project.RunDotNetPublishAsync(IDictionary`2 packageOptions, String additionalArgs, Boolean noRestore) in /_/src/ProjectTemplates/Shared/Project.cs:line 152
at Templates.Test.GrpcTemplateTest.GrpcTemplateCore(String[] args) in /_/src/ProjectTemplates/test/Templates.Tests/GrpcTemplateTest.cs:line 91
at Templates.Test.GrpcTemplateTest.GrpcTemplateNativeAot() in /_/src/ProjectTemplates/test/Templates.Tests/GrpcTemplateTest.cs:line 52
--- End of stack trace from previous location ---]]></stack-trace>
</failure>
</test>The CI job runs: |
|
@wtgodbe - any thoughts on why the runtime pack for |
It would be, my guess is the tests aren't able to access it. Template tests can be weird since they run from a temp dir, so they don't get access to all of our .props/.targets files (though we give them access to enough that I'd expect this scenario to work, so clearly something is going wrong). Maybe these work in Helix because we explicitly lay things out such that they'll have access to the built SharedFx, but local builds would always fail. Do they pass locally on Windows? The easiest way to diagnose this would be if we could look at the generated .csproj that runs the test in a local build (e.g. |
|
The tests are failing on windows too. |
|
Also: |
In order to run the tests, you need C++ on the machine. |
|
That's coming from the CI, so our agents aren't correctly configured? |
Maybe? I know that in #47247 @mitchdenny needed to use specific Helix machines to get the tests to pass. |
|
Yeah, these tests were only able to run on a specific Helix queue that had the right VS components installed. As for the SharedFx issue, do these tests use the shared template test infra like https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in? That should already be set up to get the tests restoring the just-built SharedFx, as long as it's already built. Seeing the temp .csproj & its associated Dir.Build.Props/Targets files would give us the info we need. |
|
@wtgodbe I'm trying to understand if this is an issue specific to our CI server, or if these tests aren't passing anywhere but the specific Helix queues? |
My understanding is that they should pass on any machine w/ the right C++ tools, but it seems like we're learning that's not that case. That being said, I don't know much about these specific tests, @mitchdenny has more context than I do there (e.g. on whether or not they can pass locally). |
|
Not that much more context ;) My goal was to just get some coverage of the templates and we accepted them running on just Windows as a good starting point. It would be great if we could get them running on Linux also but we couldn't get it working (I think it was an error related to a runtime targetting pack). |
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.
@JamesNK @mitchdenny I think this list has to be extended to include all other queues where the test fail.
Ditto for the other three tests.
|
I debugged the issue and the problem is with the newlines/whitespace in An alternative fix could be to do something to the
|
I think this would be a more strategic solution (with a comment), as there's no guarantee someone won't change the list to multiline again. |
|
@wtgodbe is there a way with the Helix attributes that you want a test to opt into a queue rather than opt out? Seems like in the long term opting out of queues is inefficient for some test cases (although opting out is good for test cases where we know we can achieve broad platform coverage). |
The code that reads this is https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs. It splits by I've added a comment that whitespace is not supported in this property. |
|
CI is green. Also on a Linux system, the aot tests are now passing. |
eerhardt
left a comment
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.
Thanks for finding and fixing this, @tmds!
Not that I know of - so far there haven't been that many tests that this has been a problem for. We could consider adding that, can you open an issue for it? |
#47247 enabled AOT template tests.
From the comments on the PR, it seems the tests are known to fail on Linux.
This adds attributes to skip those tests on Linux, like when running on a Linux developer machine, or our internal CI machines.
@JamesNK @dougbu @eerhardt ptal.