Skip to content

Commit d070660

Browse files
mmitcheViktorHofer
andauthored
Enable installer and SDK repos in VMR build (#18632)
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
1 parent 884fddb commit d070660

18 files changed

+145
-141
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<PropertyGroup>
11-
<BuildArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant())</BuildArchitecture>
11+
<BuildArchitecture Condition="'$(BuildArchitecture)' == ''">$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant())</BuildArchitecture>
1212
<Architecture Condition="'$(Architecture)' == '' AND ('$(BuildArchitecture)' == 'arm64' OR '$(BuildArchitecture)' == 'arm')">$(BuildArchitecture)</Architecture>
1313
<Architecture Condition="'$(Architecture)' == '' AND '$(BuildArchitecture)' == 's390x'">$(BuildArchitecture)</Architecture>
1414
<Architecture Condition="'$(Architecture)' == '' AND '$(BuildArchitecture)' == 'ppc64le'">$(BuildArchitecture)</Architecture>

eng/SourceBuild.props

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,25 @@
88
</PropertyGroup>
99

1010
<Target Name="ConfigureInnerBuildArg" BeforeTargets="GetSourceBuildCommandConfiguration">
11-
<PropertyGroup>
11+
<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
1212
<InnerBuildArgs>$(InnerBuildArgs) /p:SkipBuildingInstallers=true</InnerBuildArgs>
1313
<InnerBuildArgs>$(InnerBuildArgs) /p:IncludeAdditionalSharedFrameworks=false</InnerBuildArgs>
1414
<InnerBuildArgs Condition="'$(SourceBuildUseMonoRuntime)' == 'true'">$(InnerBuildArgs) /p:DISABLE_CROSSGEN=true</InnerBuildArgs>
1515
<InnerBuildArgs Condition="'$(PgoInstrument)' == 'true'">$(InnerBuildArgs) /p:PgoInstrument=true</InnerBuildArgs>
1616
</PropertyGroup>
1717
</Target>
1818

19+
<!-- This should be resolved/removed with https://github.com/dotnet/source-build/issues/4101 -->
20+
<Target Name="AddInstallers"
21+
BeforeTargets="GetCategorizedIntermediateNupkgContents">
22+
<ItemGroup Condition="'$(DotNetBuildOrchestrator)' == 'true'">
23+
<!-- Include installers when in product VMR builds. These are not necessary when building the repo-only build as we don't
24+
need them in downstream source-only PR legs. We could include them, but it may bump us over the package size limit. -->
25+
<IntermediateNupkgArtifactFile Include="$(CurrentRepoSourceBuildArtifactsPackagesDir)Shipping\*.msi" />
26+
<IntermediateNupkgArtifactFile Include="$(CurrentRepoSourceBuildArtifactsPackagesDir)Shipping\*.deb" />
27+
<IntermediateNupkgArtifactFile Include="$(CurrentRepoSourceBuildArtifactsPackagesDir)Shipping\*.rpm" />
28+
<IntermediateNupkgArtifactFile Include="$(CurrentRepoSourceBuildArtifactsPackagesDir)Shipping\*.pkg" />
29+
</ItemGroup>
30+
</Target>
31+
1932
</Project>

eng/restore-toolset.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function InitializeCustomSDKToolset {
55

66
# The following frameworks and tools are used only for testing.
77
# Do not attempt to install them in source build.
8-
if ($env:DotNetBuildFromSource -eq "true") {
8+
if ($productBuild -or $properties -like "*DotNetBuildRepo=true*") {
99
return
1010
}
1111

eng/restore-toolset.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function InitializeCustomSDKToolset {
55

66
# The following frameworks and tools are used only for testing.
77
# Do not attempt to install them in source build.
8-
if [[ "${DotNetBuildFromSource:-}" == "true" ]]; then
8+
if [[ $product_build == true || $properties == *"DotNetBuildRepo=true"* ]]; then
99
return
1010
fi
1111

src/SourceBuild/content/Directory.Build.props

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@
3434
<RootRepo Condition="'$(ShortStack)' == 'true'">runtime</RootRepo>
3535
</PropertyGroup>
3636

37+
<!-- See https://github.com/dotnet/arcade/blob/main/Documentation/UnifiedBuild/Unified-Build-Controls.md#output-controls for
38+
control set definition. -->
3739
<PropertyGroup Label="CalculateArch">
40+
<!-- Build architecture is what we are building on. -->
3841
<BuildArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</BuildArchitecture>
39-
<HostArchitecture Condition="'$(HostArchitecture)' == ''">$(BuildArchitecture)</HostArchitecture>
40-
41-
<!-- When building on non-x64 architectures, there may be no cross-compilation available, select a target architecture that is the same as the build. -->
42+
<!-- The target architecture is the what the customer is targeting their outputs to run on. -->
4243
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">$(BuildArchitecture)</TargetArchitecture>
44+
<!-- The host architecture is the what the customer will build on. Much of the time, Host==Target. -->
45+
<HostArchitecture Condition="'$(HostArchitecture)' == ''">$(TargetArchitecture)</HostArchitecture>
4346

4447
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
4548
</PropertyGroup>

src/SourceBuild/content/repo-projects/Directory.Build.props

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,20 +240,15 @@
240240
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftNETCoreAppRuntimePackageVersion" Version="%24(MicrosoftNETCoreAppRefPackageVersion)" />
241241
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftNETCoreAppRuntimeVersion" Version="%24(MicrosoftNETCoreAppRefPackageVersion)" />
242242
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftNETCoreAppHostPackageVersion" Version="%24(MicrosoftNETCoreAppRefPackageVersion)" />
243-
<!-- core-sdk uses this property for ASP.NET blob directory -->
244-
<ExtraPackageVersionPropsPackageInfo Include="VSRedistCommonAspNetCoreTargetingPackx6430PackageVersion" Version="$(aspnetcoreOutputPackageVersion)" />
243+
244+
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftWindowsDesktopAppRuntimewinx64PackageVersion" Version="$(windowsdesktopOutputPackageVersion)" />
245245

246246
<!-- Used by installer to determine sdk version -->
247247
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftDotnetToolsetInternalPackageVersion" Version="%24(MicrosoftNETSdkPackageVersion)" />
248248

249249
<!-- Used by sdk to determine msbuild version for fsharp -->
250250
<ExtraPackageVersionPropsPackageInfo Include="FSharpBuildVersion" Version="%24(MicrosoftBuildPackageVersion)" />
251251

252-
<!-- property used by Arcade to determine what version of SourceLink to use -->
253-
<!-- if MicrosoftSourceLinkCommonPackageVersion is non-empty, then we've already built SourceLink, regardless of whether
254-
this is the production or offline build, so we should use that version. -->
255-
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftSourceLinkVersion" Version="%24(MicrosoftSourceLinkCommonPackageVersion)" />
256-
257252
<!-- non-rid-specific versions of RID-specific version variables to use for bootstrapping -->
258253
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftAspNetCoreAppRuntimeVersion" Version="%24(MicrosoftAspNetCoreAppRefPackageVersion)" />
259254
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftNETCoreAppCrossgen2Version" Version="%24(MicrosoftNETCoreAppRefPackageVersion)" />

src/SourceBuild/content/repo-projects/Directory.Build.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,6 @@
742742
<TransitiveRepositoryReference Remove="nuget-client" />
743743
<TransitiveRepositoryReference Remove="fsharp" />
744744
<TransitiveRepositoryReference Remove="vstest" />
745-
<TransitiveRepositoryReference Remove="installer" />
746745
</ItemGroup>
747746
</Target>
748747

src/SourceBuild/content/repo-projects/installer.proj

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,21 @@
44
<!-- Need to set to false to calculate RepositoryCommit. -->
55
<EnableSourceControlManagerQueries>false</EnableSourceControlManagerQueries>
66

7-
<!-- We need to extract the non-portable OS name from the non-portable RID and pass that to installer build script -->
8-
<OSNameOverride>$(TargetOS)</OSNameOverride>
9-
<OSNameOverride Condition="'$(PortableBuild)' != 'true'">$(TargetRid.Substring(0, $(TargetRid.IndexOf("-"))))</OSNameOverride>
10-
117
<!-- Use the repo root build script -->
128
<BuildScript>$(ProjectDirectory)build$(ShellExtension)</BuildScript>
139

1410
<!-- Restore and Build actions are already passed in by the root script. -->
1511
<BuildActions>$(FlagParameterPrefix)pack $(FlagParameterPrefix)publish</BuildActions>
1612

17-
<BuildArgs>$(BuildArgs) $(FlagParameterPrefix)runtime-id $(TargetRid)</BuildArgs>
18-
1913
<!--
2014
Setting NETCoreAppMaximumVersion to a high version so that the sdk doesn't complain if we're restoring/publishing for a higher version than the sdk.
2115
See https://github.com/dotnet/sdk/issues/1512#issuecomment-377082883
2216
-->
2317
<BuildArgs>$(BuildArgs) /p:NETCoreAppMaximumVersion=99.9</BuildArgs>
24-
<BuildArgs>$(BuildArgs) /p:OSName=$(OSNameOverride)</BuildArgs>
18+
<!-- We need to extract the non-portable OS name from the non-portable RID and pass that to installer build script.
19+
This should not happen except when building non-portable. installer generally extracts the OSName from the host OS,
20+
or from the Rid if supplied. -->
21+
<BuildArgs Condition="$(PortableBuild) != 'true'">$(BuildArgs) /p:OSName=$(TargetRid.Substring(0, $(TargetRid.IndexOf("-"))))</BuildArgs>
2522
<BuildArgs>$(BuildArgs) /p:PortableOSName=$(__PortableTargetOS)</BuildArgs>
2623
<BuildArgs>$(BuildArgs) /p:Rid=$(TargetRid)</BuildArgs>
2724
<BuildArgs>$(BuildArgs) /p:Architecture=$(TargetArchitecture)</BuildArgs>
@@ -30,10 +27,13 @@
3027
<BuildArgs Condition="'$(TargetOS)' != 'windows'">$(BuildArgs) /p:AspNetCoreInstallerRid=$(TargetRid)</BuildArgs>
3128
<!-- installer always wants to build portable on FreeBSD -->
3229
<BuildArgs Condition="'$(TargetOS)' == 'freebsd' and '$(DotNetBuildSourceOnly)' == 'true'">$(BuildArgs) /p:PortableBuild=true</BuildArgs>
33-
<BuildArgs Condition="'$(TargetOS)' != 'windows'">$(BuildArgs) /p:CoreSetupRid=$(TargetRid)</BuildArgs>
30+
<BuildArgs Condition="'$(TargetOS)' != 'windows'">$(BuildArgs) /p:NetRuntimeRid=$(TargetRid)</BuildArgs>
31+
<!-- https://github.com/dotnet/source-build/issues/4138 -->
32+
<BuildArgs Condition="'$(TargetOS)' != 'windows' and '$(TargetOS)' != 'osx'">$(BuildArgs) /p:SkipBuildingInstallers=true</BuildArgs>
3433

3534
<BuildArgs>$(BuildArgs) /p:PublicBaseURL=file:%2F%2F$(ArtifactsAssetsDir)</BuildArgs>
36-
35+
<!-- In non-source-only scenarios, currently consume aspnetcore from the normal public base url -->
36+
<BuildArgs>$(BuildArgs) /p:FallbackPublicBaseURL=https://dotnetbuilds.blob.core.windows.net/public/</BuildArgs>
3737
<BuildArgs>$(BuildArgs) /p:UsePortableLinuxSharedFramework=false</BuildArgs>
3838

3939
<BuildArgs Condition="'$(PgoInstrument)' == 'true'">$(BuildArgs) /p:PgoInstrument=true</BuildArgs>
@@ -74,15 +74,8 @@
7474

7575
<ItemGroup>
7676
<EnvironmentVariables Include="CLIBUILD_SKIP_TESTS=true" />
77-
78-
<!-- Disable bundled tools until we can figure out:
79-
Unable to find package dotnet-dev-certs.
80-
Unable to find package dotnet-ef.
81-
Unable to find package dotnet-sql-cache.
82-
Unable to find package dotnet-user-secrets.
83-
Unable to find package dotnet-user-jwts.
84-
Unable to find package dotnet-watch. -->
85-
<EnvironmentVariables Include="CLIBUILD_SKIP_BUNDLEDDOTNETTOOLS=true" />
77+
<!-- https://github.com/dotnet/source-build/issues/4115. -->
78+
<EnvironmentVariables Include="PublishWindowsPdb=false" />
8679
</ItemGroup>
8780

8881
<Target Name="GetInputsOutputForCreatePrivateSourceBuiltArtifactsArchive"

src/core-sdk-tasks/core-sdk-tasks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">$(CoreSdkTargetFramework)</TargetFrameworks>
55
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
66
<RootNamespace>Microsoft.DotNet.Cli.Build</RootNamespace>
7-
<DefineConstants Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefineConstants);SOURCE_BUILD</DefineConstants>
7+
<DefineConstants Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(DefineConstants);SOURCE_BUILD</DefineConstants>
88
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
99
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1010
</PropertyGroup>
@@ -16,7 +16,7 @@
1616
<PackageReference Include="NuGet.Versioning" Version="$(NuGetBuildTasksPackageVersion)" />
1717
<PackageReference Include="NuGet.Packaging" Version="$(NuGetBuildTasksPackageVersion)" />
1818
<PackageReference Include="System.Reflection.Metadata" Version="1.4.2" />
19-
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" Condition="'$(DotNetBuildFromSource)' != 'true'" />
19+
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
2020
<PackageReference Include="System.Net.Http" Version="4.3.4" />
2121
</ItemGroup>
2222

src/finalizer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.15.5)
1+
cmake_minimum_required(VERSION 3.20)
22

33
# Create project named finalizer, this will
44
# will generate Finalizer.vcxproj

src/redist/redist.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
77
<ResolveAssemblyReferencesSilent>true</ResolveAssemblyReferencesSilent>
88
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>none</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
9-
<BundleRuntimePacks Condition="'$(BundleRuntimePacks)' == '' And '$(DotNetBuildFromSource)' == 'true'">true</BundleRuntimePacks>
9+
<BundleRuntimePacks Condition="'$(BundleRuntimePacks)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">true</BundleRuntimePacks>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
@@ -15,8 +15,8 @@
1515
RuntimeFrameworkVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"
1616
/>
1717

18-
<ProjectReference Include="..\SdkResolver\SdkResolver.csproj" ReferenceOutputAssembly="false" Condition="'$(DotNetBuildFromSource)' != 'true'" />
19-
<ProjectReference Include="..\VSTemplateLocator\VSTemplateLocator.csproj" ReferenceOutputAssembly="false" Condition="'$(DotNetBuildFromSource)' != 'true'" />
18+
<ProjectReference Include="..\SdkResolver\SdkResolver.csproj" ReferenceOutputAssembly="false" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
19+
<ProjectReference Include="..\VSTemplateLocator\VSTemplateLocator.csproj" ReferenceOutputAssembly="false" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

src/redist/targets/BundledManifests.targets

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<NetFeatureBand>8.0.100</NetFeatureBand>
44
</PropertyGroup>
55
<ItemGroup>
6-
<BundledManifests Include="Microsoft.NET.Sdk.Android" FeatureBand="$(MauiFeatureBand)" Version="$(XamarinAndroidWorkloadManifestVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
7-
<BundledManifests Include="Microsoft.NET.Sdk.iOS" FeatureBand="$(MauiFeatureBand)" Version="$(XamarinIOSWorkloadManifestVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
8-
<BundledManifests Include="Microsoft.NET.Sdk.MacCatalyst" FeatureBand="$(MauiFeatureBand)" Version="$(XamarinMacCatalystWorkloadManifestVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
9-
<BundledManifests Include="Microsoft.NET.Sdk.macOS" FeatureBand="$(MauiFeatureBand)" Version="$(XamarinMacOSWorkloadManifestVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
10-
<BundledManifests Include="Microsoft.NET.Sdk.Maui" FeatureBand="$(MauiFeatureBand)" Version="$(MauiWorkloadManifestVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
11-
<BundledManifests Include="Microsoft.NET.Sdk.tvOS" FeatureBand="$(MauiFeatureBand)" Version="$(XamarinTvOSWorkloadManifestVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
6+
<BundledManifests Include="Microsoft.NET.Sdk.Android" FeatureBand="$(MauiFeatureBand)" Version="$(XamarinAndroidWorkloadManifestVersion)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
7+
<BundledManifests Include="Microsoft.NET.Sdk.iOS" FeatureBand="$(MauiFeatureBand)" Version="$(XamarinIOSWorkloadManifestVersion)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
8+
<BundledManifests Include="Microsoft.NET.Sdk.MacCatalyst" FeatureBand="$(MauiFeatureBand)" Version="$(XamarinMacCatalystWorkloadManifestVersion)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
9+
<BundledManifests Include="Microsoft.NET.Sdk.macOS" FeatureBand="$(MauiFeatureBand)" Version="$(XamarinMacOSWorkloadManifestVersion)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
10+
<BundledManifests Include="Microsoft.NET.Sdk.Maui" FeatureBand="$(MauiFeatureBand)" Version="$(MauiWorkloadManifestVersion)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
11+
<BundledManifests Include="Microsoft.NET.Sdk.tvOS" FeatureBand="$(MauiFeatureBand)" Version="$(XamarinTvOSWorkloadManifestVersion)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
1212
<!-- Bundled Manifests are ordered by the reference here - verify before altering -->
1313
<BundledManifests Include="Microsoft.NET.Workload.Mono.ToolChain.Current" FeatureBand="$(MonoWorkloadFeatureBand)" Version="$(MonoWorkloadManifestVersion)" />
1414
<BundledManifests Include="Microsoft.NET.Workload.Emscripten.Current" FeatureBand="$(EmscriptenWorkloadFeatureBand)" Version="$(EmscriptenWorkloadManifestVersion)" />

0 commit comments

Comments
 (0)