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

Deduplicate assets produced on multiple build legs in the VMR to only be produced on the 'primary' build leg #60792

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
17 changes: 12 additions & 5 deletions eng/Publishing.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@
'$(PostBuildSign)' != 'true' and
'$(DotNetBuildRepo)' != 'true'">false</EnableDefaultArtifacts>

<PublishInstallerBaseVersion Condition="'$(PublishInstallerBaseVersion)' == '' and
('$(OS)' == 'Windows_NT' or '$(DotNetBuildOrchestrator)' == 'true')">true</PublishInstallerBaseVersion>
<!-- This avoids creating VS.*.symbols.nupkg packages that are identical to the original package. -->
<AutoGenerateSymbolPackages>false</AutoGenerateSymbolPackages>
<!--
Some assets are produced in all jobs, but only one job can publish them. We follow the following rules in that case:
- If we're building outside of the VMR, publish these assets from the Windows job.
- If we're building inside the VMR, publish these assets from whichever job is producing non-RID-specific artifacts.
-->
<PublishAllBuildsAssetsInThisJob Condition="('$(OS)' == 'Windows_NT' and '$(DotNetBuildOrchestrator)' != 'true')
Copy link
Member

Choose a reason for hiding this comment

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

Have we considered that some npm packages using gyp stuff (native libs) are platform specific? In a long dependency chain, chances of such an npm cannot be ignored.

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 far as I know, ASP.NET Core has been shipping the npms from their Windows build for years now and there hasn't been an issue. If one arises, then we can address this problem.

or ('$(DotNetBuildOrchestrator)' == 'true' and '$(EnableDefaultRidSpecificArtifacts)' != 'true'
and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1'))">true</PublishAllBuildsAssetsInThisJob>
<PublishInstallerBaseVersion Condition="'$(PublishInstallerBaseVersion)' == ''">$(PublishAllBuildsAssetsInThisJob)</PublishInstallerBaseVersion>
</PropertyGroup>

<!-- $(InstallersOutputPath), $(SymbolsOutputPath), and $(ChecksumExtensions) are not defined. Root Directory.Build.props is not imported. -->
Expand All @@ -24,10 +31,10 @@
<FilesToPublishToSymbolServer Include="$(ArtifactsDir)symbols\**\*.pdb" />

<!-- Prepare for _PublishInstallersAndChecksums target. -->
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.jar" UploadPathSegment="jar" />
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.pom" UploadPathSegment="jar" />
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.jar" UploadPathSegment="jar" Condition="'$(PublishAllBuildsAssetsInThisJob)' == 'true'" />
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.pom" UploadPathSegment="jar" Condition="'$(PublishAllBuildsAssetsInThisJob)' == 'true'" />
<!-- All builds produce npm assets - only publish them once -->
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.tgz" UploadPathSegment="npm" Condition="'$(OS)' == 'Windows_NT' or '$(DotNetBuildOrchestrator)' == 'true'" />
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.tgz" UploadPathSegment="npm" Condition="'$(PublishAllBuildsAssetsInThisJob)' == 'true'" />
<_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.version" UploadPathSegment="Runtime" Condition="'$(PublishInstallerBaseVersion)' == 'true'" />

<!-- The following installers create checksums -->
Expand Down
Loading