-
Notifications
You must be signed in to change notification settings - Fork 389
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
Migrates to RepoToolset infrastructure #2606
Conversation
21b4dbd
to
c8cb4e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't check this in until I've played with this.
Can you give me a quick summary on what's going on with this change? It looks like you've moved a bunch of cheese, such as removed build.cmd and replaced with Roslyn's version which I dislike. |
Things I'm not a fan of:
|
What's the benefit of having fewer files in the root? I find much more useful to have common verbs (such as "test", "restore", "build"): having them there makes it obvious how to do these common tasks in the repo. That's especially beneficial for people not familiar with the repo and for folks who work with multiple repos, who don't need to relearn different command line arguments to various build scripts.
If you want to build and test you can run
I'm not sure i understand.
and Jenkins PR runs
and Jenkins VSI runs:
With this change both Microbuild and Jenkins PR runs use
Correct, I moved projects to subfolders of |
@jmarolf Ready for local testing. Try it out please. |
@tmat cool thanks. @dotnet/project-system I would also encourage everyone to sync this branch and see if anything feels out of the ordinary. |
btw, probably good idea to |
Note that you'll need to run |
Why do you need to run restore.cmd before opening projectsystem.sln? We've never needed that. Why do we even need Restore.cmd - before it was implicit. Same with tests. |
@davkean Because the common .targets and .props files are now in a nuget package (RepoToolset package). Dotnet SDK doesn't support custom SDKs yet. Once it does an explicit Restore step won't be needed. |
@tmat I'd prefer a model where we don't need to do that, as this is going to introduce a lot of friction that is not going to match the benefit we get from this. Can we please instead have a source drop model? Or figure out a way where we can put these in packages and have them restored correctly?
You're going to have to update it every time we take a new toolset, yes? |
@davkean I'll look into it, perhaps I can figure out something not too complex. A source drop might work. Having to restore doesn't seem to be much of friction for Roslyn though. |
That's because they need to run Restore.cmd anyway, we've never needed an explicit restore step - either build.cmd did it, or VS auto restore kicked in. This entire repro's design for build/test/open/F5 was based on my experience with Roslyn and how horrible that was. I just went back last week and it's still not very good. I do not want to regress my day to day for consistency with Roslyn. |
I think we need to remember that Roslyn is a huge repro. Based on that, having commands that cut down how long things take/run and to only run for areas your team owns makes sense. Project System is tiny in comparison, I'd prefer to restore, build, run all unit tests in single step for all this repro. I spent a non-trivial amount of time on build.cmd to get it to a point that I was happy with it, I do not feel that your replacement, if based on Roslyn, is on par with it. |
I think that, although project-system had some niceties, overall its infrastructure has been much poorer and was not setup to continue working as the repository grew. That is, the infrastructure we had was hacked out from Roslyn and made to be more expedient for a small repository. This also means that are infrastructure has been a decaying snapshot of the Roslyn infrastructure state at the time we cloned it. We still have workarounds/hacks that were only relevant back in VS2015 and pre-Willow and have gotten next to none of the improvements made (batch signing, microbuild validation, build/perf/determinism correctness validation, etc). The repo-toolset is not doing exactly what Roslyn is doing either, it is more of a cleaned-up and generalized version of its infrastructure and, while not perfect, there has been a lot of time put in making sure that it is useable for both small and big repositories and that it will continue working as a small repository grows. It is designed to make all of our repositories consistent, useable, and easily upgradeable when new infrastructure improvements come around and should be useable by Roslyn as well in the long run. Overall, consistency across our repositories, IMO, is much more important than making some tasks easier to do on a small repository by default. A public contributor, a long-time dev, or a new hire should be able to come into any That being said, if we determine that there are some developer flows that are desired (such as building and testing in one go), then it should be possible to add an explicit switch. If that still isn't sufficient, dev's can add an alias on their local box to suit their needs (I have several setup to expedite various tasks and being able to share those aliases across repositories is also useful). There will be initial quirks and things we find that could be improved (such as not having to explicitly restore first, which is a regression), but we should work towards them by improving this common/core infrastructure and by providing a way to do this in our own tools/sdks if we find that it can't be achieved at present. |
@tmat Does the repotoolset have the ability to publish to myget? I was looking at the Analyzer repo and I dont see the myget publishing setup either in build process or in the microbuild process. I could not find it in this change as well |
It doesn't sound like anyone's arguing against consistency between the repos in terms of infrastructure. That seems to be pretty clearly a win. The biggest point of disagreement seems to be about splitting build into restore/build/test. Given that those are files that are actually checked in to our repo, there isn't any issue with that about sharing infrastructure with other repos. It's purely about how we manage things in our repo. Since all the operations are pretty lightweight, I would also tend towards keeping a single command that does everything. I think the LUT repo does the same thing, then they have switches like "/skipRestore" and "/skipTest" to skip things you might not want. If you want to have the separate commands, you can create aliases pretty easily. |
I wrote the LUT infrastructure and similarly did so in order to help make it better for a smaller repo 😄. Both the opt-out model that LUT uses and the opt-in model that the repo-toolset uses are good, because it allows you to modularize the build. The biggest difference being whether it is better for a small repo (opt-out, since the entire process is cheap) or better for a large repo (opt-in, since each stage can be very expensive). However, realistically, the opt-out model is only limited by how expensive we make each step (if we can determine the build step isn't needed and can quickly skip it, opt-out becomes reasonable for large repos as well). |
@basoundr Yes, myget publishing is done by a microbuild task. Usually, each repo publishes into a separate feed. E.g. analyzers are now published here: https://dotnet.myget.org/Gallery/roslyn-analyzers |
To be clear, this PR has a command that does it all: As @tannergooding pointed out you can easily come up with shortcuts that suite your style. If you take a look at what the .cmd files are doing you'll see it's very easy to put together any combination of builds steps you prefer. For example,
Build.cmd:
Note also you can pass the switches on command line. So to restore, build, deploy VSIXes and test you can type:
If you want to pack as well then:
If you want to set msbuild property you can do that too:
Arguments that don't match powershell parameters are passed thru to msbuild. |
925f367
to
ca0dda7
Compare
9e5863e
to
11281a8
Compare
…o that binding redirects are applied
…me as another method declared on class
Migrates the repo to RepoToolset infrastructure. See https://github.com/dotnet/roslyn-tools/blob/master/docs/RepoToolset.md for overview of the toolset.
Recommended review strategy - please review each commit separately, I tried to partition the change into commits to allow for reasonable diffing.
Project System specifics
Layers
The project system is effectively partitioned into layers "HostAgnostic", "VisualStudio" and "VisualStudioDesigner". Previously various traits of the projects were set based on the value of "layer" property set by each project. With this change the different aspects of these layers are captured in
Directory.Build.props
andDirectory.Build.targets
in the above subfolders, which makes it easier to see what project belongs to which layer and what properties are applied to it.XAML rules and Design Time Targets
The .xaml files as well as their translated versions are copied to
artifacts\{configuration}\VSSetup\Rules
directory.Design Time targets files were moved under
Microsoft.VisualStudio.ProjectSystem.Managed
project and are copied along XAML rules toartifacts\{configuration}\VSSetup\Rules
directory, where they are picked up byMicrosoft.VisualStudio.ProjectSystem.Managed.CommonFiles
VS insertion component project.Integration tests
Integration tests are run by
VSIBuild.cmd
. This command downloads Roslyn VSIXes during restore build phase, if not downloaded yet, and deploys them to the ProjectSystem hive. It then builds ProjectSystem.sln and runs xunit on build outputs of all projects whose name ends with.IntegrationTests
.The integration test base abstract class was updated to set environment variables that are read by VS to determine the location of the design targets files.
Willow setup components
Project system builds 2 Willow components from .swr files that are not just wrapping VSIXes: Microsoft.VisualStudio.NetCore.ProjectTemplates.1.x and Microsoft.VisualStudio.ProjectSystem.Managed.CommonFiles. The projects that generate the Willow packages are in
setup
directory in repo root.Localization
Most of the files changed (deleted) by this PR are translated resource files and xlf files. Translated resource files are no longer needed in the repo. They are generated by xliff build task from xlf files during build.