-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Experiment with enabling msbuild static graph build #41975
Comments
Tagging subscribers to this area: @ViktorHofer |
The installer layer is likely not compatible with static graph builds today. We'll have to do some work to provide the right information to MSBuild to support static graph. |
Agreed. We already disable static graph for some of the installer projects during restore: Lines 40 to 45 in 171ef84
@jkoritzinsky you mentioned that this will change with your new SDK? |
So static graph restore will work with the new SDK, but I don't know if a full static graph build will. I'll need to figure out based on the static graph protocol how to represent the various |
That makes sense. We will likely hit similar problems during the libraries builds as we call into msbuild in couple places as well (in example in the TargetFramework.SDK that lives in Arcade). |
There are two levels of static graph:
So hopefully the installer stuff will work in |
Thanks for the clarification @rainersigwald but doesn't that mean that the SDK itself won't work with |
Can u elaborate on what this means? Or maybe provide some examples of what would not meet this requirement? Feel like I've asked this before, wonder if we should start a doc on static graph (cookbook style) that discusses what is / isn't legal here. |
I agree with Jared that further details on what is allowed and what is prohibited in the two modes would help us. Sounds like we should be able to enable |
@ViktorHofer @jaredpar can I impose on you to check out https://github.com/dotnet/msbuild/pull/5741/files?short_path=570cf46#diff-570cf46aec4396d3da8763436f48defb? Feedback welcome!
We should account for all of the standard SDK and common.targets referencing "for free". Things should only fail to work for customizations on top of that. 📝 There are a lot of "should"s in that sentence. We have some known problems, for example with NuGet and especially pack operations. That's why we're not evangelizing this hard. Please let us know how it works for you! |
I just tried a graph build for libraries in dotnet/runtime and I see a few issues:
Aside from that I'm now a fan of graph build as I don't see any incremental build issues (refpack vs p2ps) with it enabled anymore as all dependencies are determined and built up-front. EDIT: WOW, incremental builds are now super fast. |
gentle ping @rainersigwald regarding my questions 1 and 2 above. |
There's no switch like that at the moment. Can you add a parameter to the scripts you use to invoke build? dotnet/msbuild#5324 may also be related.
That's funky. Can you share some repro steps? I don't see this with a small repro attempt.
That's probably the problem. Is the filtering expressible at evaluation time? What specifically is being filtered here--TFs of references, or actual projects? |
We and our customers invoke individual libraries with
Will do.
It's actually filtering projects... How do transitive project references work with static graph? As far as I know, those aren't discovered before the |
Can you use a |
didn't know of that. will give it a try. |
I misspoke, TFs are filtered, not projects. |
The
--graph
/--graphBuild
msbuild CLI option enables the static graph build feature. From discussion with @rainersigwald:We should see if enabling this feature reduces our build times and even if not, a predictable static graph is preferred over a just-in-time hard to reason about graph so it might be a good option anyway.
@jaredpar this would be a pre-cursor for using CloudBuild in CI.
cc @dotnet/runtime-infrastructure
The text was updated successfully, but these errors were encountered: