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

Adds support for generating Mono named NETCore.App Runtime Packs #34980

Merged
merged 16 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
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
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 -->
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<!-- Init _subSet here in to allow RuntimeFlavor to be set as early as possible -->
<!-- Init _subset here in to allow RuntimeFlavor to be set as early as possible -->

Copy link
Member Author

Choose a reason for hiding this comment

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

Same - can that happen in a follow up PR?

Copy link
Member

Choose a reason for hiding this comment

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

of course, those were just nits.

<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>
Copy link
Member

Choose a reason for hiding this comment

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

Lost some + in the move, it looks like, if I understand the pattern right:

Suggested change
<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)' == '' and ($(_subset.Contains('+mono+')) or $(_subset.Contains('+mono.runtime+'))) and (!$(_subset.Contains('+clr+')) and !$(_subset.Contains('+clr.runtime+')))">Mono</RuntimeFlavor>

I would put it on multiple lines for easier reading/review, but this is subjective and I'm sure some people are annoyed at me doing it all the time 😄:

    <RuntimeFlavor
      Condition="
        '$(RuntimeFlavor)' == '' and
        (
          $(_subset.Contains('+mono+')) or
          $(_subset.Contains('+mono.runtime'))
        ) and
        (
          !$(_subset.Contains('+clr+')) and
          !$(_subset.Contains('+clr.runtime'))
        )">Mono</RuntimeFlavor>

Copy link
Member

Choose a reason for hiding this comment

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

@steveisok I edited my message on Teams and added the missing pluses :D You probably took mine before the edit :D

Copy link
Member

@dagood dagood Apr 17, 2020

Choose a reason for hiding this comment

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

FWIW, seems like this is a nit as well to me--I think it would only cause a problem if we added a clr.runtimefoobar subset (and... some probably complicated scenario about what the subset's meant to do).

<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">CoreCLR</RuntimeFlavor>

Copy link
Member

Choose a reason for hiding this comment

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

nit: Please close this PropertyGroup and open a new one.

Copy link
Member Author

Choose a reason for hiding this comment

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

can that happen in a follow up PR?

<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>
steveisok marked this conversation as resolved.
Show resolved Hide resolved
<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