Skip to content

Commit e75238b

Browse files
authored
Avoid hardcoded path to VMR orchestrator package layout (#47140)
1 parent 36986ce commit e75238b

File tree

3 files changed

+74
-68
lines changed

3 files changed

+74
-68
lines changed

src/Installer/redist-installer/Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
$(Rid.StartsWith('linux-musl'))
3939
)">true</SkipBuildingInstallers>
4040

41+
<BundleRuntimePacks Condition="'$(BundleRuntimePacks)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">true</BundleRuntimePacks>
42+
<BundleNativeAotCompiler Condition="'$(BundleNativeAotCompiler)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildUseMonoRuntime)' != 'true'">true</BundleNativeAotCompiler>
43+
4144
<!-- Use the portable "linux-x64" Rid when downloading Linux shared framework compressed file. -->
4245
<UsePortableLinuxSharedFramework Condition="'$(UsePortableLinuxSharedFramework)' == '' AND '$(IsLinux)' == 'true' AND !$(Rid.StartsWith('linux-musl'))">true</UsePortableLinuxSharedFramework>
4346
<HighEntropyVA>true</HighEntropyVA>

src/Installer/redist-installer/redist-installer.proj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
<PropertyGroup>
44
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
55
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
6-
<BundleRuntimePacks Condition="'$(BundleRuntimePacks)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">true</BundleRuntimePacks>
7-
<!-- DotNetBuildOrchestrator is (currently) needed in order to obtain NuGet packages from the runtime build. -->
8-
<BundleNativeAotCompiler Condition="'$(BundleNativeAotCompiler)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildUseMonoRuntime)' != 'true' and '$(DotNetBuildOrchestrator)' == 'true'">true</BundleNativeAotCompiler>
96
<IsShippingPackage>true</IsShippingPackage>
107
</PropertyGroup>
118

src/Installer/redist-installer/targets/GenerateLayout.targets

Lines changed: 71 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -75,54 +75,63 @@
7575

7676
<!-- BEGIN: Bundled layout packages -->
7777
<ItemGroup>
78-
<BundledLayoutPackage Include="MicrosoftNetCoreAppTargetingPackNupkg">
79-
<PackageName>Microsoft.NETCore.App.Ref</PackageName>
80-
<PackageVersion>$(MicrosoftNETCoreAppRefPackageVersion)</PackageVersion>
81-
<RelativeLayoutPath>packs/%(PackageName)/%(PackageVersion)</RelativeLayoutPath>
82-
</BundledLayoutPackage>
83-
84-
<BundledLayoutPackage Include="MicrosoftNetStandardTargetingPackNupkg">
85-
<PackageName>NETStandard.Library.Ref</PackageName>
86-
<PackageVersion>$(NETStandardLibraryRefPackageVersion)</PackageVersion>
87-
<RelativeLayoutPath>packs/%(PackageName)/%(PackageVersion)</RelativeLayoutPath>
88-
</BundledLayoutPackage>
89-
90-
<BundledLayoutPackage Include="MicrosoftAspNetCoreAppTargetingPackNupkg">
91-
<PackageName>Microsoft.AspNetCore.App.Ref</PackageName>
92-
<PackageVersion>$(MicrosoftAspNetCoreAppRefPackageVersion)</PackageVersion>
93-
<RelativeLayoutPath>packs/%(PackageName)/%(PackageVersion)</RelativeLayoutPath>
94-
</BundledLayoutPackage>
95-
96-
<BundledLayoutPackage Include="MicrosoftNetCoreAppHostPackNupkg">
97-
<PackageName>Microsoft.NETCore.App.Host.$(SharedFrameworkRid)</PackageName>
98-
<PackageVersion>$(MicrosoftNETCoreAppHostPackageVersion)</PackageVersion>
99-
<RelativeLayoutPath>packs/%(PackageName)/%(PackageVersion)</RelativeLayoutPath>
100-
</BundledLayoutPackage>
101-
102-
<BundledLayoutPackage Include="MicrosoftNetCoreAppRuntimePackNupkg" Condition="'$(BundleRuntimePacks)' == 'true'">
103-
<PackageName>Microsoft.NETCore.App.Runtime.$(SharedFrameworkRid)</PackageName>
104-
<PackageVersion>$(MicrosoftNETCoreAppRuntimePackageVersion)</PackageVersion>
105-
<RelativeLayoutPath>packs/%(PackageName)/%(PackageVersion)</RelativeLayoutPath>
106-
</BundledLayoutPackage>
107-
108-
<BundledLayoutPackage Include="MicrosoftAspNetCoreAppRuntimePackNupkg" Condition="'$(BundleRuntimePacks)' == 'true'">
109-
<PackageName>Microsoft.AspNetCore.App.Runtime.$(SharedFrameworkRid)</PackageName>
110-
<PackageVersion>$(MicrosoftAspNetCoreAppRuntimePackageVersion)</PackageVersion>
111-
<RelativeLayoutPath>packs/%(PackageName)/%(PackageVersion)</RelativeLayoutPath>
112-
</BundledLayoutPackage>
113-
114-
<BundledLayoutPackage Include="MicrosoftDotNetILCompilerPackNupkg" Condition="'$(BundleNativeAotCompiler)' == 'true'">
115-
<PackageName>runtime.$(SharedFrameworkRid).Microsoft.DotNet.ILCompiler</PackageName>
116-
<PackageVersion>$(MicrosoftNETCoreAppRuntimePackageVersion)</PackageVersion>
117-
<RelativeLayoutPath>packs/%(PackageName)/%(PackageVersion)</RelativeLayoutPath>
118-
</BundledLayoutPackage>
119-
120-
<BundledLayoutPackage Include="MicrosoftWindowsDesktopAppTargetingPackNupkg"
121-
Condition="'$(IncludeWpfAndWinForms)' != 'false'">
122-
<PackageName>Microsoft.WindowsDesktop.App.Ref</PackageName>
123-
<PackageVersion>$(MicrosoftWindowsDesktopAppRefPackageVersion)</PackageVersion>
124-
<RelativeLayoutPath>packs/%(PackageName)/%(PackageVersion)</RelativeLayoutPath>
125-
</BundledLayoutPackage>
78+
<BundledLayoutPackage Include="Microsoft.NETCore.App.Ref"
79+
PackageName="Microsoft.NETCore.App.Ref"
80+
PackageVersion="$(MicrosoftNETCoreAppRefPackageVersion)"
81+
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />
82+
83+
<BundledLayoutPackage Include="NETStandard.Library.Ref"
84+
PackageName="NETStandard.Library.Ref"
85+
PackageVersion="$(NETStandardLibraryRefPackageVersion)"
86+
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />
87+
88+
<BundledLayoutPackage Include="Microsoft.AspNetCore.App.Ref"
89+
PackageName="Microsoft.AspNetCore.App.Ref"
90+
PackageVersion="$(MicrosoftAspNetCoreAppRefPackageVersion)"
91+
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />
92+
93+
<BundledLayoutPackage Include="Microsoft.NETCore.App.Host.$(SharedFrameworkRid)"
94+
PackageName="Microsoft.NETCore.App.Host.$(SharedFrameworkRid)"
95+
PackageVersion="$(MicrosoftNETCoreAppHostPackageVersion)"
96+
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />
97+
98+
<BundledLayoutPackage Include="Microsoft.NETCore.App.Runtime.$(SharedFrameworkRid)"
99+
PackageName="Microsoft.NETCore.App.Runtime.$(SharedFrameworkRid)"
100+
Condition="'$(BundleRuntimePacks)' == 'true'"
101+
PackageVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"
102+
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />
103+
104+
<BundledLayoutPackage Include="Microsoft.AspNetCore.App.Runtime.$(SharedFrameworkRid)"
105+
PackageName="Microsoft.AspNetCore.App.Runtime.$(SharedFrameworkRid)"
106+
Condition="'$(BundleRuntimePacks)' == 'true'"
107+
PackageVersion="$(MicrosoftAspNetCoreAppRuntimePackageVersion)"
108+
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />
109+
110+
<BundledLayoutPackage Include="Microsoft.WindowsDesktop.App.Ref"
111+
PackageName="Microsoft.WindowsDesktop.App.Ref"
112+
Condition="'$(IncludeWpfAndWinForms)' != 'false'"
113+
PackageVersion="$(MicrosoftWindowsDesktopAppRefPackageVersion)"
114+
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />
115+
116+
<BundledLayoutPackage Include="runtime.$(SharedFrameworkRid).Microsoft.DotNet.ILCompiler"
117+
Condition="'$(BundleNativeAotCompiler)' == 'true'"
118+
PackageName="runtime.$(SharedFrameworkRid).Microsoft.DotNet.ILCompiler"
119+
PackageVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"
120+
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />
121+
122+
<BundledLayoutPackage Include="Microsoft.DotNet.ILCompiler"
123+
Condition="'$(BundleNativeAotCompiler)' == 'true'"
124+
PackageName="Microsoft.DotNet.ILCompiler"
125+
PackageVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"
126+
RelativeLayoutPath="library-packs"
127+
SkipExtractPackage="true" />
128+
129+
<BundledLayoutPackage Include="Microsoft.NET.ILLink.Tasks"
130+
Condition="'$(BundleNativeAotCompiler)' == 'true'"
131+
PackageName="Microsoft.NET.ILLink.Tasks"
132+
PackageVersion="$(MicrosoftNETILLinkTasksPackageVersion)"
133+
RelativeLayoutPath="library-packs"
134+
SkipExtractPackage="true" />
126135
</ItemGroup>
127136
<!-- END: Bundled layout packages -->
128137

@@ -330,42 +339,39 @@
330339
<LoweredPackageName>$([MSBuild]::ValueOrDefault('%(BundledLayoutPackage.PackageName)', '').ToLowerInvariant())</LoweredPackageName>
331340
</BundledLayoutPackage>
332341

333-
<BundledLayoutPackageDownloadFiles Include="$(NuGetPackageRoot)\%(BundledLayoutPackage.LoweredPackageName)\%(BundledLayoutPackage.PackageVersion)\**\*.*">
342+
<!-- Remove files from the root of the package, as these are either files NuGet writes, or not necessary -->
343+
<BundledLayoutPackageDownloadFiles Include="$(NuGetPackageRoot)\%(BundledLayoutPackage.LoweredPackageName)\%(BundledLayoutPackage.PackageVersion)\**\*.*"
344+
Exclude="$(NuGetPackageRoot)\%(BundledLayoutPackage.LoweredPackageName)\%(BundledLayoutPackage.PackageVersion)\*.*"
345+
Condition="%(BundledLayoutPackage.SkipExtractPackage) != 'true'">
334346
<RelativeLayoutPath>%(BundledLayoutPackage.RelativeLayoutPath)</RelativeLayoutPath>
335347
<LayoutPackageDescription>%(BundledLayoutPackage.Identity)</LayoutPackageDescription>
336348
</BundledLayoutPackageDownloadFiles>
337349

338-
<!-- Remove files from the root of the package, as these are either files NuGet writes, or not necessary -->
339-
<BundledLayoutPackageDownloadFiles Remove="$(NuGetPackageRoot)\%(BundledLayoutPackage.LoweredPackageName)\%(BundledLayoutPackage.PackageVersion)\*.*" />
340-
341350
<!-- Set destination path in layout -->
342351
<BundledLayoutPackageDownloadFiles>
343352
<DestinationPath>%(BundledLayoutPackageDownloadFiles.RecursiveDir)%(BundledLayoutPackageDownloadFiles.Filename)%(BundledLayoutPackageDownloadFiles.Extension)</DestinationPath>
344353
</BundledLayoutPackageDownloadFiles>
345354
<BundledLayoutPackageDownloadFiles>
346-
<DestinationPath>$(RedistLayoutPath)/%(BundledLayoutPackageDownloadFiles.RelativeLayoutPath)/%(BundledLayoutPackageDownloadFiles.DestinationPath)</DestinationPath>
355+
<DestinationPath>$(RedistLayoutPath)%(BundledLayoutPackageDownloadFiles.RelativeLayoutPath)/%(BundledLayoutPackageDownloadFiles.DestinationPath)</DestinationPath>
347356
</BundledLayoutPackageDownloadFiles>
348357
<BundledLayoutPackageDownloadFiles>
349358
<DestinationPath>$([MSBuild]::NormalizePath(%(BundledLayoutPackageDownloadFiles.DestinationPath)))</DestinationPath>
350359
</BundledLayoutPackageDownloadFiles>
351360

352-
<!-- Creating a new item here isn't strictly necessary, but makes it easier to see what's going on in the .binlog,
353-
since the metadata updates don't show up there -->
354361
<BundledLayoutPackageDownloadFilesWithDestination Include="@(BundledLayoutPackageDownloadFiles)" />
355362
</ItemGroup>
356363

357-
<Copy SourceFiles="@(BundledLayoutPackageDownloadFilesWithDestination)"
358-
DestinationFiles="@(BundledLayoutPackageDownloadFilesWithDestination->'%(DestinationPath)')"
359-
SkipUnchangedFiles="true" />
360-
361-
<ItemGroup>
362-
<BundledLayoutLibraryPackage Include="$(SourceBuiltShippingPackagesDir)/../runtime/Microsoft.DotNet.ILCompiler.$(MicrosoftNETCoreAppRuntimePackageVersion).nupkg;
363-
$(SourceBuiltShippingPackagesDir)/../runtime/Microsoft.NET.ILLink.Tasks.$(MicrosoftNETILLinkTasksPackageVersion).nupkg"
364-
Condition="'$(BundleNativeAotCompiler)' == 'true'" />
364+
<!-- BundledLayoutPackage with SkipExtractPackage=true metadata -->
365+
<ItemGroup Condition="'@(BundledLayoutPackage->AnyHaveMetadataValue('SkipExtractPackage', 'true'))' == 'true'">
366+
<BundledUncompressedLayoutPackage Include="@(BundledLayoutPackage->WithMetadataValue('SkipExtractPackage', 'true'))" />
367+
<BundledUncompressedLayoutPackageFile Include="$(NuGetPackageRoot)\%(BundledUncompressedLayoutPackage.LoweredPackageName)\%(BundledUncompressedLayoutPackage.PackageVersion)\%(BundledUncompressedLayoutPackage.LoweredPackageName).%(BundledUncompressedLayoutPackage.PackageVersion).nupkg"
368+
DestinationPath="$(RedistLayoutPath)%(BundledUncompressedLayoutPackage.RelativeLayoutPath)\%(BundledUncompressedLayoutPackage.PackageName).%(BundledUncompressedLayoutPackage.PackageVersion).nupkg" />
369+
370+
<BundledLayoutPackageDownloadFilesWithDestination Include="@(BundledUncompressedLayoutPackageFile)" />
365371
</ItemGroup>
366372

367-
<Copy SourceFiles="@(BundledLayoutLibraryPackage)"
368-
DestinationFolder="$(RedistLayoutPath)/library-packs"
373+
<Copy SourceFiles="@(BundledLayoutPackageDownloadFilesWithDestination)"
374+
DestinationFiles="@(BundledLayoutPackageDownloadFilesWithDestination->'%(DestinationPath)')"
369375
SkipUnchangedFiles="true" />
370376

371377
<!-- https://github.com/dotnet/msbuild/issues/5881#issuecomment-802492423 -->

0 commit comments

Comments
 (0)