Skip to content

Conversation

@DmitriyShepelev
Copy link
Contributor

@DmitriyShepelev DmitriyShepelev commented Oct 28, 2022

Fixes #8056

Context

GraphRoots won't contain referenced projects (even if they're entry points), so use EntryPointNodes when obtaining the entry point nodes in GetTargetLists. This will result in Build being added to the referenced project's target list, which will in the case of #8056 result in Pack being called.

Changes Made

GetTargetLists now uses EntryPointNodes in lieu of GraphRoots in obtaining the entry point nodes.

Testing

Verified that a referenced entry project has the default target in its target list.

Notes

EntryPointNodes was initially used (see a1ac094) but was later changed to GraphRoots here.

@rainersigwald Do you have any insight as to why this change was made? You made this comment about non-graph-root outer build -- it seems relevant to the change made, so I was wondering if you could elaborate on it.

@Forgind
Copy link
Contributor

Forgind commented Oct 28, 2022

cc: @dfederm

@rainersigwald
Copy link
Member

I think my questions then were here (#4218 (comment)), with replies.

Basically, in a non-graph build of Foo.csproj -> Multitargeted.csproj, the outer build's Build target in Multitargeted.csproj will not run; only the selected inner build will run.

But if you have a solution that points to both, the outer build will run. Passing two projects as entry points in a graph is analogous to that, I think.

So I think the commit you linked switching from EntryPointNodes to GraphRoots is incorrect.

@Forgind Forgind added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label Nov 2, 2022
@rokonec rokonec merged commit b022904 into dotnet:main Nov 4, 2022
@DmitriyShepelev DmitriyShepelev deleted the UseActualEntryPoints branch November 4, 2022 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Graph builds don't handle GeneratePackageOnBuild when the project multitargets and is referenced

5 participants