Skip to content

[main] Source code updates from dotnet/sdk#1382

Merged
ViktorHofer merged 16 commits intomainfrom
darc-main-e08a12a6-0180-43a1-bbd2-1a9b4331b8b5
Jul 5, 2025
Merged

[main] Source code updates from dotnet/sdk#1382
ViktorHofer merged 16 commits intomainfrom
darc-main-e08a12a6-0180-43a1-bbd2-1a9b4331b8b5

Conversation

@dotnet-maestro
Copy link
Copy Markdown
Contributor

@dotnet-maestro dotnet-maestro Bot commented Jul 2, 2025

Note

This is a codeflow update. It may contain both source code changes from the source repo as well as dependency updates. Learn more here.

This pull request brings the following source code changes

From https://github.com/dotnet/sdk

@dotnet-maestro
Copy link
Copy Markdown
Contributor Author

dotnet-maestro Bot commented Jul 2, 2025

Important

There are conflicts with the main branch in this PR. Apart from conflicts in the source files, this means there are unresolved conflicts in the codeflow metadata file src/source-manifest.json.
When resolving these, please use the (incoming/ours) version from the PR branch. The correct content should be this:

{
  "barId": 273816,
  "path": "sdk",
  "remoteUri": "https://github.com/dotnet/sdk",
  "commitSha": "45ecd67a573ab33cf3926a6dd02507c72077280a"
}

In case of unclarities, consult the FAQ or tag @dotnet/product-construction for assistance.

@ViktorHofer ViktorHofer enabled auto-merge (squash) July 2, 2025 13:48
@dotnet-maestro
Copy link
Copy Markdown
Contributor Author

dotnet-maestro Bot commented Jul 2, 2025

There was a conflict in the PR branch when flowing source from https://github.com/nuget/nuget.client/tree/eb38c4a6cccfce5ee9415da1a930fc6534194b2b
Files conflicting with the head branch:

Updates from this subscription will be blocked until the conflict is resolved, or the PR is merged

@dotnet-maestro
Copy link
Copy Markdown
Contributor Author

dotnet-maestro Bot commented Jul 2, 2025

There was a conflict in the PR branch when flowing source from https://github.com/nuget/nuget.client/tree/eb38c4a6cccfce5ee9415da1a930fc6534194b2b
Files conflicting with the head branch:

Updates from this subscription will be blocked until the conflict is resolved, or the PR is merged

@ViktorHofer
Copy link
Copy Markdown
Member

ViktorHofer commented Jul 2, 2025

/__w/1/s/eng/finish-source-only.proj(134,5): error : 2 new packages used not in baseline! See report at /__w/1/s/artifacts/log/Release/baseline-comparison.xml for more information. Package IDs are:
/__w/1/s/eng/finish-source-only.proj(134,5): error : Microsoft.AspNetCore.App.Ref.6.0.36
/__w/1/s/eng/finish-source-only.proj(134,5): error : Microsoft.NETCore.App.Ref.6.0.36

The source-build failure is due to dotnet/sdk#49543. @dotnet/source-build & @tmat PTAL asap. Partners teams are waiting for a new SDK with these dotnet/sdk updates.

Any reason why that project TFM needs to be built when building from source?

@tmat
Copy link
Copy Markdown
Member

tmat commented Jul 2, 2025

This is something source build needs to fix. We need to build this code against net6.0 and @mmitche said it is ok to retarget.
dotnet-watch is part of SDK and has to be source-buildable. You can use net10 SDK to run net6.0+ apps with dotnet-watch. Hence we need to target net6.0

@MichaelSimons
Copy link
Copy Markdown
Member

Source build only supports the X.0.0 versions of the previous targeting packs. By default the SDK looks for the most recent servicing version. Can TargetingPackVersion be set to 6.0.0 for this scenario?

@tmat
Copy link
Copy Markdown
Member

tmat commented Jul 2, 2025

What does TargetingPackVersion do?

@tmat
Copy link
Copy Markdown
Member

tmat commented Jul 2, 2025

Btw, if this is urgent to fix we can temporarily revert dotnet/sdk#49543.

@MichaelSimons
Copy link
Copy Markdown
Member

What does TargetingPackVersion do?

It indicates what targeting pack version to use for the current tfm. The SDK had this embedded to look for the most recent version - right now it is 6.0.36. SB only provides 6.0.0. This is why the 6.0.36 targeting packs are being used and is the source of the reported prebuilts.

@tmat
Copy link
Copy Markdown
Member

tmat commented Jul 2, 2025

I see, so if we set TargetingPackVersion to 6.0.0 for the net60 target, it should work?

@MichaelSimons
Copy link
Copy Markdown
Member

Yes I believe so. Not sure if @ViktorHofer or @mmitche have a better more elegant solution.

@tmat
Copy link
Copy Markdown
Member

tmat commented Jul 2, 2025

dotnet/sdk#49637

@ViktorHofer
Copy link
Copy Markdown
Member

Can you please make the change directly in this PR for validation.

@tmat
Copy link
Copy Markdown
Member

tmat commented Jul 2, 2025

Sure.

@dotnet-maestro
Copy link
Copy Markdown
Contributor Author

dotnet-maestro Bot commented Jul 2, 2025

There was a conflict in the PR branch when flowing source from https://github.com/nuget/nuget.client/tree/eb38c4a6cccfce5ee9415da1a930fc6534194b2b
Files conflicting with the head branch:

Updates from this subscription will be blocked until the conflict is resolved, or the PR is merged

@ViktorHofer
Copy link
Copy Markdown
Member

That doesn't seem to work.

@joperezr
Copy link
Copy Markdown
Member

joperezr commented Jul 2, 2025

Not sure if relevant, but note that in this payload of the sdk we finally removed the aspire workload from the sdk, meaning there is no longer a need for the VMR to build the aspire repo at all. @ViktorHofer let me know if there is any help needed for removing aspire from the VMR.

@ViktorHofer
Copy link
Copy Markdown
Member

ViktorHofer commented Jul 3, 2025

Not sure if relevant, but note that in this payload of the sdk we finally removed the aspire workload from the sdk, meaning there is no longer a need for the VMR to build the aspire repo at all. @ViktorHofer let me know if there is any help needed for removing aspire from the VMR.

Yes we talked about this offline. After this PR is merged we will submit another one that removes aspire from the VMR. No help needed for that. Thanks for removing Aspire from the .NET SDK.

This is something source build needs to fix. We need to build this code against net6.0 and @mmitche said it is ok to retarget.
dotnet-watch is part of SDK and has to be source-buildable. You can use net10 SDK to run net6.0+ apps with dotnet-watch. Hence we need to target net6.0

@tmat @MichaelSimons I'm not positive on that. .NET 6 reached end of life 8 months ago. I don't think that the product should target out-of-support TFMs (especially not in main). We discussed that in Tactics multiple times and agreed on avoiding that. One goal of source-build is to target latest. Even if that's not always possible, we shouldn't go lower than the minimum in-support version which is .NET 8 (net8.0).

We have a similar requirement in another tool in dotnet/sdk: https://github.com/dotnet/sdk/blob/1e96b3ec2f52d396d50001af1b3616efa81ca204/src/BuiltInTools/BrowserRefresh/Microsoft.AspNetCore.Watch.BrowserRefresh.csproj#L19-L23. That uses net8.0 as the minimum TFM.

@MichaelSimons
Copy link
Copy Markdown
Member

@tmat @MichaelSimons I'm not positive on that. .NET 6 reached end of life 8 months ago. I don't think that the product should target out-of-support TFMs (especially not in main). We discussed that in Tactics multiple times and agreed on avoiding that. One goal of source-build is to target latest. Even if that's not always possible, we shouldn't go lower than the minimum in-support version which is .NET 8 (net8.0).

That make sense, but a goal is to keep MSFT and SB build differences to a minimum.

@ViktorHofer ViktorHofer disabled auto-merge July 3, 2025 13:57
@ViktorHofer
Copy link
Copy Markdown
Member

ViktorHofer commented Jul 3, 2025

/__w/1/s/src/scenario-tests/artifacts/obj/generatedtests/SdkTemplateTestsAot_Web_CSharp/SdkTemplateTestsAot_Web_CSharp.csproj : error NU1101: Unable to find package Microsoft.NETCore.App.Runtime.NativeAOT.centos.10-x64. No packages exist with this id in source(s): /__w/1/s/artifacts/obj/extracted-dotnet-sdk/library-packs, dotnet-eng, dotnet-libraries, dotnet-public, dotnet-tools, dotnet10 [/__w/1/s/src/scenario-tests/src/Microsoft.DotNet.ScenarioTests.SdkTemplateTests/Microsoft.DotNet.ScenarioTests.SdkTemplateTests.csproj] [/__w/1/s/repo-projects/scenario-tests.proj]

@jkoritzinsky - ok another sync issue. The change got dropped for whatever reason...

@ViktorHofer ViktorHofer enabled auto-merge (squash) July 3, 2025 20:48
@dotnet-maestro
Copy link
Copy Markdown
Contributor Author

dotnet-maestro Bot commented Jul 4, 2025

There was a conflict in the PR branch when flowing source from https://github.com/nuget/nuget.client/tree/dd5a0230dafb3f56845efa3670eb441641df9341
Files conflicting with the head branch:

Updates from this subscription will be blocked until the conflict is resolved, or the PR is merged

@ViktorHofer
Copy link
Copy Markdown
Member

@dotnet/dotnet-cli / @baronfel please take a look at the sdk failure

@baronfel
Copy link
Copy Markdown
Member

baronfel commented Jul 4, 2025

Having a hard time getting a build going, but my suspicion is that we have accidental double-addition of the Info option due to repeated calls to WorkloadCommandParser.GetCommand. We should move the info and version option registration in that method down into the ConstructCommand method like all of the rest of the command initialization to prevent double-addition, since GetCommand is called on several code paths in the SDK.

@ViktorHofer
Copy link
Copy Markdown
Member

Uuuh now we have

    [FAIL] Microsoft.DotNet.ScenarioTests.SdkTemplateTests.SdkTemplateTests.VerifyWinformsTemplate(language: VB)
    System.InvalidOperationException : Failed to execute D:\a\_work\1\s\artifacts\obj\extracted-dotnet-sdk\dotnet.exe new globaljson --sdk-version 10.0.100-ci
    Exit code: 1
    
    System.TypeInitializationException: The type initializer for 'Microsoft.DotNet.Cli.Parser' threw an exception.
     ---> System.TypeInitializationException: The type initializer for 'Microsoft.DotNet.Cli.Commands.Workload.WorkloadCommandParser' threw an exception.
     ---> System.NullReferenceException: Object reference not set to an instance of an object.
 

ViktorHofer and others added 2 commits July 5, 2025 09:28
Cannot use the info/version options as part of Command construction if we're calling that before they are initialized.
@ViktorHofer ViktorHofer merged commit 1b0c85e into main Jul 5, 2025
10 checks passed
@ViktorHofer ViktorHofer deleted the darc-main-e08a12a6-0180-43a1-bbd2-1a9b4331b8b5 branch July 5, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants