Skip to content

Commit

Permalink
Adds support for generating Mono named NETCore.App Runtime Packs (#34980
Browse files Browse the repository at this point in the history
)

Starting with osx, we will produce a uniquely named runtime pack with Mono.  The intent is to give the sdk an easier way to identify the mono runtime.

We will now publish Microsoft.NETCore.App.Mono.Runtime.<rid>.nupg
  • Loading branch information
steveisok authored Apr 17, 2020
1 parent 8981ad7 commit 73a10cc
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 23 deletions.
22 changes: 12 additions & 10 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,20 @@
<PropertyGroup>
<DefaultSubsets>clr+mono+libs+installer</DefaultSubsets>
<DefaultSubsets Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'tvOS'">mono+libs+installer</DefaultSubsets>
<DefaultSubsetCategories Condition="'$(TargetOS)' == 'WebAssembly'">mono+libs</DefaultSubsetCategories>
<DefaultSubsets Condition="'$(TargetOS)' == 'WebAssembly'">mono+libs</DefaultSubsets>
</PropertyGroup>

<!-- Init _subSet here in to allow RuntimeFlavor to be set as early as possible -->
<PropertyGroup>
<_subset Condition="'$(Subset)' != ''">+$(Subset.ToLowerInvariant())+</_subset>
<_subset Condition="'$(Subset)' == ''">+$(DefaultSubsets)+</_subset>
</PropertyGroup>

<PropertyGroup>
<RuntimeFlavor Condition="'$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'WebAssembly'">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and ($(_subset.Contains('+mono+')) or $(_subset.Contains('+mono.runtime'))) and (!$(_subset.Contains('+clr+')) and !$(_subset.Contains('+clr.runtime')))">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">CoreCLR</RuntimeFlavor>

<DefaultCoreClrSubsets>clr.runtime+linuxdac+clr.corelib+clr.nativecorelib+clr.tools+clr.buildtools+clr.packages</DefaultCoreClrSubsets>

<DefaultMonoSubsets Condition="'$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMDir)' == ''">mono.llvm+</DefaultMonoSubsets>
Expand All @@ -51,12 +61,10 @@
<DefaultLibrariesSubsets>libs.depprojs+libs.native+libs.ref+libs.src+libs.pretest+libs.packages</DefaultLibrariesSubsets>

<DefaultInstallerSubsets>corehost+installer.managed+installer.depprojs+installer.pkgprojs+bundles+installers+installer.tests</DefaultInstallerSubsets>
<DefaultInstallerSubsets Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'tvOS'">installer.depprojs+installer.pkgprojs</DefaultInstallerSubsets>
<DefaultInstallerSubsets Condition="'$(RuntimeFlavor)' == 'Mono'">installer.pkgprojs</DefaultInstallerSubsets>
</PropertyGroup>

<PropertyGroup>
<_subset Condition="'$(Subset)' != ''">+$(Subset.ToLowerInvariant())+</_subset>
<_subset Condition="'$(Subset)' == ''">+$(DefaultSubsets)+</_subset>
<_subset>$(_subset.Replace('+clr+', '+$(DefaultCoreClrSubsets)+'))</_subset>
<_subset>$(_subset.Replace('+mono+', '+$(DefaultMonoSubsets)+'))</_subset>
<_subset>$(_subset.Replace('+libs+', '+$(DefaultLibrariesSubsets)+'))</_subset>
Expand All @@ -66,12 +74,6 @@
<_subset>+$(_subset.Trim('+'))+</_subset>
</PropertyGroup>

<PropertyGroup>
<RuntimeFlavor Condition="'$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'WebAssembly'">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and $(_subset.Contains('+mono.runtime+')) and !$(_subset.Contains('+clr.runtime+'))">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">CoreCLR</RuntimeFlavor>
</PropertyGroup>

<ItemGroup>
<!-- CoreClr -->
<SubsetName Include="Clr" Description="The CoreCLR runtime, LinuxDac, CoreLib (+ native), tools and packages." />
Expand Down
10 changes: 7 additions & 3 deletions eng/pipelines/installer/jobs/base-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ parameters:
platforms: []

jobs:
- job: ${{ format('installer_{0}_{1}', coalesce(parameters.name, parameters.platform), parameters.buildConfig) }}
displayName: ${{ format('Installer Build and Test {0} {1}', coalesce(parameters.name, parameters.platform), parameters.buildConfig) }}
- job: ${{ format('installer_{0}_{1}_{2}', parameters.runtimeFlavor, coalesce(parameters.name, parameters.platform), parameters.buildConfig) }}
displayName: ${{ format('Installer Build and Test {0} {1} {2}', parameters.runtimeFlavor, coalesce(parameters.name, parameters.platform), parameters.buildConfig) }}

condition: and(succeeded(), ${{ parameters.condition }})
pool: ${{ parameters.pool }}
Expand All @@ -65,7 +65,7 @@ jobs:
- name: SkipTests
value: ${{ or(
not(in(parameters.archType, 'x64', 'x86')),
in(parameters.osGroup, 'iOS', 'tvOS', 'Android'),
eq(parameters.runtimeFlavor, 'mono'),
eq(parameters.isOfficialBuild, true),
ne(parameters.crossrootfsDir, '')) }}

Expand Down Expand Up @@ -97,6 +97,7 @@ jobs:
/p:TargetArchitecture=${{ parameters.archType }}
/p:PortableBuild=true
/p:SkipTests=$(SkipTests)
/p:RuntimeFlavor=${{ parameters.runtimeFlavor }}
$(OfficialBuildArg)
- name: MsbuildSigningArguments
value: >-
Expand All @@ -119,6 +120,7 @@ jobs:
value: >-
/p:PortableBuild=true
/p:SkipTests=$(SkipTests)
/p:RuntimeFlavor=${{ parameters.runtimeFlavor }}
- name: BaseJobBuildCommand
value: >-
Expand Down Expand Up @@ -184,6 +186,7 @@ jobs:
value: >-
/p:Configuration=$(_BuildConfig)
/p:TargetArchitecture=${{ parameters.archType }}
/p:RuntimeFlavor=${{ parameters.runtimeFlavor }}
$(OfficialBuildArg)
- name: _PortableBuild
Expand Down Expand Up @@ -496,6 +499,7 @@ jobs:
- template: steps/upload-job-artifacts.yml
parameters:
name: ${{ coalesce(parameters.name, parameters.platform) }}
runtimeFlavor: ${{ parameters.runtimeFlavor }}
skipTests: $(SkipTests)
isOfficialBuild: ${{ eq(parameters.isOfficialBuild, true) }}

Expand Down
5 changes: 3 additions & 2 deletions eng/pipelines/installer/jobs/steps/upload-job-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
parameters:
name: ''
runtimeFlavor: 'coreclr'

isOfficialBuild: false

Expand All @@ -17,7 +18,7 @@ steps:
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
mergeTestResults: true
testRunTitle: Installer-${{ parameters.name }}-$(_BuildConfig)
testRunTitle: Installer-${{ parameters.runtimeFlavor }}-${{ parameters.name }}-$(_BuildConfig)
continueOnError: true
condition: eq(variables.SkipTests, false)

Expand All @@ -37,6 +38,6 @@ steps:
displayName: Publish BuildLogs
inputs:
targetPath: '$(Build.StagingDirectory)/BuildLogs'
artifactName: Installer-Logs-${{ parameters.name }}-$(_BuildConfig)
artifactName: Installer-Logs-${{ parameters.runtimeFlavor }}-${{ parameters.name }}-$(_BuildConfig)
continueOnError: true
condition: succeededOrFailed()
1 change: 1 addition & 0 deletions eng/pipelines/runtime-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ stages:
buildFullPlatformManifest: false
runtimeFlavor: mono
platforms:
- OSX_x64
- tvOS_x64
- tvOS_arm64
# - iOS_arm # https://github.com/dotnet/runtime/issues/34465
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ jobs:
- Android_arm64
- tvOS_x64
- iOS_arm64
- OSX_x64
jobParameters:
liveRuntimeBuildConfig: release
liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
Expand Down
3 changes: 3 additions & 0 deletions src/installer/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,22 @@
<PropertyGroup>
<TargetsiOS>true</TargetsiOS>
<TargetsUnix>true</TargetsUnix>
<TargetsMobile>true</TargetsMobile>
</PropertyGroup>
</When>
<When Condition="$(OutputRid.StartsWith('tvos'))">
<PropertyGroup>
<TargetstvOS>true</TargetstvOS>
<TargetsUnix>true</TargetsUnix>
<TargetsMobile>true</TargetsMobile>
</PropertyGroup>
</When>
<When Condition="$(OutputRid.StartsWith('android'))">
<PropertyGroup>
<TargetsAndroid>true</TargetsAndroid>
<TargetsLinux>true</TargetsLinux>
<TargetsUnix>true</TargetsUnix>
<TargetsMobile>true</TargetsMobile>
</PropertyGroup>
</When>
<When Condition="$(OutputRid.StartsWith('debian'))">
Expand Down
17 changes: 13 additions & 4 deletions src/installer/pkg/projects/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,26 @@
</PropertyGroup>

<!--
For mobile targets, we do not need the host, so allow depproj's to opt
out and skip building.
Mono does not need some pkgproj (no host on mobile, no crossgen for desktop), so allow projects to
opt out.
-->
<Target Name="MobileSkipBuildProps"
Condition="'$(SkipBuildOnRuntimePackOnlyOS)' == 'true' and ('$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'Android')"
<Target Name="MonoSkipBuildProps"
Condition="'$(SkipBuildOnRuntimePackOnlyOS)' == 'true' and '$(RuntimeFlavor)' == 'Mono'"
BeforeTargets="GetSkipBuildProps">
<PropertyGroup>
<SkipBuild>true</SkipBuild>
</PropertyGroup>
</Target>

<!-- Keep this isolated to desktop mono for now -->
<Target Name="MobileGetBuildRidSpecificPackageProps"
Condition="'$(RuntimeFlavor)' == 'Mono' and '$(TargetsMobile)' != 'true'"
AfterTargets="GetBuildRidSpecificPackageProps">
<PropertyGroup>
<RidSpecificPackProperties>BaseId=$(MSBuildProjectName)$(RuntimeSpecificFrameworkSuffix).Mono.$(PackageBuildRID);IdPrefix=</RidSpecificPackProperties>
</PropertyGroup>
</Target>

<!--
For any Dependency items with a VersionProp, set it to the property by that name given by the
version generation target. For any with a VersionFromProject, query the ProductVersion from that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
shared framework on those platforms.
-->
<PropertyGroup>
<ExcludeHostAssets Condition="'$(TargetOS)' == 'iOS'">true</ExcludeHostAssets>
<ExcludeHostAssets Condition="'$(TargetOS)' == 'tvOS'">true</ExcludeHostAssets>
<ExcludeHostAssets Condition="'$(TargetOS)' == 'Android'">true</ExcludeHostAssets>
<ExcludeHostAssets Condition="'$(RuntimeFlavor)' == 'Mono'">true</ExcludeHostAssets>
</PropertyGroup>
<!--
Include HostPolicy and HostResolver based on legacy packages. This can be collapsed once the
legacy packages are no longer used.
-->
<Import Condition="'$(ExcludeHostAssets)' != 'true'" Project="..\..\Microsoft.NETCore.DotNetHostPolicy\Microsoft.NETCore.DotNetHostPolicy.props" />
<Import Condition="'$(ExcludeHostAssets)' != 'true'" Project="..\..\Microsoft.NETCore.DotNetHostResolver\Microsoft.NETCore.DotNetHostResolver.props" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<!-- Make this Internal package's runtime.json point to the non-Internal runtime packages. -->
<RuntimeProjectFile>$(MSBuildThisFileDirectory)Microsoft.NETCore.App.pkgproj</RuntimeProjectFile>
<SkipBuildOnRuntimePackOnlyOS>true</SkipBuildOnRuntimePackOnlyOS>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<BuildLineupPackage>false</BuildLineupPackage>

<FrameworkListTargetPath>data/</FrameworkListTargetPath>
<SkipBuildOnRuntimePackOnlyOS>true</SkipBuildOnRuntimePackOnlyOS>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<BuildRuntimePackages>false</BuildRuntimePackages>

<IsShipping>false</IsShipping>
<SkipBuildOnRuntimePackOnlyOS>true</SkipBuildOnRuntimePackOnlyOS>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 73a10cc

Please sign in to comment.