Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VMR support for Windows-x64 PGO Instrumented leg #18672

Merged
merged 16 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/SourceBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<InnerBuildArgs>$(InnerBuildArgs) /p:SkipBuildingInstallers=true</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:IncludeAdditionalSharedFrameworks=false</InnerBuildArgs>
<InnerBuildArgs Condition="'$(SourceBuildUseMonoRuntime)' == 'true'">$(InnerBuildArgs) /p:DISABLE_CROSSGEN=true</InnerBuildArgs>
<InnerBuildArgs Condition="'$(PgoInstrument)' == 'true'">$(InnerBuildArgs) /p:PgoInstrument=true</InnerBuildArgs>
</PropertyGroup>
</Target>

Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/jobs/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
displayName: Build

- ${{ else }}:
Expand Down
13 changes: 13 additions & 0 deletions eng/pipelines/templates/stages/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions src/SourceBuild/content/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
<NonShippingPackagesListPrefix>NonShipping.Packages.</NonShippingPackagesListPrefix>

<ReferencePackagesDir>$([MSBuild]::NormalizeDirectory('$(PrereqsPackagesDir)', 'reference'))</ReferencePackagesDir>
<ReferenceAssetsDir>$([MSBuild]::NormalizeDirectory('$(PrereqsPackagesDir)', 'reference-assets'))</ReferenceAssetsDir>
<SourceBuiltArtifactsTarballName>Private.SourceBuilt.Artifacts</SourceBuiltArtifactsTarballName>
<SourceBuiltPrebuiltsTarballName>Private.SourceBuilt.Prebuilts</SourceBuiltPrebuiltsTarballName>

Expand Down
21 changes: 12 additions & 9 deletions src/SourceBuild/content/repo-projects/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -414,19 +414,21 @@
<ItemGroup>
<RepoManifestNonShippingPackage Include="@(RepoManifestPackage)"
Condition="$([System.String]::Copy('%(Identity)').Contains('$([System.IO.Path]::DirectorySeparatorChar)NonShipping$([System.IO.Path]::DirectorySeparatorChar)'))">
<DestinationFolder>$(RepoArtifactsNonShippingPackagesDir)</DestinationFolder>
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' != 'true'">$(RepoArtifactsNonShippingPackagesDir)</DestinationFolder>
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' == 'true'">$(ReferencePackagesDir)</DestinationFolder>
</RepoManifestNonShippingPackage>

<RepoManifestShippingPackage Include="@(RepoManifestPackage)"
Exclude="@(RepoManifestNonShippingPackage)">
<DestinationFolder>$(RepoArtifactsShippingPackagesDir)</DestinationFolder>
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' != 'true'">$(RepoArtifactsShippingPackagesDir)</DestinationFolder>
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' == 'true'">$(ReferencePackagesDir)</DestinationFolder>
</RepoManifestShippingPackage>
</ItemGroup>

<!-- Building SBRP: At this point the References directory contains the previously-source-built SBRPs,
clear it before copying the current SBRPs. This ensures n-1 SBRPs aren't required to build the product repos. -->
<RemoveDir Directories="$(ReferencePackagesDir)"
Condition="'$(RepositoryName)' == 'source-build-reference-packages'" />
<RepoManifestAsset>
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' != 'true'">$(ArtifactsAssetsDir)</DestinationFolder>
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' == 'true'">$(ReferenceAssetsDir)</DestinationFolder>
</RepoManifestAsset>
</ItemGroup>

<!-- Copy shipping packages -->
<Copy SourceFiles="@(RepoManifestShippingPackage)"
Expand All @@ -440,7 +442,7 @@

<!-- Copy assets -->
<Copy SourceFiles="@(RepoManifestAsset)"
DestinationFolder="$(ArtifactsAssetsDir)"
DestinationFolder="%(RepoManifestAsset.DestinationFolder)"
Condition="'@(RepoManifestAsset)' != ''" />

<MakeDir Directories="$(BaseIntermediateOutputPath)" />
Expand Down Expand Up @@ -520,7 +522,8 @@
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(BaseIntermediateOutputPath)ExtractToolPackage.complete">
<PropertyGroup>
<_ToolPackagesRoot>$(RepoArtifactsNonShippingPackagesDir)</_ToolPackagesRoot>
<_ToolPackagesRoot Condition="'$(ReferenceOnlyRepoArtifacts)' != 'true'">$(RepoArtifactsNonShippingPackagesDir)</_ToolPackagesRoot>
<_ToolPackagesRoot Condition="'$(ReferenceOnlyRepoArtifacts)' == 'true'">$(ReferencePackagesDir)</_ToolPackagesRoot>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/SourceBuild/content/repo-projects/installer.proj
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
<BuildArgs Condition="'$(TargetOS)' == 'freebsd' and '$(DotNetBuildSourceOnly)' == 'true'">$(BuildArgs) /p:PortableBuild=true</BuildArgs>
<BuildArgs Condition="'$(TargetOS)' != 'windows'">$(BuildArgs) /p:CoreSetupRid=$(TargetRid)</BuildArgs>

<!-- Consume the source-built Core-Setup and toolset. This line must be removed to source-build CLI without source-building Core-Setup first. -->
<BuildArgs>$(BuildArgs) /p:PublicBaseURL=file:%2F%2F$(ArtifactsAssetsDir)</BuildArgs>

<BuildArgs>$(BuildArgs) /p:UsePortableLinuxSharedFramework=false</BuildArgs>

<BuildArgs Condition="'$(PgoInstrument)' == 'true'">$(BuildArgs) /p:PgoInstrument=true</BuildArgs>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/SourceBuild/content/repo-projects/runtime.proj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<BuildArgs Condition="'$(ShortStack)' != 'true'">$(BuildArgs) /p:BaseOS=$(BaseOS)</BuildArgs>
<BuildArgs Condition="'$(DotNetBuildRuntimeWasmEnableThreads)' == 'true'">$(BuildArgs) /p:DotNetBuildRuntimeWasmEnableThreads=true</BuildArgs>
<BuildArgs Condition="'$(DotNetBuildRuntimeNativeAOTRuntimePack)' == 'true'">$(BuildArgs) /p:DotNetBuildRuntimeNativeAOTRuntimePack=true</BuildArgs>
<BuildArgs Condition="'$(PgoInstrument)' == 'true'">$(BuildArgs) $(FlagParameterPrefix)pgoinstrument</BuildArgs>
</PropertyGroup>

<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<!-- All packages built in SBRP repo are copied to prereqs/package/reference.
Nothing gets copied to the artifacts/packages folder. -->
<ReferenceOnlyRepoArtifacts>true</ReferenceOnlyRepoArtifacts>

<!-- SBRP builds before Arcade so it also needs the bootstrap Arcade version -->
<UseBootstrapArcade>true</UseBootstrapArcade>
Expand Down Expand Up @@ -30,4 +31,12 @@
SourcePath="$(LocalNuGetPackageCacheDirectory)" />
</Target>

<Target Name="ClearPreviousSBRP"
BeforeTargets="CopyRepoArtifacts"
DependsOnTargets="RepoBuild">
<!-- Building SBRP: At this point the References directory contains the previously-source-built SBRPs,
clear it before copying the current SBRPs. This ensures n-1 SBRPs aren't required to build the product repos. -->
<RemoveDir Directories="$(ReferencePackagesDir)" />
</Target>

</Project>