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

Sign the DAC and build (and sign) the cross-OS DACs in the VMR #46377

Merged
merged 26 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c704989
Add steps to install, set up, and remove diagnostic certs for DAC sig…
jkoritzinsky Jan 28, 2025
f90b6bb
Forward down the ESRP tool path when we're doing real signing.
jkoritzinsky Jan 28, 2025
9e3c8bc
Add a win-x86 join job to run the cross-os DAC signing.
jkoritzinsky Jan 28, 2025
e661045
Add comments around the install/remove step templates.
jkoritzinsky Jan 29, 2025
0f5b16e
Add comments about our BuildPhase2 jobs
jkoritzinsky Jan 29, 2025
b515aa0
Pass down IsOfficialBuild variable
jkoritzinsky Jan 30, 2025
f1bd73b
Merge branch 'main' into dac-sign
jkoritzinsky Feb 3, 2025
24722b8
Merge branch 'main' into dac-sign
jkoritzinsky Feb 5, 2025
c555fff
Add patch to enable building runtime projects in BuildPass=2
jkoritzinsky Feb 5, 2025
6b06843
Update eng/pipelines/templates/stages/vmr-build.yml
jkoritzinsky Feb 5, 2025
6838590
Update patch
jkoritzinsky Feb 5, 2025
dc37e48
Update patch
jkoritzinsky Feb 6, 2025
c38d8a6
Merge branch 'main' of github.com:dotnet/sdk into dac-sign
jkoritzinsky Feb 6, 2025
48bb561
Rename patch file
jkoritzinsky Feb 6, 2025
161770a
Allow a repository to reference packages produced by itself in earlie…
jkoritzinsky Feb 6, 2025
044a914
Use RepositoryReferenceInfo instead for this case.
jkoritzinsky Feb 6, 2025
5748c30
Update task to understand "previous build pass" sources
jkoritzinsky Feb 7, 2025
760f202
Update tests
jkoritzinsky Feb 7, 2025
b3c142d
Remove patch
jkoritzinsky Feb 7, 2025
5d84d87
Fix double-dash
jkoritzinsky Feb 8, 2025
f41a134
Add the previously-source-built prefix in one more place
jkoritzinsky Feb 10, 2025
c60dbc3
Remove trailing newlines
jkoritzinsky Feb 10, 2025
c93ea9f
Disable building the host tools in later build passes.
jkoritzinsky Feb 11, 2025
1224193
Be more explicit where we're disabling this component
jkoritzinsky Feb 11, 2025
7b78f03
Update 0003-dont-build-host-tools.patch
jkoritzinsky Feb 12, 2025
ca303cd
Update runtime.proj
jkoritzinsky Feb 12, 2025
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
29 changes: 29 additions & 0 deletions eng/pipelines/templates/jobs/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ jobs:

### Signing variables
- ${{ if eq(parameters.sign, 'True') }}:
- name: _SignDiagnosticFilesArgs
value: ''
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
# The _SignType variable is used by microbuild installation
- name: _SignType
Expand All @@ -223,9 +225,16 @@ jobs:
value: real
- name: signArguments
value: -sign /p:DotNetSignType=real /p:TeamName=$(_TeamName)
- name: _EnableDacSigning
${{ if and(eq(parameters.isBuiltFromVmr, true), ne(parameters.buildSourceOnly, 'True')) }}:
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved
value: true
${{ else }}:
value: false
- ${{ else }}:
- name: signArguments
value: ''
- name: _SignDiagnosticFilesArgs
value: ''

### Build Pass
- ${{ if ne(parameters.buildPass, '') }}:
Expand Down Expand Up @@ -384,16 +393,36 @@ jobs:
inputs:
versionSpec: 20.x

- ${{ if eq(variables['_EnableDacSigning'], 'true') }}:
# TODO: Once we turn off the dotnet/runtime official build, move these templates into the VMR's eng folder.
- template: ${{ variables['Build.SourcesDirectory'] }}/src/runtime/eng/pipelines/coreclr/templates/install-diagnostic-certs.yml
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
parameters:
isOfficialBuild: ${{ variables.isOfficialBuild }}
certNames:
- 'dotnetesrp-diagnostics-aad-ssl-cert'
- 'dotnet-diagnostics-esrp-pki-onecert'
vaultName: 'clrdiag-esrp-id'
azureSubscription: 'diagnostics-esrp-kvcertuser'
scriptRoot: '$(Build.SourcesDirectory)/src/runtime'

- script: build.cmd
$(baseArguments)
$(targetArguments)
$(signArguments)
$(buildPassArguments)
$(ibcArguments)
$(_SignDiagnosicFilesArgs)
${{ parameters.extraProperties }}
displayName: Build
workingDirectory: ${{ variables.sourcesPath }}

- ${{ if eq(variables['_EnableDacSigning'], 'true') }}:
# TODO: Once we turn off the dotnet/runtime official build, move these templates into the VMR's eng folder.
- template: ${{ variables['Build.SourcesDirectory'] }}/src/runtime/eng/pipelines/coreclr/templates/remove-diagnostic-certs.yml
parameters:
isOfficialBuild: ${{ variables.isOfficialBuild }}
scriptRoot: '$(Build.SourcesDirectory)/src/runtime'

- ${{ if eq(parameters.runTests, 'True') }}:
- script: build.cmd
$(baseArguments)
Expand Down
17 changes: 17 additions & 0 deletions eng/pipelines/templates/stages/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,23 @@ stages:
- Windows_x86
- Windows_arm64

- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
vmrBranch: ${{ variables.VmrBranch }}
pool: ${{ parameters.pool_Windows }}
targetOS: windows
targetArchitecture: x86
buildPass: 2
reuseBuildArtifactsFrom:
- AzureLinux_x64_Cross_x64
- AzureLinux_x64_Cross_Alpine_x64
- AzureLinux_x64_Cross_arm64
- AzureLinux_x64_Cross_Alpine_arm64
- AzureLinux_x64_Cross_arm
- AzureLinux_x64_Cross_Alpine_arm

### FINAL JOIN ###
- ${{ if and(parameters.isBuiltFromVmr, not(parameters.isSourceOnlyBuild), ne(variables['Build.Reason'], 'PullRequest')) }}:
- stage: VMR_Final_Join
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public class UpdateNuGetConfigPackageSourcesMappings : Task
[Required]
public string SourceBuiltSourceNamePrefix { get; set; }

[Required]
public string PreviousBuildPassSourceNamePrefix { get; set; }

public string SbrpCacheSourceName { get; set; }

public string ReferencePackagesSourceName { get; set; }
Expand Down Expand Up @@ -255,6 +258,7 @@ private XElement GetPackageMappingsElementForSource(string packageSource)
{
bool isCurrentSourceBuiltSource =
packageSource.StartsWith(SourceBuiltSourceNamePrefix) ||
packageSource.StartsWith(PreviousBuildPassSourceNamePrefix) ||
packageSource.Equals(SbrpCacheSourceName) ||
packageSource.Equals(ReferencePackagesSourceName);

Expand Down Expand Up @@ -328,6 +332,10 @@ private void DiscoverPackagesFromAllSourceBuildSources(XElement pkgSourcesElemen
{
AddToDictionary(currentPackages, id, version);
}
else if (packageSource.StartsWith(PreviousBuildPassSourceNamePrefix))
{
AddToDictionary(currentPackages, id, version);
}
else if (packageSource.Equals(ReferencePackagesSourceName))
{
AddToDictionary(referencePackages, id, version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

<SbrpCacheNuGetSourceName>source-build-reference-package-cache</SbrpCacheNuGetSourceName>
<SourceBuiltSourceNamePrefix>source-built-</SourceBuiltSourceNamePrefix>
<PreviousBuildPassSourceNamePrefix>previous-build-pass-</PreviousBuildPassSourceNamePrefix>

<!-- Set the bootstrap version to the VMR's version if empty. (no bootstrap set). -->
<ArcadeBootstrapVersion>$([MSBuild]::ValueOrDefault('$(ARCADE_BOOTSTRAP_VERSION)', '$(ArcadeSdkVersion)'))</ArcadeBootstrapVersion>
Expand Down
10 changes: 10 additions & 0 deletions src/SourceBuild/content/repo-projects/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@
</RepositoryReferenceInfo>
</ItemGroup>

<ItemGroup Condition="'$(DotNetBuildPass)' != '' and '$(DotNetBuildPass)' != '1'">
<RepositoryReferenceInfo Include="$(RepositoryName)">
<ShippingSourceName>$(PreviousBuildPassSourceNamePrefix)$(RepositoryName)</ShippingSourceName>
<NonShippingSourceName>$(PreviousBuildPassSourceNamePrefix)transport-$(RepositoryName)</NonShippingSourceName>
<ShippingPackagesPath>$(ArtifactsShippingPackagesDir)/$(RepositoryName)/</ShippingPackagesPath>
<NonShippingPackagesPath>$(ArtifactsNonShippingPackagesDir)/$(RepositoryName)/</NonShippingPackagesPath>
</RepositoryReferenceInfo>
</ItemGroup>

<ItemGroup Condition="'@(RepositoryReferenceInfo)' != ''">
<DependentRepoSourceName Include="@(RepositoryReferenceInfo->'%(ShippingSourceName)')" />
<DependentRepoSourceName Include="@(RepositoryReferenceInfo->'%(NonShippingSourceName)')" />
Expand Down Expand Up @@ -236,6 +245,7 @@
PreviouslySourceBuiltSourceName="$(PreviouslySourceBuiltNuGetSourceName)"
PrebuiltSourceName="$(PrebuiltNuGetSourceName)"
SourceBuiltSourceNamePrefix="$(SourceBuiltSourceNamePrefix)"
PreviousBuildPassSourceNamePrefix="$(PreviousBuildPassSourceNamePrefix)"
CustomSources="$(NetSdkSupportingFeedName)" />

<MakeDir Directories="$(BaseIntermediateOutputPath)" />
Expand Down
9 changes: 8 additions & 1 deletion src/SourceBuild/content/repo-projects/dotnet.proj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@
<RepositoryReference Include="sdk" />
</ItemGroup>

<ItemGroup Condition="'$(DotNetBuildPass)' == '2'">
<ItemGroup Condition="'$(DotNetBuildPass)' == '2' and '$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'x64'">
<!-- Building Windows Bundle Installers-->
<RepositoryReference Remove="@(RepositoryReference)" />
<RepositoryReference Include="sdk" DotNetBuildPass="2" />
</ItemGroup>

<ItemGroup Condition="'$(DotNetBuildPass)' == '2' and '$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'x86'">
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
<!-- Building the cross-OS DACs -->
<RepositoryReference Remove="@(RepositoryReference)" />
<RepositoryReference Include="runtime" DotNetBuildPass="2" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions src/SourceBuild/content/repo-projects/runtime.proj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

<BuildArgs Condition="'$(UseSystemLibs)' != ''">$(BuildArgs) /p:UseSystemLibs=$(UseSystemLibs)</BuildArgs>

<!-- When we're actually doing signing and the ESRP tool is available, forward down the path to the repo builds. -->
<BuildArgs Condition="'$(Sign)' == 'true' and '$(ForceDryRunSigning)' == '' and '$(DotNetEsrpToolPath)' != ''">$(BuildArgs) /p:DotNetEsrpToolPath=$(DotNetEsrpToolPath)</BuildArgs>
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved

<!-- Needed until https://github.com/dotnet/runtime/issues/109329 is fixed. -->
<BuildArgs>$(BuildArgs) /p:NetCoreAppToolCurrentVersion=10.0</BuildArgs>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class PackageSourceMappingsTests

private const string NetSdkSupportingFeedName = "net-sdk-supporting-feed";
private const string ArcadeSourceName = "source-built-arcade";
private const string RuntimeSourceName = "source-built-runtime";
private const string RuntimeSourceName = "previous-build-pass-runtime";
private const string PrebuiltSourceName = "prebuilt";
private const string PreviouslySourceBuiltSourceName = "previously-source-built";
private const string ReferencePackagesSourceName = "reference-packages";
Expand Down Expand Up @@ -89,6 +89,7 @@ private static void RunTest(string nugetConfigFilename, bool useOnlineFeeds, str
SbrpCacheSourceName = "source-build-reference-package-cache",
SbrpRepoSrcPath = TestSetup.SourceBuildReferencePackagesRepo,
SourceBuiltSourceNamePrefix = "source-built-",
PreviousBuildPassSourceNamePrefix = "previous-build-pass-",
NuGetConfigFile = modifiedNugetConfig,
BuildWithOnlineFeeds = useOnlineFeeds,
SourceBuildSources = sources,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<packageSources>
<clear />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="reference-packages" value="%reference-packages%" />
<add key="previously-source-built" value="%previously-source-built%" />
Expand All @@ -25,7 +25,7 @@
-->
<packageSourceMapping>
<clear />
<packageSource key="source-built-runtime">
<packageSource key="previous-build-pass-runtime">
<package pattern="runtime.package1" />
<package pattern="runtime.package2" />
</packageSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<packageSources>
<clear />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="reference-packages" value="%reference-packages%" />
<add key="previously-source-built" value="%previously-source-built%" />
Expand Down Expand Up @@ -38,7 +38,7 @@
-->
<packageSourceMapping>
<clear />
<packageSource key="source-built-runtime">
<packageSource key="previous-build-pass-runtime">
<package pattern="runtime.package1" />
<package pattern="runtime.package2" />
</packageSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<configuration>
<packageSources>
<clear />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="reference-packages" value="%reference-packages%" />
<add key="previously-source-built" value="%previously-source-built%" />
Expand All @@ -14,7 +14,7 @@
</disabledPackageSources>
<packageSourceMapping>
<clear />
<packageSource key="source-built-runtime">
<packageSource key="previous-build-pass-runtime">
<package pattern="runtime.package1" />
<package pattern="runtime.package2" />
</packageSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<configuration>
<packageSources>
<clear />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="reference-packages" value="%reference-packages%" />
<add key="previously-source-built" value="%previously-source-built%" />
Expand All @@ -17,7 +17,7 @@
</disabledPackageSources>
<packageSourceMapping>
<clear />
<packageSource key="source-built-runtime">
<packageSource key="previous-build-pass-runtime">
<package pattern="runtime.package1" />
<package pattern="runtime.package2" />
</packageSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<packageSources>
<clear />
<add key="net-sdk-supporting-feed" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<clear />
<packageSource key="source-built-runtime">
<packageSource key="previous-build-pass-runtime">
<package pattern="runtime.package1" />
<package pattern="runtime.package2" />
</packageSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<packageSources>
<clear />
<add key="net-sdk-supporting-feed" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
Expand All @@ -15,7 +15,7 @@
</disabledPackageSources>
<packageSourceMapping>
<clear />
<packageSource key="source-built-runtime">
<packageSource key="previous-build-pass-runtime">
<package pattern="runtime.package1" />
<package pattern="runtime.package2" />
</packageSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<packageSources>
<clear />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="reference-packages" value="%reference-packages%" />
<add key="previously-source-built" value="%previously-source-built%" />
Expand Down Expand Up @@ -133,4 +133,4 @@
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<packageSources>
<clear />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="reference-packages" value="%reference-packages%" />
<add key="previously-source-built" value="%previously-source-built%" />
Expand Down Expand Up @@ -146,4 +146,4 @@
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<configuration>
<packageSources>
<clear />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="reference-packages" value="%reference-packages%" />
<add key="previously-source-built" value="%previously-source-built%" />
Expand All @@ -12,4 +12,4 @@
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<configuration>
<packageSources>
<clear />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="reference-packages" value="%reference-packages%" />
<add key="previously-source-built" value="%previously-source-built%" />
Expand All @@ -15,4 +15,4 @@
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<packageSources>
<clear />
<add key="net-sdk-supporting-feed" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
Expand Down Expand Up @@ -37,4 +37,4 @@
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<packageSources>
<clear />
<add key="net-sdk-supporting-feed" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
<add key="source-built-runtime" value="%runtime%" />
<add key="previous-build-pass-runtime" value="%runtime%" />
<add key="source-built-arcade" value="%arcade%" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
Expand Down
Loading
Loading