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

Item to define custom non-ProjectReference edge in graph #6852

Open
rainersigwald opened this issue Sep 15, 2021 · 8 comments
Open

Item to define custom non-ProjectReference edge in graph #6852

rainersigwald opened this issue Sep 15, 2021 · 8 comments
Labels
Area: Static Graph Issues with -graph, -isolate, and the related APIs. triaged

Comments

@rainersigwald
Copy link
Member

Several build processes (repos, SDKs, and NuGet packages) have a pattern where they want to do a thing "once per build"--maybe set up versioning, or run some code generator, or something.

Ideally it would be easy to express this in a -graph -isolate compatible way by creating an item something like

<MSBuildGraphEdge Include="my/weird/project.proj"
                  Targets="This;List;Overrides"
                  Properties="Foo=Bar;" />

This would be a totally new edge, ignoring target propagation.

@cdmihai
Copy link
Contributor

cdmihai commented Sep 16, 2021

This would probably also be the solution to making the notorious nuget pack work with static graph builds: #6197

@AArnott
Copy link
Contributor

AArnott commented Jul 30, 2022

Friendly ping on this, @rainersigwald. We have a VS UI manifesting bug that I'm guessing might not be fixed, so it would be great if we could solve this graph edge problem without creating a ProjectReference item.

@AArnott
Copy link
Contributor

AArnott commented Oct 19, 2022

I've had at least 10 bugs in Nerdbank.GitVersioning reported because of NB.GV trying to be a good citizen by declaring a ProjectReference item for its self-invocation via an msbuild task. Without this ProjectReference item, -graph -isolate fails for Nerdbank.GitVersioning projects. But with this item, at least 10 project types fail to build because they indiscriminately execute their ProjectReference items with assumptions about how they should behave, targets they implement, or files that would be in one of their directories.
I'm about to just remove the ProjectReference item and break -graph -isolate scenarios given how much trouble it's caused for customers. Can you give me an alternative?

@rainersigwald
Copy link
Member Author

I would break -graph -isolate without hesitation in your scenario; do you have any customers that you're aware of that use it?

@AArnott
Copy link
Contributor

AArnott commented Oct 19, 2022

No customers for that, no. I just anticipated them and wanted to be future proof.

@filipnavara
Copy link
Member

FWIW I wanted to be one of those customers but I never got far enough to get there. Nerdbank.GitVersioning was one of the obstacles.

@AArnott
Copy link
Contributor

AArnott commented Oct 20, 2022

There is an msbuild property for graph-based builds, I think. Is there for isolated graph builds as well? If so, maybe NB.GV could add a condition on the ProjectReference item so it only exists for (isolated) graph based builds. That way folks like @filipnavara remain unblocked but it stays out of the way for a majority of customers.

@AArnott
Copy link
Contributor

AArnott commented Oct 22, 2022

The 3.6 update of NB.GV will remove the ProjectReference item except when IsGraphBuild=true.
dotnet/Nerdbank.GitVersioning#847

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Static Graph Issues with -graph, -isolate, and the related APIs. triaged
Projects
None yet
Development

No branches or pull requests

5 participants