Skip to content
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

Use the "live" NuGet.config file from sdk in VMR #46215

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

ViktorHofer
Copy link
Member

The checked-in NuGet.config file under src/sdk is missing the live feeds which are necessary when restoring packages in scenario-tests.

The checked-in NuGet.config file under src/sdk is missing the live feeds which are necessary when restoring packages in scenario-tests.
@ViktorHofer ViktorHofer requested review from a team as code owners January 22, 2025 17:40
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Jan 22, 2025
@ViktorHofer ViktorHofer requested a review from mthalman January 22, 2025 17:41
@ViktorHofer
Copy link
Member Author

      Restored /__w/1/vmr/artifacts/scenario-tests/artifacts/SdkTemplateTestsAot_Web_CSharp/SdkTemplateTestsAot_Web_CSharp.csproj (in 2.08 sec).
    /__w/1/vmr/artifacts/obj/extracted-dotnet-sdk/sdk/10.0.100-alpha.1.25072.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(326,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/__w/1/vmr/artifacts/scenario-tests/artifacts/SdkTemplateTestsAot_Web_CSharp/SdkTemplateTestsAot_Web_CSharp.csproj]
      SdkTemplateTestsAot_Web_CSharp -> /__w/1/vmr/artifacts/scenario-tests/artifacts/SdkTemplateTestsAot_Web_CSharp/bin/Release/net10.0/linux-x64/SdkTemplateTestsAot_Web_CSharp.dll
/__w/1/vmr/src/scenario-tests/.packages/microsoft.dotnet.ilcompiler/10.0.0-alpha.1.25071.14/build/Microsoft.NETCore.Native.Publish.targets(71,5): error : The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative [/__w/1/vmr/artifacts/scenario-tests/artifacts/SdkTemplateTestsAot_Web_CSharp/SdkTemplateTestsAot_Web_CSharp.csproj] [/__w/1/vmr/src/scenario-tests/src/Microsoft.DotNet.ScenarioTests.SdkTemplateTests/Microsoft.DotNet.ScenarioTests.SdkTemplateTests.csproj] [/__w/1/vmr/repo-projects/scenario-tests.proj]
##[error]src/scenario-tests/.packages/microsoft.dotnet.ilcompiler/10.0.0-alpha.1.25071.14/build/Microsoft.NETCore.Native.Publish.targets(71,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative [/__w/1/vmr/artifacts/scenario-tests/artifacts/SdkTemplateTestsAot_Web_CSharp/SdkTemplateTestsAot_Web_CSharp.csproj]

@sbomer are you the right person to ask for help here regarding the Microsoft.NETCore.Native.Publish.targets error? The source of the failing test is here: https://github.com/dotnet/scenario-tests/blob/7790d479e5f6bd16dc132257d49344b1c7c79c5f/src/Microsoft.DotNet.ScenarioTests.SdkTemplateTests/SdkTemplateTests.cs#L222-L231

@ViktorHofer
Copy link
Member Author

ViktorHofer commented Jan 23, 2025

Looks like the failure only affects the source-build test execution. @MichaelSimons / @mthalman can you please also take a look?

@mthalman
Copy link
Member

I'll take a look. I need to get a local repro. My initial guess is that it's a portable RID-related thing that is messing up expectations.

@mthalman mthalman self-requested a review January 23, 2025 16:12
@mthalman
Copy link
Member

mthalman commented Jan 23, 2025

Here's what I know so far:

The The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative error occurs when @(PrivateSdkAssemblies) is empty. It's empty because it wasn't able to find any SDK DLLs in the src/scenario-tests/.packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/10.0.0-alpha.1.25071.14/sdk path. That's because there's no sdk directory at all there. It's also missing the framework directory. This is the source built version of that package. The Microsoft-built version does have these directories. Prior to these PR changes, it was getting the Microsoft-built version of the package from the NuGet feed.

But taking a step back, I question whether this change is the correct thing to do in the context of source build. The intention of the scenario tests is to validate what the behavior would be for customers using the SDK. For a source built SDK used by customers, any NuGet packages that get pulled will be getting the Microsoft-built versions of those packages. So that's how we should be testing it.

cc @MichaelSimons

@jkoritzinsky
Copy link
Member

@mthalman is the failing project trying to AOT a tool for the portable RID during a non-portable source-build? It sounds like you're trying to use the "host-targeting" ILCompiler package to NativeAOT something for the portable RID (for which we don't have a runtime available as we've only built the required libraries for the SB rid).

@mthalman
Copy link
Member

Here's the original PR that adds the test: dotnet/scenario-tests#113. It's just creating a basic web project and attempting to publish it as an AOT app with the RID set to the non-portable RID that produced the source built SDK that's being used. Also including @tmds who created that test.

If you want to examine the binlog of the publish, you can get that here: publish--aot.zip

@tmds
Copy link
Member

tmds commented Jan 23, 2025

Here's the original PR that adds the test: dotnet/scenario-tests#113. It's just creating a basic web project and attempting to publish it as an AOT app with the RID set to the non-portable RID that produced the source built SDK that's being used. Also including @tmds who created that test.

The test is checking the bundled source-built ILCompiler by AOT publishing against the non-portable RID.
There shouldn't be any linux-x64 assets used for this.

@mthalman
Copy link
Member

There shouldn't be any linux-x64 assets used for this.

Except that ILCompiler is producing a portable package: runtime.linux-x64.Microsoft.DotNet.ILCompiler. I think this demonstrates the need for more validation in the test. It should do the same kind of package validation that is done for the self-contained test to verify it's not loading anything from an online feed. But that is source build-specific so that should be implemented in Microsoft.DotNet.SourceBuild.Tests, not the scenario tests repo.

@tmds
Copy link
Member

tmds commented Jan 23, 2025

@jkoritzinsky
Copy link
Member

There shouldn't be any linux-x64 assets used for this.

Except that ILCompiler is producing a portable package: runtime.linux-x64.Microsoft.DotNet.ILCompiler. I think this demonstrates the need for more validation in the test. It should do the same kind of package validation that is done for the self-contained test to verify it's not loading anything from an online feed. But that is source build-specific so that should be implemented in Microsoft.DotNet.SourceBuild.Tests, not the scenario tests repo.

We are producing a portable package because we need a package that can run on the host machine with the same RID as the host SDK's RID. This was part of unblocking usage of NativeAOT on a live build within the VMR. This package only contains the ilc binary and will not be shipped (it's marked as "Vertical" visibility).

Maybe we need to update how scenario-tests pulls down assets to exclude Vertical-visibility assets if it's supposed to be validating the assets we're shipping?

@ViktorHofer
Copy link
Member Author

I opened dotnet/source-build#4841 to track a resolution for this issue when building source-only. Meanwhile I conditioned the change to only apply to the non-source-only build to get other deliverables unblocked.

@ViktorHofer ViktorHofer enabled auto-merge (squash) January 23, 2025 22:36
@ViktorHofer ViktorHofer merged commit 9aec46c into main Jan 23, 2025
35 of 38 checks passed
@ViktorHofer ViktorHofer deleted the UseCorrectNuGetConfigForScenarioTests branch January 23, 2025 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants