Design a unified target graph for projects and solutions - #31
Conversation
Design and Target Graph not final — WIP
4acb747 to
3e0c041
Compare
e949db8 to
bfc790a
Compare
bfc790a to
9b983cd
Compare
9b983cd to
d1fe095
Compare
|
This is pretty neat, but I think it's less clear what the unified target graph means across various SDKs. I always thought the Maven way of thinking about this was a lot cleaner and better followed the principles of dependency inversion by declaring an interface in the form of a goal that the plug-in targets had to achieve. I think that also aligns closely with what the original "The Build Master" textbook on MSBuild advocated for. If you think broadly about "what do we really want that other ecosystems have" and "what we have today (via binlog replays)" you can see that the main gap is still in traceability of inputs, mostly around goal-directed values passed into black boxes for these targets vs the targets themselves. There's no way to "observe" what the black box does in generating outputs/task items. |
May be I should come up with better naming. That said, with the current MSBuild target graph, although extensible, they are not what I call a concept based or more accurately—action based graph. What I mean is, if you take a This is just one example of an action based target graph design, I'm experimenting with. Likewise, you'd have a similar pattern of thought for other concepts that exist in the Build System (
I personally don't like certain things about Maven, first is Java but that's subjective 😅. Then again, I have to say, when I was working on some java projects, Maven felt a lot cleaner, even though it was verbose, it had defined the language better. Once you know the language, the concepts, you can easily understand a
TRUE THAT. As you said
|
d1fe095 to
eeede52
Compare
eeede52 to
7c2adaf
Compare
7c2adaf to
e355a07
Compare
@chethusk Related to our conversation on IncrementalClean behavior and where I feel MSBuild currently falls short in comparison to Google Bazel build process. I had forgotten @Nirmal4G and I discussed this 4 years ago, until I saw he recently began iterating on this idea again. |
|
To be clear, I do have a private repo where I have fleshed out the design fully, and it's already in use in the production builds of our projects and solutions. But the private versions of these SDKs were hacked hastily in response to the 20 years of baggage in .NET! I'm reviewing the changes commit by commit and extracting only the changes and designs that make sense in the long run. Recently I tried doing it with Copilot and other agents but damn they are so bad with deterministic changes and new ideas. I just wasted 2 months and $120 worth of token costs. Coming to the Incremental Build/Clean with MSBuild, it has learned some optimizations, but it has a long way to go. The reason is well..., is because of the 20 years of baggage.
|
|
Set-up a sponsorship and I am happy to contribute to help reimburse some of those costs. I'd love for this to get to a state where @baronfel could consider it as a MSBuild vNext. |
Awhile ago Nick Craver (of StackOverflow.com fame) had proposed an alternative format for project files. StackOverflow.Redis uses the Microsoft.Build.Traversal SDK, but the problem historically is that Visual Studio could not read this format. Microsoft.Build.Traversal is more elegant than slnf (Solution Filters) as well. |
|
Here is an example of how Nick does excludes which would fully handle solution filters: https://github.com/NickCraver/StackExchange.Exceptional/blob/main/Build.csproj |
Thank you. It means so much. M$FT is notorious for its stance on backwards compat. I don't think they'll overhaul the entire MSBuild ecosystem just for structural and cosmetic improvements. Although broken and hard to learn, what we have now works. Also, I'm learning and experimenting here. So, right now, I do not want to waste anyone's hard earned money on this without giving them a value for their support. But to see that someone on the internet is willing to sponsor a project that's not even started, incomplete and downright does not build on their system is in itself an achievement that no other project had the honor of, I think, as far as I know. Once again, Thanks so much. |
Yeah, I knew about that. My schema also took some inspiration from those as well. Visual Studio is not even a M$FT product, originally. It was originally envisioned as a universal IDE for all workloads like Music/Film DAWs, including code. There is still some proprietary software that still uses Visual Studio v1 Solution and Project files. I took some inspiration from those as well. There's also controversial yet famous Visual Studio user-voice request that suggested to unify Solution, Project and Common build files concepts into serialized POCO that could be supported by any data format. They even suggested XAML as the declarative build language. I was inspired by that idea. I want to see how far I can take this.
The |
Goals
Targets List:
RestoreBuildCleanRebuild(wrapper aroundClean + Build)TestRunPublishNOTE: Design of the Target Graph is not final!