Skip to content

Switch to new Microsoft.DotNet.SharedFramework.Sdk and refactor Host/Installer build subsets #38457

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

Merged
116 commits merged into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
ba14e1d
Start creating runtime, apphost, and targeting packs using the new SD…
jkoritzinsky Jun 24, 2020
6802ad1
Fix generation of runtime package, runtime symbols package, and host …
jkoritzinsky Jun 24, 2020
a36a296
Correcly include hosting files and DIA in the shared framework archiv…
jkoritzinsky Jun 24, 2020
c6f72c7
Include PackageOverrides.txt in the ref pack.
jkoritzinsky Jun 24, 2020
8757c50
Fix product brand prefix.
jkoritzinsky Jun 24, 2020
cbd46d2
Add the shared host installer.
jkoritzinsky Jun 25, 2020
db70570
Add the hostfxr build and clean up MacOS building.
jkoritzinsky Jun 25, 2020
7ad7304
Rename host and hostfxr projects to ensure we don't collide with the …
jkoritzinsky Jun 25, 2020
ece261c
Add bundle installer.
jkoritzinsky Jun 25, 2020
84ab2b0
Merge branch 'master' of https://github.com/dotnet/runtime into adopt…
jkoritzinsky Jun 25, 2020
0b54120
Update platform manifest entries to include linux/mac file variations…
jkoritzinsky Jun 25, 2020
290d0fa
Update apphost pack to match master.
jkoritzinsky Jun 25, 2020
2083c85
Fix typo
jkoritzinsky Jun 25, 2020
49fbab6
Include manpages and fix linux package properties.
jkoritzinsky Jun 25, 2020
0c9b00c
Fix linux package properties.
jkoritzinsky Jun 25, 2020
6dfa868
Match short-description from packages in master.
jkoritzinsky Jun 25, 2020
63cdc70
Update to uploaded package.
jkoritzinsky Jun 25, 2020
5c637d2
Update metadata and SDK to generate an exact match of the productbuil…
jkoritzinsky Jun 26, 2020
c8bd51e
First draft moving crossgen2 to new SDK.
jkoritzinsky Jul 13, 2020
890dc74
Get crossgen2 pack working with updated SDK.
jkoritzinsky Jul 15, 2020
5ef903f
Merge remote-tracking branch 'dotnet/master' into adopt-unified-sharedfx
jkoritzinsky Jul 15, 2020
98bb6c9
Build archives from the installer and bundle projects.
jkoritzinsky Jul 15, 2020
4a0ecf0
Move the dotnet-runtime-deps installers to use the new SDK.
jkoritzinsky Jul 15, 2020
3ac3696
Rough attempt to convert the build to use the new sfx sdk.
jkoritzinsky Jul 15, 2020
361e750
Remove now empty subsets.
jkoritzinsky Jul 16, 2020
13753c6
Update installer subsets for testing.
jkoritzinsky Jul 22, 2020
31fcde4
Remove non-existent packaging project from subsets.
jkoritzinsky Jul 22, 2020
6683b7a
Add missing Windows api shim dll to platform manifest.
jkoritzinsky Jul 22, 2020
7137375
Update sharedfx sdk.
jkoritzinsky Jul 22, 2020
f8d1fbe
Add both versions of the long-name dac to the platform manifest.
jkoritzinsky Jul 23, 2020
388711d
Skip builds for non-relevant components on Mono.
jkoritzinsky Jul 23, 2020
006a761
Remove installer tests by default temporarily to validate product build.
jkoritzinsky Jul 23, 2020
0fdcd70
Remove pkgprojs subset from mono installer build since it doesn't bui…
jkoritzinsky Jul 23, 2020
a118d3d
Skip the apphost pack on mono.
jkoritzinsky Jul 23, 2020
1d84487
Update host test infra to use the new sfx projects.
jkoritzinsky Jul 23, 2020
6752318
Delete an out of date test (the alternative case this test exercises …
jkoritzinsky Jul 23, 2020
ae145b3
Fix packaging tests and remove NETStandard packaging tests since we a…
jkoritzinsky Jul 23, 2020
e2e6624
Fixes for test official build failures. Re-eneable installer tests by…
jkoritzinsky Jul 23, 2020
54496ab
Fix condition for building linux installers.
jkoritzinsky Jul 23, 2020
0ce63ef
Exclude Mono header files from the deps.json. They don't need to be i…
jkoritzinsky Jul 24, 2020
2612fba
Don't include the host files on the sfxproj.
jkoritzinsky Jul 24, 2020
d2adc6c
Add mono-specific files to the platform manifest.
jkoritzinsky Jul 24, 2020
3d994ff
Remove extra copy step in installer job.
jkoritzinsky Jul 24, 2020
06d242b
Include libmonosgen-2.0.a in platform manifest.
jkoritzinsky Jul 24, 2020
90baa80
Fix change in linux-x64 test steps.
jkoritzinsky Jul 24, 2020
f5434af
Fix display name of linux package steps.
jkoritzinsky Jul 24, 2020
7b7526d
Build the installers based on the portable build when applicable so t…
jkoritzinsky Jul 24, 2020
1840af7
The installer build no longer consumes Microsoft.NETCore.Platforms an…
jkoritzinsky Jul 24, 2020
15026fb
Set PackageBrandNameSuffix for runtime-deps packages.
jkoritzinsky Jul 25, 2020
442fed4
Updated sharedfx sdk
jkoritzinsky Jul 27, 2020
a2cdf87
Fix debian runtime-deps dependency elements.
jkoritzinsky Jul 30, 2020
d9838ff
Merge branch 'master' of https://github.com/dotnet/runtime into adopt…
jkoritzinsky Jul 30, 2020
2f6d892
Add new platform manifest entries.
jkoritzinsky Jul 30, 2020
b97b134
Add icudt.dat to the platform manifest.
jkoritzinsky Jul 30, 2020
c9597c4
Invert conditions to correctly skip generating installers on non-appl…
jkoritzinsky Jul 30, 2020
af5bcc8
Merge branch 'adopt-unified-sharedfx-official-build-test' of /mnt/d/s…
jkoritzinsky Jul 30, 2020
f521759
Create extra installer subset so we can build just the installers (an…
jkoritzinsky Jul 31, 2020
4c5828d
Fix Crossgen2 package name.
jkoritzinsky Jul 31, 2020
dd86d7f
Merge branch 'master' into adopt-unified-sharedfx
jkoritzinsky Jul 31, 2020
d26bad7
Clean up some dead MSBuild goo and update the sharedfx package so we …
jkoritzinsky Jul 31, 2020
494d9bd
Update SharedFX SDK.
jkoritzinsky Aug 3, 2020
cf95aa7
Merge branch 'master' into adopt-unified-sharedfx
jkoritzinsky Aug 3, 2020
d23d093
Fix discovery of the built dotnet layout for installer tests. Clean u…
jkoritzinsky Aug 3, 2020
9c54206
Update to use the new refactored packages.
jkoritzinsky Aug 5, 2020
160a2dd
Fix macOS build failures.
jkoritzinsky Aug 5, 2020
1a35bcc
Fix linux installer build.
jkoritzinsky Aug 5, 2020
4479907
Upgrade to newest version of the SDK and centrally manage versions.
jkoritzinsky Aug 5, 2020
a65d4c8
Merge branch 'master' of https://github.com/dotnet/runtime into adopt…
jkoritzinsky Aug 6, 2020
b4804c8
Update SDK to fix build skipping for the shared framework sdk.
jkoritzinsky Aug 6, 2020
d6be480
Update SDK with full fix for skipbuild with packaging.
jkoritzinsky Aug 6, 2020
6f9b6d5
Another try for fixing the build-skip infra.
jkoritzinsky Aug 6, 2020
78849bf
Upgrade SDK.
jkoritzinsky Aug 6, 2020
9b3bb51
Fix package ids for mono packages.
jkoritzinsky Aug 7, 2020
d0f5313
Fix installer tests after update.
jkoritzinsky Aug 7, 2020
8fe251c
Add System.Private.Runtime.InteropServices.Javascript.dll to platform…
jkoritzinsky Aug 10, 2020
29f38aa
Merge branch 'master' of https://github.com/dotnet/runtime into adopt…
jkoritzinsky Aug 20, 2020
1a71e7b
Fix Crossgen2 package to place all files in the tools folder.
jkoritzinsky Aug 20, 2020
33407b5
Update to SDK with validation targets.
jkoritzinsky Aug 22, 2020
a87e9a1
Add new ICU files to manifest.
jkoritzinsky Aug 24, 2020
7fe5c8e
Crossgen2 doesn't need to go through framework resolution so we can p…
jkoritzinsky Aug 24, 2020
a63c911
Put the property in a property group.
jkoritzinsky Aug 24, 2020
14e80f4
Merge branch 'master' of https://github.com/dotnet/runtime into adopt…
jkoritzinsky Aug 26, 2020
160bf5d
Ensure we build corehost before sfx since we no longer directly build…
jkoritzinsky Aug 26, 2020
ac5ce6c
Add missing entry for additional ICU data file.
jkoritzinsky Aug 26, 2020
299745d
Remove step downloading all artifacts and remove MSBuild glue to hook…
jkoritzinsky Aug 26, 2020
642e0f4
Merge branch 'master' into adopt-unified-sharedfx
jkoritzinsky Sep 15, 2020
faf52ec
Update SDK
jkoritzinsky Sep 15, 2020
a589182
Update SDK to get MSI fix.
jkoritzinsky Sep 15, 2020
6ee0569
Merge branch 'master' into adopt-unified-sharedfx
jkoritzinsky Sep 16, 2020
9e4ce3c
Don't even try building the hosting, crossgen2, or bundle installers …
jkoritzinsky Sep 16, 2020
1f34d31
Remove out of date comment.
jkoritzinsky Sep 16, 2020
1bd45aa
Merge branch 'master' of github.com:dotnet/runtime into adopt-unified…
jkoritzinsky Oct 29, 2020
829d01a
Rename subsets based on PR discussion.
jkoritzinsky Oct 29, 2020
a72bc60
Update platform manifest and fix path to 3rd party notices for instal…
jkoritzinsky Oct 29, 2020
55d36ba
Remove test feed.
jkoritzinsky Oct 30, 2020
dbf59d7
Update subset references I missed.
jkoritzinsky Oct 30, 2020
3b60cad
Merge branch 'master' of github.com:dotnet/runtime into adopt-unified…
jkoritzinsky Oct 30, 2020
3027275
Fixed the subset arguments in other yaml files.
jkoritzinsky Oct 30, 2020
220044f
Merge branch 'master' of github.com:dotnet/runtime into adopt-unified…
jkoritzinsky Nov 3, 2020
aafd6b1
Merge branch 'master' of github.com:dotnet/runtime into adopt-unified…
jkoritzinsky Nov 4, 2020
75a3c72
Add NuGet metadata to packs.
jkoritzinsky Nov 6, 2020
417f0d6
Add diagnostics-specific incremental signing in CoreCLR when the file…
jkoritzinsky Nov 9, 2020
77cf013
Pass sign type to job.
jkoritzinsky Nov 10, 2020
acf1a04
Merge branch 'master' of github.com:dotnet/runtime into adopt-unified…
jkoritzinsky Nov 10, 2020
e2f5cb7
Merge branch 'master' into adopt-unified-sharedfx
jkoritzinsky Nov 10, 2020
68909e2
Add new WASM files.
jkoritzinsky Nov 10, 2020
147aec4
Merge branch 'master' of github.com:dotnet/runtime into adopt-unified…
jkoritzinsky Nov 10, 2020
152cf0e
Enable static graph restore for the whole repo
jkoritzinsky Nov 11, 2020
3ac62de
Fix nits
jkoritzinsky Nov 11, 2020
590d95d
Add back the runtime-deps packages. They were lost when we moved away…
jkoritzinsky Nov 11, 2020
e7bdc72
Don't disable NuGet static graph restore.
jkoritzinsky Nov 11, 2020
454214d
Merge branch 'master' of github.com:dotnet/runtime into adopt-unified…
jkoritzinsky Nov 11, 2020
e111c6e
Make sure we sign the cross-arch same-os DAC
jkoritzinsky Nov 11, 2020
f931142
Update installers package.
jkoritzinsky Nov 12, 2020
7be2e3b
Update Installers package from arcade
ViktorHofer Nov 12, 2020
e36639b
Update installers package.
jkoritzinsky Nov 12, 2020
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
18 changes: 0 additions & 18 deletions Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@
<ProjectReference Include="@(ProjectToBuild)" />
</ItemGroup>

<!--
Exclude installer depproj and pkgproj from static graph restore. We restore them below.
Remove when https://github.com/NuGet/Home/issues/9398 is fixed.
-->
<ItemGroup Condition="'$(MSBuildRestoreSessionId)' != ''">
<ProjectReference Remove="@(DepprojProjectToBuild)" />
<ProjectReference Remove="@(PkgprojProjectToBuild)" />
<ProjectReference Remove="@(BundleProjectToBuild)" />
</ItemGroup>

<!-- Custom arcade target which isn't available in Microsoft.Build.Traversal. -->
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />

Expand All @@ -36,12 +26,4 @@
<MSBuild Projects="$(RepoTasksDir)tasks.proj"
Targets="BuildAndRestoreIncrementally"/>
</Target>

<Target Name="RestoreWithoutStaticGraph"
BeforeTargets="Restore">
<MSBuild Projects="@(DepprojProjectToBuild);@(PkgprojProjectToBuild);@(BundleProjectToBuild)"
Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid());RestoreUseStaticGraphEvaluation=false"
Targets="Restore" />
</Target>

</Project>
156 changes: 29 additions & 127 deletions eng/Signing.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<Project InitialTargets="SetupFilesToSign">

<!-- If this file was pulled in via prepare-artifacts.proj (a non-SDK project, these files are already
imported. -->
Expand All @@ -12,7 +12,7 @@

During post build signing, there are no packages to sign during SignFinalPackages.
-->
<AllowEmptySignList Condition="'$(SignFinalPackages)' != 'true' or '$(PostBuildSign)' == 'true'">true</AllowEmptySignList>
<AllowEmptySignList>true</AllowEmptySignList>
</PropertyGroup>

<ItemGroup>
Expand All @@ -22,10 +22,6 @@
-->
<ItemsToSign Remove="@(ItemsToSign)" />

<!-- Find bundle artifacts, which need multiple stages to fully sign. -->
<BundleInstallerEngineArtifact Include="$(ArtifactsPackagesDir)**/*engine.exe" />
<BundleInstallerExeArtifact Include="$(ArtifactsPackagesDir)**/*.exe" />

<!-- apphost and comhost template files are not signed, by design. -->
<FileSignInfo Include="apphost.exe;singlefilehost.exe;comhost.dll" CertificateName="None" />

Expand All @@ -49,126 +45,32 @@
<FileExtensionSignInfo Include=".deb;.rpm" CertificateName="LinuxSign" />
</ItemGroup>

<!-- When doing post build signing, the file containers (e.g. nupkg, msi, etc.) are
processed for signing (opened up, individually signed, etc.) and these individual ItemsToSign
elements are unnecessary. When signing within the build, we need to individually process
dll's, exes, etc. that go into msi's because these containers are not able to be processed
by SignTool after they are packed up. What makes this possible for post build signing
is that the build will produce a zip file containing the inputs to the Wix light linker
which can be used to create the installer later, after the inputs have been signed and replaced. -->
<Choose>
<When Condition="'$(PostBuildSign)' != 'true'">
<ItemGroup Condition="'$(SignBinaries)' == 'true'">
<!-- Sign CoreCLR. -->
<ItemsToSign Include="$(CoreCLRSharedFrameworkDir)*.dll" />
<ItemsToSign Include="$(CoreCLRSharedFrameworkDir)*.exe" />

<ItemsToSign Include="$(CoreCLRArtifactsPath)System.Private.CoreLib.dll" />

<ItemsToSign Include="$(CoreCLRCrossgen2Dir)crossgen2.exe" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)crossgen2.dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.DependencyAnalysisFramework.dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.ReadyToRun.dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.TypeSystem.ReadyToRun.dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)jitinterface_$(TargetArchitecture).dll" />

<ItemsToSign Include="$(CoreCLRCrossgen2Dir)clrjit_win_x86_$(TargetArchitecture).dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)clrjit_win_arm_$(TargetArchitecture).dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)clrjit_unix_arm_$(TargetArchitecture).dll" />
<ItemsToSign Condition="'$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'x64'" Include="$(CoreCLRCrossgen2Dir)clrjit_win_x64_$(TargetArchitecture).dll" />
<ItemsToSign Condition="'$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'x64'" Include="$(CoreCLRCrossgen2Dir)clrjit_win_arm64_$(TargetArchitecture).dll" />
<ItemsToSign Condition="'$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'x64'" Include="$(CoreCLRCrossgen2Dir)clrjit_unix_x64_$(TargetArchitecture).dll" />
<ItemsToSign Condition="'$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'x64'" Include="$(CoreCLRCrossgen2Dir)clrjit_unix_arm64_$(TargetArchitecture).dll" />

<ItemsToSign Include="$(CoreCLRArtifactsPath)$(CoreCLRCrossTargetComponentDirName)/sharedFramework/*.dll" Condition="'$(CoreCLRCrossTargetComponentDirName)' != ''" />
<ItemsToSign Include="$(CoreCLRArtifactsPath)$(CoreCLRCrossTargetComponentDirName)/sharedFramework/*.exe" Condition="'$(CoreCLRCrossTargetComponentDirName)' != ''" />

<!-- Sign api-ms-win-core-xstate-l2-1-0 binary as it is only catalog signed in the current SDK. -->
<ItemsToSign
Condition="'$(Configuration)' == 'Release' and '$(TargetArchitecture)' == 'x86'"
Include="$(CoreCLRArtifactsPath)Redist\ucrt\DLLs\$(TargetArchitecture)\api-ms-win-core-xstate-l2-1-0.dll" />

<!-- Sign libraries. -->
<ItemsToSign Include="$(LibrariesNativeArtifactsPath)*.dll" />
<ItemsToSign Include="$(LibrariesSharedFrameworkRefArtifactsPath)*.dll" />
<!-- Most runtime artifacts will be crossgenned, so sign them post-crossgen. mscorlib isn't. -->
<ItemsToSign Include="$(LibrariesSharedFrameworkBinArtifactsPath)mscorlib.dll" />

<!-- Sign the host. -->
<ItemsToSign Include="$(BaseOutputRootPath)corehost/**/hostfxr.dll" />
<ItemsToSign Include="$(BaseOutputRootPath)corehost/**/hostpolicy.dll" />
<ItemsToSign Include="$(BaseOutputRootPath)corehost/**/dotnet.exe" />
<ItemsToSign Include="$(BaseOutputRootPath)corehost/**/ijwhost.dll" />
<ItemsToSign Include="$(BaseOutputRootPath)corehost/**/nethost.dll" />

<!-- Sign managed libraries in installer subset. -->
<ItemsToSign Include="$(ArtifactsBinDir)Microsoft.NET.HostModel/**/*.dll" />
</ItemGroup>

<!-- Sign ready-to-run binaries after crossgen is applied. -->
<ItemGroup Condition="'$(SignR2RBinaries)' == 'true'">
<ItemsToSign Include="$(CrossGenRootPath)**/*.dll" />
</ItemGroup>

<ItemGroup Condition="'$(SignMsiFiles)' == 'true'">
<ItemsToSign Include="$(ArtifactsPackagesDir)**/*.msi" />
<ItemsToSign Include="$(ArtifactsPackagesDir)**/*.cab" />
</ItemGroup>

<ItemGroup Condition="'$(SignBurnEngineFiles)' == 'true'">
<ItemsToSign Include="@(BundleInstallerEngineArtifact)" />
</ItemGroup>

<ItemGroup Condition="'$(SignBurnBundleFiles)' == 'true'">
<!-- Sign the bundles, now that the engine is reattached. Avoid re-signing the engine. -->
<ItemsToSign
Include="@(BundleInstallerExeArtifact)"
Exclude="@(BundleInstallerEngineArtifact)" />
<!-- Note: wixstdba is internal to the engine bundle and does not get signed. -->
</ItemGroup>

<ItemGroup Condition="'$(SignFinalPackages)' == 'true'">
<DownloadedSymbolPackages Include="$(DownloadDirectory)**\*.symbols.nupkg" />
<ItemsToSign Include="$(DownloadDirectory)**\*.nupkg" Exclude="@(DownloadedSymbolPackages)" />

<!-- The cross OS diagnostics symbol packages need to be signed as they are the only packages
that have a specific version of assets that are only meant to be indexed in symbol servers.
Since only *symbols.nupkg get indexed, and installer doesn't produce these, we need to glob them for signing. -->
<ItemsToSign Include="$(DownloadDirectory)**\*CrossOsDiag*.symbols.nupkg" />

<ItemsToSign Include="$(DownloadDirectory)**\*.deb" />
<ItemsToSign Include="$(DownloadDirectory)**\*.rpm" />
</ItemGroup>
</When>

<!-- When doing post build signing, we sign all artifacts we would push.
Symbol packages are included too. -->
<When Condition="'$(PostBuildSign)' == 'true'">
<ItemGroup>
<ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.msi" Condition="'$(PrepareArtifacts)' == 'true'" />
<ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.exe" Condition="'$(PrepareArtifacts)' == 'true'" />
<ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.nupkg" Condition="'$(PrepareArtifacts)' == 'true'" />
<ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.zip" Condition="'$(PrepareArtifacts)' == 'true'" />

<ItemsToSignWithoutPaths Include="@(ItemsToSignWithPaths->'%(Filename)%(Extension)')" />
<ItemsToSignPostBuild Include="@(ItemsToSignWithoutPaths->Distinct())" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkoritzinsky This PR removed this line, which will break post build signing. Post build signing breaks signing into two categories:

ItemsToSign and ItemsToSignPostBuild. ItemsToSign corresponds to those items that should always be signed during the build (when PostBuildSign is true or false), and ItemsToSignPostBuild should contain items to sign in post build, only if PostBuildSign = true.

The use of target should be unnecessary.

/cc @ViktorHofer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that you will only need the setup for ItemGroupsWhen PostBuildSign=true. This does not need to be done in a target.

https://github.com/dotnet/runtime/pull/38457/files#diff-a923a7746e08ef5df4bfd49f340d9f93055d66ba792770a7e1c227b3eaf3d4efL146-L154

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shoot. I’ll put out a PR to add back this item group.

</ItemGroup>

<!-- Even when doing post build signing, sign mscordaccore*.dll and mscordbi.dll -->
<ItemGroup Condition="'$(SignBinaries)' == 'true'">
<ItemsToSign Include="$(CoreCLRSharedFrameworkDir)mscordaccore*.dll" />
<ItemsToSign Include="$(CoreCLRSharedFrameworkDir)mscordbi.dll" />
<ItemsToSign Include="$(CoreCLRArtifactsPath)$(CoreCLRCrossTargetComponentDirName)/sharedFramework/mscordaccore*.dll" Condition="'$(CoreCLRCrossTargetComponentDirName)' != ''" />
<ItemsToSign Include="$(CoreCLRArtifactsPath)$(CoreCLRCrossTargetComponentDirName)/sharedFramework/mscordbi.dll" Condition="'$(CoreCLRCrossTargetComponentDirName)' != ''" />
</ItemGroup>

<ItemGroup Condition="'$(SignFinalPackages)' == 'true'">
<!-- The cross OS diagnostics symbol packages need to be signed as they are the only packages
that have a specific version of assets that are only meant to be indexed in symbol servers.
Since only *symbols.nupkg get indexed, and installer doesn't produce these, we need to glob them for signing. -->
<ItemsToSign Include="$(DownloadDirectory)**\*CrossOsDiag*.nupkg" />
</ItemGroup>
</When>
</Choose>
<Target Name="SetupFilesToSign">
<!-- Ensure that we don't miss the DAC or DBI with the globbing below -->
<PropertyGroup Condition="'$(SignDiagnostics)' == 'true'">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say before getting this in we need to merge mmitche's changes and verify. His changes remove the target and a bunch of these operations won't play well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve already validated that these changes work and sign the files correctly. This can replace the SignBinaries group in mmitche’s PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this work outside a target though?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could if L55 would use the WithMetadataValue item function to check on filename but I doubt it's worth changing it now that Jeremy already did the validation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed during standup, since we're just using globs and not using the version variables that Arcade updates, we can use this inside of an InitialTargets target if need be to ensure that we correctly sign the short name DAC, long name DAC, and DBI.

<AllowEmptySignList>false</AllowEmptySignList>
</PropertyGroup>

<ItemGroup Condition="'$(SignDiagnostics)' == 'true'">
<ItemsToSign Include="$(DiagnosticsFilesRoot)/**/mscordaccore*.dll" />
<ItemsToSign Include="$(DiagnosticsFilesRoot)/**/mscordbi.dll" />
<!--
The DAC should be signed with the SHA2 cert (both long and short name).
We already add the short-name DAC above, so add the long-name DAC here.
-->
<DacFileSignInfo Include="@(ItemsToSign->'%(FileName)%(Extension)')"
Condition="$([System.String]::new('%(FileName)').StartsWith('mscordaccore'))" />
<FileSignInfo Include="@(DacFileSignInfo->ClearMetadata()->Distinct())"
Exclude="mscordaccore.dll"
CertificateName="MicrosoftSHA2" />
</ItemGroup>

<ItemGroup Condition="'$(SignFinalPackages)' == 'true'">
<!-- The cross OS diagnostics symbol packages need to be signed as they are the only packages
that have a specific version of assets that are only meant to be indexed in symbol servers.
Since only *symbols.nupkg get indexed, and installer doesn't produce these, we need to glob them for signing. -->
<ItemsToSign Include="$(DownloadDirectory)**\*CrossOsDiag*.nupkg" />
</ItemGroup>
</Target>

</Project>
Loading