Don't overbuild source generator when root building for net48#105347
Don't overbuild source generator when root building for net48#105347ViktorHofer merged 1 commit intomainfrom
Conversation
|
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries |
| <PropertyGroup Condition="'$(BuildTargetFramework)' != '' and '$(BuildTargetFramework)' == '$(NetFrameworkCurrent)'"> | ||
| <TargetFramework>$(BuildTargetFramework)</TargetFramework> | ||
| <!-- Filter ProjectReferences to build the best matching target framework only. --> | ||
| <FilterTraversalProjectReferences>true</FilterTraversalProjectReferences> |
There was a problem hiding this comment.
Won't this still overbuild in the case that a generator doesn't multi-target? What was causing the overbuild to happen? I would have expected any duplicates to hit the MSBuild project cache - were global properties different?
There was a problem hiding this comment.
Different global properties, yes. More precisely, the BuildTargetFramework property set.
This solution works for both multi targeting and non multi-targeting builds and is just following what we already do in the other oob-*.projs. I simpy forgot to add that part.
See https://github.com/dotnet/runtime/blob/main/eng%2FTraversalSdk.AfterTargets.targets
|
/ba-g CI pipeline is stuck (GH thinks it still runs but it already canceled on AzDO side) |
|
@ericstj I'm going ahead merging this as the failure is observable in CI already. I'm happy to react to any feedback in a follow-up. |
|
I see - I am better understanding this change now. Before I was worried we'd force a build with the TargetFramework value of BuildTargetFramework, but I see that instead you're evaluating the child projects for that framework. I wonder if this should actually be the default for all Traversal projects when BuildTargetFramework is set. |
Fixes #105364
Just noticed that source generators are now built twice. Regressed with e2a3511
Adding this blurb as in oob-all, oob-ref and oob-src.proj fixes that.