diff --git a/docs/workflow/building/libraries/README.md b/docs/workflow/building/libraries/README.md index c64f34d7054704..44eb0eb209eee1 100644 --- a/docs/workflow/building/libraries/README.md +++ b/docs/workflow/building/libraries/README.md @@ -176,6 +176,25 @@ dotnet build System.Net.NetworkInformation.csproj /p:TargetOS=Linux dotnet build -c Release System.Net.NetworkInformation.csproj ``` +### Iterating on System.Private.CoreLib changes +When changing `System.Private.CoreLib` after a full build, in order to test against those changes, you will need an updated `System.Private.CoreLib` in the testhost. In order to achieve that, you can build the `libs.pretest` subset which does testhost setup including copying over `System.Private.CoreLib`. + +After doing a build of the runtime: + +``` +build.cmd clr -rc Release +``` + +You can iterate on `System.Private.CoreLib` by running: + +``` +build.cmd clr.corelib+clr.nativecorelib+libs.pretest -rc Release +``` + +When this `System.Private.CoreLib` will be built in Release mode, then it will be crossgen'd and we will update the testhost to the latest version of corelib. + +You can use the same workflow for mono runtime by using `mono.corelib+libs.pretest` subsets. + ### Building for Mono By default the libraries will attempt to build using the CoreCLR version of `System.Private.CoreLib.dll`. In order to build against the Mono version you need to use the `/p:RuntimeFlavor=Mono` argument. diff --git a/eng/build.ps1 b/eng/build.ps1 index bfce8766eced90..f8b205bd3930a1 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -93,9 +93,12 @@ function Get-Help() { Write-Host "* Build Mono runtime for Windows x64 on Release configuration." Write-Host ".\build.cmd mono -c release" Write-Host "" - Write-Host "It's important to mention that to build Mono for the first time," - Write-Host "you need to build the CLR and Libs subsets beforehand." - Write-Host "This is done automatically if a full build is performed at first." + Write-Host "* Build Release coreclr corelib, crossgen corelib and update Debug libraries testhost to run test on an updated corelib." + Write-Host ".\build.cmd clr.corelib+clr.nativecorelib+libs.pretest -rc release" + Write-Host "" + Write-Host "* Build Debug mono corelib and update Release libraries testhost to run test on an updated corelib." + Write-Host ".\build.cmd mono.corelib+libs.pretest -rc debug -c release" + Write-Host "" Write-Host "" Write-Host "For more information, check out https://github.com/dotnet/runtime/blob/master/docs/workflow/README.md" } diff --git a/eng/build.sh b/eng/build.sh index 97df9cd8a1cef2..eb0cb586ebf325 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -107,9 +107,12 @@ usage() echo "* Build Mono runtime for Linux x64 on Release configuration." echo "./build.sh mono -c release" echo "" - echo "It's important to mention that to build Mono for the first time," - echo "you need to build the CLR and Libs subsets beforehand." - echo "This is done automatically if a full build is performed at first." + echo "* Build Release coreclr corelib, crossgen corelib and update Debug libraries testhost to run test on an updated corelib." + echo "./build.sh clr.corelib+clr.nativecorelib+libs.pretest -rc release" + echo "" + echo "* Build Debug mono corelib and update Release libraries testhost to run test on an updated corelib." + echo "./build.sh mono.corelib+libs.pretest -rc debug -c release" + echo "" echo "" echo "For more general information, check out https://github.com/dotnet/runtime/blob/master/docs/workflow/README.md" }