Repository navigation
Description
PR #31701 is changing the developer workflow for CoreCLR to help increase reliability, reduce local build times, and move us closer to a place where we can better parallelize CI to improve build times.
The largest part of the change is that the build.cmd and build.sh scripts under src/coreclr will be deprecated and later (probably in a few weeks) removed. The src/coreclr/src/build.proj file will also become unused and will be deleted. To build the coreclr product, the supported path will be to build from the root build script.
For those who strongly dislike building with MSBuild, the native runtime build will still be buildable with new build-runtime.cmd and build-runtime.sh scripts in src/coreclr that only build the native runtime build and the cross-arch native build. There will also be separate scripts available for running crossgen on System.Private.CoreLib. All managed builds will be driven exclusively through the Arcade scripting.
The way to control what parts of the CoreCLR build you run will be via the "subsets" infrastructure. See #31701 for specific subset names.
Below are some examples of commands for common workflows:
- Build CoreCLR runtime, System.Private.CoreLib, crossgen System.Private.CoreLib all in Debug. Build all of Libraries in Release. (Common workflow when syncing)
./build -subsetcategory coreclr-libraries -subset runtime-corelib-nativecorelib-all -c Release -runtimeconfiguration Debug
- Build CoreCLR runtime
./build -subsetcategory coreclr -subset runtime
- Build CoreCLR runtime (build-runtime version)
src/coreclr/build-runtime
- Build CoreCLR runtime and Crossgen2
./build -subsetcategory coreclr -subset runtime-tools
The subsets should give as much fine-grained control as was previously provided within the managed components. The native build scripts continue to have some finer-grained control and the build-runtime scripts are available for those who need it.
Activity
stephentoub commentedon Feb 28, 2020
@jkoritzinsky, I'm struggling to follow the examples a little. If today I do this:
what does that translate to now? Thanks.
jkoritzinsky commentedon Feb 28, 2020
That translates to
build -subsetcategory coreclr -c Release.CoreCLR tests are now only built through the
src/coreclr/build-testscripts, not the product build scripts, so there’s no need for a skiptests argument.jkotas commentedon Feb 29, 2020
What is going to be equivalent of
src\coreclr\build.cmd linuxmscorlib?jkoritzinsky commentedon Mar 2, 2020
The equivalent is
./build -subset corelib -os Linux.[-]Upcoming changes to CoreCLR workflow[/-][+]Changes to CoreCLR workflow[/+]jkotas commentedon Mar 4, 2020
This fails very early for me with:
Restore completed in 78.15 ms for D:\runtime\src\coreclr\src\tools\crossgen2\crossgen2\crossgen2.csproj. 'py' is not recognized as an internal or external command, operable program or batch file. The filename, directory name, or volume label syntax is incorrect. D:\runtime\src\coreclr\src\System.Private.CoreLib\System.Private.CoreLib.csproj(467,5): error MSB3073: The command ""'py' is not recognized as an internal or external command,;operable program or batch file.;C:\Users\jkotas\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe" -B -Wall "D:\runtime\src\coreclr\/src/scripts/genRuntimeEventSources.py" --man "D:\runtime\src\coreclr\/src/vm/ClrEtwAll.man" --intermediate "D:\runtime\artifacts\obj\coreclr\Eventing\x64\Release"" exited with code 123.What is the recommended way to deal with the python dependency?
jkoritzinsky commentedon Mar 4, 2020
That is a bug in eng/python.targets that didn't show up in testing somehow. I'll go fix that today. The workaround is to set the PYTHON environment variable to point to your python installation.
jkotas commentedon Mar 4, 2020
Thanks! FWIW, I have the python setup according to https://github.com/dotnet/runtime/blob/master/docs/workflow/requirements/windows-requirements.md#python
BruceForstall commentedon Mar 4, 2020
@jkoritzinsky You suggest using:
So, subsetCategory can be concatenated with
-? Same with-subset?What does the "all" subset refer to? It looks like possibly one or all of:
but maybe because only
librariesis specified in-subsetCategory, it only applies tolibrariesand notMonoorInstaller?Is there a reason why there is no
allfor CoreClr?4 remaining items
sdmaclea commentedon Mar 7, 2020
@jkoritzinsky The deprecation warning message in CoreCLR makes little sense. It says to use
build-native.shwhich only exists inlibraries. I suspect it should saybuild-runtime.sh? Also building docs seem to be out of date.jkoritzinsky commentedon Mar 7, 2020
Yep that’s a typo from when I was renaming. I was going to name the files build-native but then changed my mind. Can you point me to the specific docs that are out of date? I thought I updated them.
briansull commentedon Mar 9, 2020
Can you tell me what the very first command to use is to build everything after a clean sync?
For Checked?
jkoritzinsky commentedon Mar 9, 2020
@sandreenko I have not seen any errors like that locally.
@briansull If you want to only build coreclr and libraries:
./build -subsetcategory coreclr-libraries -runtimeconfiguration checked -c releaseIf you want to build the whole repo (including Mono and Installer):
./build -runtimeconfiguration checked -c releasebriansull commentedon Mar 9, 2020
Do I ever need to build Mono and the Installer, to do development on coreclr?
briansull commentedon Mar 9, 2020
I will try using:
./build -subsetcategory coreclr-libraries -runtimeconfiguration checked -c releaseon my branch new clean up to date enlistment and report back.
My build was successful!!
jkoritzinsky commentedon Mar 9, 2020
It's very unlikely you would need to build Mono and the installer, but I wanted to give that command as well just to cover my bases.
sdmaclea commentedon Mar 9, 2020
I was looking at the cross compilation and Linux coreclr instructions. They seemed to still be referring to the
build.shscript insrc/coreclr.Also a lot of your noted in the top post seem to have not made it to docs. Seems that is why there is traffic on this issue.... It is not clear where the build recipes are documented for developer scenarios...
jkoritzinsky commentedon Mar 9, 2020
I think #33325 updates most of the docs. I'll make sure to add the commands above to a new "commonly used CoreCLR build commands" doc so they're easy to find.
sdmaclea commentedon Mar 9, 2020
I found the build-runtime name counter intuitive. I was looking to build the DAC which is a native component, but is not the runtime. So I would have preferred, buuild-native for the non-runtime components...
jkoritzinsky commentedon Mar 10, 2020
The reason I chose build-runtime was so the script matched the subset name. Basically so the command
build -subsetcategory coreclr -subset runtimewas equivalent tosrc/coreclr/build-runtime. I realize now that that may not have been the thing to aim for (or that the subset should also be named “native”)ViktorHofer commentedon Mar 19, 2020
Unpinning (3 weeks pinned should be sufficient) to make room for new announcements.