diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props
index c1341c290a5e..e6c924d5bc3b 100644
--- a/eng/SourceBuild.props
+++ b/eng/SourceBuild.props
@@ -12,6 +12,7 @@
$(InnerBuildArgs) /p:SkipBuildingInstallers=true
$(InnerBuildArgs) /p:IncludeAdditionalSharedFrameworks=false
$(InnerBuildArgs) /p:DISABLE_CROSSGEN=true
+ $(InnerBuildArgs) /p:PgoInstrument=true
diff --git a/eng/pipelines/templates/jobs/vmr-build.yml b/eng/pipelines/templates/jobs/vmr-build.yml
index d25e605c08e7..16d676186c87 100644
--- a/eng/pipelines/templates/jobs/vmr-build.yml
+++ b/eng/pipelines/templates/jobs/vmr-build.yml
@@ -211,7 +211,7 @@ jobs:
- ${{ if eq(parameters.targetOS, 'windows') }}:
- script: |
- call $(sourcesPath)\build.cmd -ci -cleanWhileBuilding -prepareMachine
+ call $(sourcesPath)\build.cmd -ci -cleanWhileBuilding -prepareMachine ${{ parameters.extraProperties }}
displayName: Build
- ${{ else }}:
diff --git a/eng/pipelines/templates/stages/vmr-build.yml b/eng/pipelines/templates/stages/vmr-build.yml
index e53063ee0d00..de9aa765d930 100644
--- a/eng/pipelines/templates/stages/vmr-build.yml
+++ b/eng/pipelines/templates/stages/vmr-build.yml
@@ -826,3 +826,16 @@ stages:
useMonoRuntime: true
targetOS: windows
targetArchitecture: x86
+
+ - template: ../jobs/vmr-build.yml
+ parameters:
+ buildName: Windows_Pgo
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
+ vmrBranch: ${{ variables.VmrBranch }}
+ architecture: x64
+ pool:
+ name: ${{ variables.defaultPoolName }}
+ demands: ${{ variables.defaultPoolDemandsWindows }}
+ targetOS: windows
+ targetArchitecture: x64
+ extraProperties: /p:PgoInstrument=true
diff --git a/src/SourceBuild/content/Directory.Build.props b/src/SourceBuild/content/Directory.Build.props
index bbd94253d7d2..e587e6ac4e0f 100644
--- a/src/SourceBuild/content/Directory.Build.props
+++ b/src/SourceBuild/content/Directory.Build.props
@@ -189,6 +189,7 @@
NonShipping.Packages.
$([MSBuild]::NormalizeDirectory('$(PrereqsPackagesDir)', 'reference'))
+ $([MSBuild]::NormalizeDirectory('$(PrereqsPackagesDir)', 'reference-assets'))
Private.SourceBuilt.Artifacts
Private.SourceBuilt.Prebuilts
diff --git a/src/SourceBuild/content/repo-projects/Directory.Build.targets b/src/SourceBuild/content/repo-projects/Directory.Build.targets
index 2d4c14bf3219..906f06f57e3a 100644
--- a/src/SourceBuild/content/repo-projects/Directory.Build.targets
+++ b/src/SourceBuild/content/repo-projects/Directory.Build.targets
@@ -414,19 +414,21 @@
- $(RepoArtifactsNonShippingPackagesDir)
+ $(RepoArtifactsNonShippingPackagesDir)
+ $(ReferencePackagesDir)
- $(RepoArtifactsShippingPackagesDir)
+ $(RepoArtifactsShippingPackagesDir)
+ $(ReferencePackagesDir)
-
-
-
+
+ $(ArtifactsAssetsDir)
+ $(ReferenceAssetsDir)
+
+
@@ -520,7 +522,8 @@
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(BaseIntermediateOutputPath)ExtractToolPackage.complete">
- <_ToolPackagesRoot>$(RepoArtifactsNonShippingPackagesDir)
+ <_ToolPackagesRoot Condition="'$(ReferenceOnlyRepoArtifacts)' != 'true'">$(RepoArtifactsNonShippingPackagesDir)
+ <_ToolPackagesRoot Condition="'$(ReferenceOnlyRepoArtifacts)' == 'true'">$(ReferencePackagesDir)
diff --git a/src/SourceBuild/content/repo-projects/installer.proj b/src/SourceBuild/content/repo-projects/installer.proj
index 05c9ad7a2544..b2fc880124a4 100644
--- a/src/SourceBuild/content/repo-projects/installer.proj
+++ b/src/SourceBuild/content/repo-projects/installer.proj
@@ -32,10 +32,11 @@
$(BuildArgs) /p:PortableBuild=true
$(BuildArgs) /p:CoreSetupRid=$(TargetRid)
-
$(BuildArgs) /p:PublicBaseURL=file:%2F%2F$(ArtifactsAssetsDir)
$(BuildArgs) /p:UsePortableLinuxSharedFramework=false
+
+ $(BuildArgs) /p:PgoInstrument=true
diff --git a/src/SourceBuild/content/repo-projects/runtime.proj b/src/SourceBuild/content/repo-projects/runtime.proj
index 9ad2c103588c..3dcaa1eb5527 100644
--- a/src/SourceBuild/content/repo-projects/runtime.proj
+++ b/src/SourceBuild/content/repo-projects/runtime.proj
@@ -19,6 +19,7 @@
$(BuildArgs) /p:BaseOS=$(BaseOS)
$(BuildArgs) /p:DotNetBuildRuntimeWasmEnableThreads=true
$(BuildArgs) /p:DotNetBuildRuntimeNativeAOTRuntimePack=true
+ $(BuildArgs) $(FlagParameterPrefix)pgoinstrument
diff --git a/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj b/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj
index 7c3650d741fc..c7bb4961abcf 100644
--- a/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj
+++ b/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj
@@ -3,6 +3,7 @@
+ true
true
@@ -30,4 +31,12 @@
SourcePath="$(LocalNuGetPackageCacheDirectory)" />
+
+
+
+
+