Open tamlin-mike opened 5 years ago
I'm missing an option to disable creation of any and all tests.
Ability to build a single DLL.
You can run Restore.cmd
first so that VS can load the projects, then invoke Build
inside VS only on your interests. I'm not sure whether this works for a clean clone, but I've only runned Restore.cmd
but not Build.cmd
in several months.
tagging @jaredpar and @jasonmalinowski
@huoyaoyuan Yes, I have now realized it is possible to build a single project from within VS, but loading Roslyn in VS is... not exactly speedy, nice to the CPU fan, or the responsiveness of the computer as a whole. :-)
I had hoped it would be possible to specify perhaps .csproj-level from command-line. Maybe it is, and I simply haven't found out how to do it yet.
You can just do msbuild /m <project>
like any other .NET project and that'll build just that and dependencies.
Please, consider using filesystem links for immutable files, where available.
This can be done by setting the environment variable %ROSLYNUSEHARDLINKS%
to any value. That will enable all of the MSBuild options for using hard links when possible for files. This is not enabled by default for the following reasons:
At the same time though the option is there and available for anyone to use locally.
I'm missing an option to disable creation of any and all tests.
Can you be more specific here? Are you asking for the ability to avoid building a specific set of tests? If so why do you believe that would be valuable? Excluding certain tests from build wouldn't have a meaningful impact on build time. If you're interested in building only a specific exe then you can just build the projcet directly today and the tests won't come along with it.
I'm missing an option to disable creation of all the locale directories. To put it mildly, I am more than a little annoyed of all the thousands of locale directories VS itself spews all over the installation,
Can you be more specific here? VS install creates zero directories here. All of the directories created by the build are done so as this is the standard build layout that all repostitories in the .NET org use.
Ability to build a single DLL.
Can you be more specific here? What singel DLL are you trying to create? Any specific DLL in the project can be built by simply running msbuild
in that directory. If you're looking for a single package that represents the whole of the repository then that doesn't exist. This repository produces a number of components for a variety of products so there is no one overarching item that encompasses all of them.
Instead of being able to build just that DLL
Why areyou unable to build that DLL? If you run msbuild
on the project file for that DLL only that DLL and it's dependencies will be deleted.
It sounds like the root of many of your problems is you created a 10gig hard drive in order to build Roslyn. That is not going to be sufficient. Our build output is ~15Gig w/o hard links and our NuGet cache download is probably somewhere on the order of 1-5Gig (I haven't measured that in some time). A 25-30 Gig VM is probably the minimum that I would experiment with.
Many, many warnings about SourceLink "Source control information is not available".
Paging @tmat on that one. Are you able to run git remote -v
and share the output? When you do a build we embed URLs to GitHub in the build in the debugging information; this means that debugging can then fetch source files from GitHub. That needs to look at your remote URLs to know which GitHub repo it is; if you're using some of the "fancier" Git features it can sometimes break. (Or there's something else going on....)
You can just do
msbuild /m <project>
Oh! Here I thought Build.cmd -> eng/*.ps1 did some black magic stuff.
Maybe I was skimming the wiki too fast, or the information that it is possible to build individual parts (even from command-line) isn't presented (or linked to) in close enough proximity to the starting build instructions?
%ROSLYNUSEHARDLINKS%
Excellent.
Are you asking for the ability to avoid building a specific set of tests? If so why do you believe that would be valuable?
I was looking for a way to not build any tests at all really. To reduce useless build time and disk consumption.
The scenario I had, I knew exactly what needed to be done (to fix a VS-crashing bug), and I needed to build a single dll. It ultimately failed due to some strong naming issue when trying to ngen it, but had it worked the build would have generated tens of gigabytes of space holding effectively useless junk, and a lot of CPU wasted, for a single DLL just a hair over 1.5 MB.
That was before I realized you don't actually need to run Build.cmd
to "build world" so to speak.
VS install creates zero directories here.
I can see how that was confusing. I was referring to how VS installation drops all these locale directories in the many VS (and related) installation directories. I used that as an example for what I have previously experienced and consider wasteful and downright disrespectful waste of user resources. I didn't mean to imply VS dropped them into the roslyn build dir.
A 25-30 Gig VM is probably the minimum that I would experiment with.
It wasn't a VM, I was using a locally mapped VHD (to spare host volume from NTFS's insistence to generate fragmentation like it was in fashion).
Anyway, that's Good Info. Exactly the kind of conrete info I was hoping could be presented on the same page as the starting build instructions.
Are you able to run git remote -v
I used a two-stage repo. One bare clone of github roslyn, and then a working clone from that local bare. Perhaps that's an unanticipated scenario?
Thanks for the interest and feedback. I've learned a few new things about building roslyn today. I hope you in turn got some ideas about small but possibly important info that could be added to the early build instructions.
I used a two-stage repo. One bare clone of github roslyn, and then a working clone from that local bare.
Does the bare repo have a remote URL configured?
No remote URL. Only accessible locally via filesystem access.
Oh! Here I thought Build.cmd -> eng/*.ps1 did some black magic stuff.
restore.cmd
does some black magic stuff. Once that has completed subsequent calls to msbuild
should just work™
@jmarolf Restoring a single project should work as well. msbuild /restore foo.csproj
, not need to call restore.cmd
.
No remote URL. Only accessible locally via filesystem access.
I mean in the repo cloned from github.com/dotnet/roslyn. I assume you did
git clone http://github.com/dotnet/roslyn --bare
This adds a remote origin
that points to http://github.com/dotnet/roslyn
.
Yes, of course.
Bare "middle" repo:
[remote "origin"]
url = https://github.com/dotnet/roslyn.git
Working repo:
[remote "origin"]
url = LocalFilesystemPathWithDoubleBackslashes
Coming to think of it... could the backslashes be the unanticipated issue?
No, this scenario is currently unsupported, but as it happens I'm working on implementing it as we speak :) See https://github.com/dotnet/sourcelink/issues/418
Excellent, tmat. That information closes that concern.
As a first-time builder of any Roslyn code, I thought it could be interesting for you doing this on a daily basis to get some input from someone that tested it out for the first time.
Documentation:
The instructions for kicking off "your first build" is Good Stuff. Short and concise; Four short bullet points. Very good. Gold Star.
The "-help" switch to eng/build.ps1 should probably be mentioned on the build instructions page. I only found out about it (and other, including vital, options) by inspecting first the cmd files and then that ps-script itself.
Disk space requirements could be specified on the Building wiki page. Probably updated on a schedule (every month or so?) and last date measured added to the documentation. Both for no-argument (i.e. Debug) builds and Release builds. At least a ballpark figure would be nice to have. It would have saved me a ton of wasted time and effort. I created a ten GiB VHD and thought "This surely must be at least four times of what's required, but let's make it this extremely large to be really, really sure" - how wrong I was... but more on that later.
Flexibility/options:
I'm missing an option to disable creation of any and all tests.
I'm missing an option to disable creation of all the locale directories. To put it mildly, I am more than a little annoyed of all the thousands of locale directories VS itself spews all over the installation, laying waste to both precious disk space and adding filesystem fragmentation something fiercely. I had hoped I wouldn't have to see that repeated in the bin/* output, curtesy of a switch or two.
Please, consider using filesystem links for immutable files, where available. Even NTFS has had hardlinks since the 90's. It's not instilling confidence to see gigabyte after gigabyte of redundant copies of the same files in umpteen places. So far into the build process there are f.ex. fourty (40!) copies of Microsoft.CodeAnalysis.Test.Resources.Proprietary.dll, racking up almost 4 GiB. The build has stalled so I don't know how many more redundant copies will be created. That's just the most prominent one. I'm sure there are plenty more.
Ability to build a single DLL. If that's impossible due to limitations in <something>, at least building a single "package" of sorts. Maybe it's possible by going deeper than using Build.cmd? If so, some documentation pointing to the procedure from the short and sweet build instructions could be good.
In my case I knew exactly what I needed to get VS stop crashing. I needed to fix one single bug, and build a replacement for one single file, Microsoft.VisualStudio.LanguageServices.dll. Instead of being able to build just that DLL (from what I have found at least), I'm now continually fighting with disk-space running out, running
compact /c /f /s /exe:lzx artifacts\*
like a madman from a separate shell, while periodically Suspending all the build processes from the Resource Monitor, trying to keep up with the torrent of other stuff it's filling up the volume with - stuff I really don't want produced. Yeah, it's partially a problem with me not allocating enough disk space, but I couldn't in my wildest imagination think I'd need over ten gigabyte to build a single DLL that's just a hair over 1.5 MB. That points back to the need for some documented info of how much disk space should be expected to be consumed.git
is indeed available in the path. Granted, it's better thanroslyn-analyzers
, where the same yapping produces build errors instead (though that used a slightly different, but still likeroslyn
itself a beta version), but it's still not good, and is not adding confidence.Besides these issues, it seems the build system works pretty well. It could use some work to beat it into better shape, but overall it seems quite straightforward.
Thumbs up.
My 0.02.