Description
Hello,
I would like to bring to your attention my experience in trying to work on the libraries, in the hope that it could be valuable feedback.
Since the moved to the monorepo, contributing or simply building libraries like Microsoft.Extensions.* has become more challenging and time consuming due to the need to build the clr.
I understand the benefits for the core team to work with a monorepo and that probably the core devs use powerfull workstations or VMs, however I believe the dev loop is quite taxing and if we could improve it, it would make easier to contributors to join the project.
To get started building a library, it now requires to install more SDKs and tools and a bit of setup, however that part is well document and although it requires more disk space, it is a one-off operation.
The troubles start when you actually want to run the build.
The recommended way to build to be able to work on the libraries is:
git clean -xfd
.\build.cmd -subset clr+libs -runtimeConfiguration Release
This command on a well specced current gen laptop would take over 10 mins. During this time the laptop would be totally unresponsive (not even able to type) and it will overheat (so not be able to type on it for a while once completed)
Once you managed to build it, you can use a helper to open the solution in Visual Studio
./build.cmd -vs SolutionName
however, if you do this as first thing, as recommended in the guide, if will generally fail to build
You could build from the command line, however the steps described in the guide do not specify that you have to modify your enviroments variables to use the local setup of the dotnet sdks. To do that I use:
$env:DOTNET_INSTALL_DIR = "$pwd\.dotnet"
$env:DOTNET_MULTILEVEL_LOOKUP = 0
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
$env:Path = $env:DOTNET_INSTALL_DIR + ";" + $env:Path
it would be nice to have a helper in place like the activate script in the AspNetCore repo.
If you forget to set the environment variables the build will fail.
You also need to kill every dotnet.exe
process with taskkill /IM dotnet.exe /F
after changing the environment or it will not build correctly.
The most problematic thing is that if you build in Visual Studio too early or with a wrong dotnet SDK version, you build will break irreparably and the only solution I found to recover it is to do a git cleanand full build .
On top of that, there are sometimes commit not properly building, so you generally end up having to git clean and then build 2-3 times, assuming you did something wrong, then trying to move a few commits back and repeat until I get a working version.
This means every time you rebase a branch, even if you are one day behind, you would easily spend an our just to have a working build of the library again.
I think it worth discussing what could be done to improve the dev loop for libraries contributors.
Ideally, it would be nice to get a lightweight build that get a prebuilt CLR from CI and maybe even prebuilt shared libraries, to get to the same experience it was before the monorepo move.
Maybe I'm just really unlucky or the documentation is out of date and there are already tricks to simplify the process.
I'm happy to test all your suggestion and contribute to the docs if that is the case.
Thank you for your time,
Alessio
Metadata
Metadata
Assignees
Type
Projects
Status