Skip to content

Commit

Permalink
look for portable RID runtime packages by default
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussell committed Dec 13, 2022
1 parent bb24aaf commit 36cda37
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- group: AzureDevOps-Artifact-Feeds-Pats
- ${{ if eq(parameters.usePreviousArtifacts, 'true') }}:
- name: additionalBuildArgs
value: --with-sdk /tarball/.dotnet
value: --with-sdk /tarball/.dotnet -- /p:UseNonPortableIlasmPackageOverride=true
- name: tarballDir
${{ if eq(parameters.installerBuildResourceId, '') }}:
value: $(Build.SourcesDirectory)
Expand Down
1 change: 1 addition & 0 deletions src/SourceBuild/tarball/content/repos/runtime.proj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<BuildCommandArgs>$(BuildCommandArgs) /p:RuntimeOS=$(RuntimeOS)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:BaseOS=$(BaseOS)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:SourceBuildNonPortable=true</BuildCommandArgs>
<BuildCommandArgs Condition="'$(UseNonPortableIlasmPackageOverride)' == 'true'">$(BuildCommandArgs) /p:UseNonPortableIlasmPackageOverride=true</BuildCommandArgs>
<BuildCommand>$(StandardSourceBuildCommand) $(BuildCommandArgs)</BuildCommand>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<LocalNuGetPackageCacheDirectory>$(BaseIntermediatePath)source-build-reference-package-cache</LocalNuGetPackageCacheDirectory>

<BuildCommandArgs>$(StandardSourceBuildArgs)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:MicrosoftNetCoreIlasmPackageRuntimeId=$(NETCoreSdkRuntimeIdentifier)</BuildCommandArgs>
<BuildCommandArgs Condition="'$(UseNonPortableIlasmPackageOverride)' == 'true'">$(BuildCommandArgs) /p:MicrosoftNetCoreIlasmPackageRuntimeId=$(NETCoreSdkRuntimeIdentifier)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:LocalNuGetPackageCacheDirectory=$(LocalNuGetPackageCacheDirectory)</BuildCommandArgs>

<BuildCommand>$(StandardSourceBuildCommand) $(BuildCommandArgs)</BuildCommand>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Logan Bussell <loganbussell@microsoft.com>
Date: Mon, 5 Dec 2022 15:59:59 -0800
Subject: [PATCH] Look for portable runtime packages by default

Change the default behavior to look for portable RID runtime packages (like
ilasm). If previous source-built artifacts contain non-portable runtime
packages, build .NET source-build with the
` -- /p:UseNonPortableIlasmPackageOverride=true` argument.

This patch should not be in the release of .NET Source-build 7.0.102.
---
Directory.Build.targets | 2 +-
eng/SourceBuild.props | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Directory.Build.targets b/Directory.Build.targets
index ef9e5f5810c..c6469821345 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -16,7 +16,7 @@
When .NET gets built from source, make the SDK aware there are bootstrap packages
for Microsoft.NETCore.App.Runtime.<rid> and Microsoft.NETCore.App.Crossgen2.<rid>.
-->
- <ItemGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
+ <ItemGroup Condition="'$(DotNetBuildFromSource)' == 'true' and '$(UseNonPortableIlasmPackageOverride)' == 'true'">
<KnownFrameworkReference Update="@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
<RuntimePackRuntimeIdentifiers>$(PackageRID)</RuntimePackRuntimeIdentifiers>
</KnownFrameworkReference>
diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props
index 32e6d9c0bad..57b822d4ef1 100644
--- a/eng/SourceBuild.props
+++ b/eng/SourceBuild.props
@@ -51,6 +51,7 @@
<InnerBuildArgs>$(InnerBuildArgs) /p:DisableSourceLink=false</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS)</InnerBuildArgs>
<InnerBuildArgs Condition="'$(SourceBuildUseMonoRuntime)' == 'true'">$(InnerBuildArgs) /p:PrimaryRuntimeFlavor=Mono /p:RuntimeFlavor=Mono</InnerBuildArgs>
+ <InnerBuildArgs Condition="'$(UseNonPortableIlasmPackageOverride)' == 'true'">$(InnerBuildArgs) /p:UseNonPortableIlasmPackageOverride=true</InnerBuildArgs>
</PropertyGroup>
</Target>

0 comments on commit 36cda37

Please sign in to comment.