From 66ad15d49a42e6fb6b0067877837dd398676c143 Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Tue, 7 Jul 2020 11:21:27 -0700 Subject: [PATCH 1/3] Add examples of System.Private.CoreLib iterative workflow --- docs/workflow/building/libraries/README.md | 11 +++++++++++ eng/build.ps1 | 9 ++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/workflow/building/libraries/README.md b/docs/workflow/building/libraries/README.md index c64f34d7054704..c9d902ee999e4c 100644 --- a/docs/workflow/building/libraries/README.md +++ b/docs/workflow/building/libraries/README.md @@ -176,6 +176,17 @@ 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`. + +``` +build.cmd clr.corelib+clr.nativecorelib+libs.pretest -rc Release +``` + +By running 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..1dbaf954e49a0f 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 Release mono corelib and update Debug libraries testhost to run test on an updated corelib." + Write-Host ".\build.cmd mono.corelib+libs.pretest -rc debug" + Write-Host "" Write-Host "" Write-Host "For more information, check out https://github.com/dotnet/runtime/blob/master/docs/workflow/README.md" } From 7576994ad4b66e6bb813a8a43699fd5f161a9542 Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Tue, 7 Jul 2020 11:28:53 -0700 Subject: [PATCH 2/3] Update build.sh --- eng/build.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eng/build.sh b/eng/build.sh index 97df9cd8a1cef2..f29a3ebc0d8e43 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 Release mono corelib and update Debug libraries testhost to run test on an updated corelib." + echo "./build.sh mono.corelib+libs.pretest -rc debug" + echo "" echo "" echo "For more general information, check out https://github.com/dotnet/runtime/blob/master/docs/workflow/README.md" } From 3897a1fbe28aa3da06b43b551ae75f34aad08c6e Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Tue, 7 Jul 2020 12:52:28 -0700 Subject: [PATCH 3/3] PR Feedback --- docs/workflow/building/libraries/README.md | 10 +++++++++- eng/build.ps1 | 4 ++-- eng/build.sh | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/workflow/building/libraries/README.md b/docs/workflow/building/libraries/README.md index c9d902ee999e4c..44eb0eb209eee1 100644 --- a/docs/workflow/building/libraries/README.md +++ b/docs/workflow/building/libraries/README.md @@ -179,11 +179,19 @@ 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 ``` -By running 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. +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. diff --git a/eng/build.ps1 b/eng/build.ps1 index 1dbaf954e49a0f..f8b205bd3930a1 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -96,8 +96,8 @@ function Get-Help() { 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 Release mono corelib and update Debug libraries testhost to run test on an updated corelib." - Write-Host ".\build.cmd mono.corelib+libs.pretest -rc debug" + 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 f29a3ebc0d8e43..eb0cb586ebf325 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -110,8 +110,8 @@ usage() 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 Release mono corelib and update Debug libraries testhost to run test on an updated corelib." - echo "./build.sh mono.corelib+libs.pretest -rc debug" + 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"