diff --git a/docs/installer/building/local-coreclr-corefx.md b/docs/installer/building/local-coreclr-corefx.md new file mode 100644 index 0000000000000000000000000000000000000000..a5fba3d04d19601df91f9a14aa48723045308196 --- /dev/null +++ b/docs/installer/building/local-coreclr-corefx.md @@ -0,0 +1,29 @@ +# Build Core-Setup with a Local CoreCLR or CoreFX + +## Testing with private CoreCLR bits + +Generally the Core-Setup build system gets the CoreCLR from a NuGet package which gets pulled down and correctly copied to the various output directories by building `src\pkg\projects\netcoreapp\src\netcoreapp.depproj` which gets built as part of `build.cmd/sh`. For folks that want to do builds and test runs in corefx with a local private build of coreclr you can follow these steps: + +1. Build CoreCLR and note your output directory. Ex: `\coreclr\bin\Product\Windows_NT.x64.Release\` Note this will vary based on your OS/Architecture/Flavor and it is generally a good idea to use Release builds for CoreCLR when building Core-Setup and the OS and Architecture should match what you are building in Core-Setup. +2. Build Core-Setup either passing in the `CoreCLROverridePath` property or setting it as an environment variable: + +```batch +build.cmd /p:CoreCLROverridePath=d:\git\coreclr\bin\Product\Windows_NT.x64.Release +``` + +By convention the project will look for PDBs in a directory under `$(CoreCLROverridePath)/PDB` and if found will also copy them. If not found no PDBs will be copied. If you want to explicitly set the PDB path then you can pass `CoreCLRPDBOverridePath` property to that PDB directory. +Once you have updated your CoreCLR you can run tests however you usually do and it should be using your copy of CoreCLR. +If you prefer, you can use a Debug build of System.Private.CoreLib, but if you do you must also use a Debug build of the native portions of the runtime, e.g. coreclr.dll. Tests with a Debug runtime will execute much more slowly than with Release runtime bits. This override is only enabled for building the NETCoreApp shared framework. + +## Testing with private CoreFX bits + +Similarly to how Core-Setup consumes CoreCLR, Core-Setup also consumes CoreFX from a NuGet package which gets pulled down and correctly copied to the various output directories by building `src\pkg\projects\netcoreapp\src\netcoreapp.depproj` which gets built as part of `build.cmd/sh`. To test with a local private build of CoreFX, you can follow these steps: + +1. Build CoreFX and note your configuration (Ex. Debug, Checked, Release). +2. Build Core-Setup either passing in the `CoreFXOverridePath` property or setting it as an environment variable (assuming your CoreFX repo is located at `d:\git\corefx`): + +```batch +build.cmd /p:CoreFXOverridePath=d:\git\corefx\artifacts\packages\Debug +``` + +The Core-Setup build will resolve the correct libraries to use to build the NETCoreApp shared framework based on the restored packages and will locate the files in the output directory based on the nuspec file of the shared-framework package in the local CoreFX build. This override does not enable using a local CoreFX build when creating the WindowsDesktop shared framework. diff --git a/src/installer/pkg/packaging-tools/framework.dependency.targets b/src/installer/pkg/packaging-tools/framework.dependency.targets index 3e7afc5483d7b1206360a20ac7d5d524de7961de..9d2eaabb6fa94354f83c4b5c01a701bda88150e1 100644 --- a/src/installer/pkg/packaging-tools/framework.dependency.targets +++ b/src/installer/pkg/packaging-tools/framework.dependency.targets @@ -251,10 +251,17 @@ <_diaSymReaderPackageDir>$(PackagesDir)microsoft.diasymreader.native/$(MicrosoftDiaSymReaderNativePackageVersion)/ + + <_crossHostArch>x86 + + + <_crossHostArch>x64 + + + <_crossHostArch>x64 + - <_crossDir Condition="'$(TargetArchitecture)' == 'arm' AND '$(OS)' == 'Windows_NT'">/x86_arm - <_crossDir Condition="'$(TargetArchitecture)' == 'arm' AND '$(OS)' != 'Windows_NT'">/x64_arm - <_crossDir Condition="'$(TargetArchitecture)' == 'arm64'">/x64_arm64 + <_crossDir Condition="'$(_crossHostArch)' != ''">/$(_crossHostArch)_$(TargetArchitecture) @@ -303,7 +310,7 @@ <_diaSymReaderToolDir>%(_diaSymReaderAssembly.RootDir)%(_diaSymReaderAssembly.Directory) - + + + + + + $(CoreCLROverridePath)/PDB + + + + + + + + @(CoreCLRFiles) + + + + %(PathInPackage) + + + + + + @(ShortNameDacFileOverride) + + + + true + + + + + + + + + + + + + + $(CoreFXOverridePath)/specs/$(MicrosoftPrivateCoreFxNETCoreAppPackage).nuspec + $(CoreFXOverridePath)/specs/runtime.$(PackageRID).$(MicrosoftPrivateCoreFxNETCoreAppPackage).nuspec + + + + + + + + + + + + + + + + + + + + + @(CoreFXReferenceItems) + + + + + + + @(CoreFXReferenceCopyLocalItems) + + + + true + + + + + + + + <_coreFXOverrideDocFiles + Condition="'$(CoreFXOverridePath)' != '' And '%(NuGetPackageId)' == '$(MicrosoftPrivateCoreFxNETCoreAppPackage)'" + Include="@(OverriddenFrameworkReferenceFiles->'$(CoreFXOverridePath)/../../bin/docs/%(FileName).xml')" /> + <_docFilesToPackage Include="@(_coreFXOverrideDocFiles)" Condition="Exists('%(Identity)')" /> + + + + + + <_runtimeDirectory>$(CoreCLROverridePath) + <_crossgenPath>$(CoreCLROverridePath)/crossgen$(ApplicationFileExtension) + <_coreLibDirectory>$(CoreCLROverridePath) + <_jitPath>$(CoreClrOverridePath)/$(_crossHostArch)/$(LibraryFilePrefix)clrjit$(LibraryFileExtension) + + + + + diff --git a/src/installer/pkg/projects/netcoreapp/src/netcoreapp.depproj b/src/installer/pkg/projects/netcoreapp/src/netcoreapp.depproj index 96c79dc4953582dde2f16510abd6243313540b40..8e698d658f8e3d1839061010dfab4c5b63327bcd 100644 --- a/src/installer/pkg/projects/netcoreapp/src/netcoreapp.depproj +++ b/src/installer/pkg/projects/netcoreapp/src/netcoreapp.depproj @@ -77,5 +77,6 @@ - + +