Skip to content

Commit 19712d9

Browse files
[mono][tests] Run Mono iOS sample as functional test on the simulator and maccatalyst on Helix (#86578)
* Add HelloiOS sample on iossimulator * Enable AOT compilation and JustInterp mode on iossimulator * Remove custom tasks from the sample app * Set default props for the sample app. Use diagnostics_tracing and marshal-ilgen for RuntimeComponents --------- Co-authored-by: Filip Navara <[email protected]>
1 parent 0ea4609 commit 19712d9

File tree

6 files changed

+79
-163
lines changed

6 files changed

+79
-163
lines changed

eng/pipelines/coreclr/templates/build-perf-sample-apps.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ steps:
5050
artifactName: ${{ parameters.artifactName }}
5151
- template: /eng/pipelines/common/upload-artifact-step.yml
5252
parameters:
53-
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
53+
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
5454
includeRootFolder: true
5555
displayName: iOS Sample App NoLLVM
5656
artifactName: iOSSampleAppNoLLVMSymbols
@@ -72,7 +72,7 @@ steps:
7272
artifactName: ${{ parameters.artifactName }}
7373
- template: /eng/pipelines/common/upload-artifact-step.yml
7474
parameters:
75-
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
75+
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
7676
includeRootFolder: true
7777
displayName: iOS Sample App NoLLVM NoSymbols
7878
artifactName: iOSSampleAppNoLLVMNoSymbols
@@ -94,7 +94,7 @@ steps:
9494
artifactName: ${{ parameters.artifactName }}
9595
- template: /eng/pipelines/common/upload-artifact-step.yml
9696
parameters:
97-
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
97+
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
9898
includeRootFolder: true
9999
displayName: iOS Sample App LLVM
100100
artifactName: iOSSampleAppLLVMSymbols
@@ -116,7 +116,7 @@ steps:
116116
artifactName: ${{ parameters.artifactName }}
117117
- template: /eng/pipelines/common/upload-artifact-step.yml
118118
parameters:
119-
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
119+
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
120120
includeRootFolder: true
121121
displayName: iOS Sample App LLVM NoSymbols
122122
artifactName: iOSSampleAppLLVMNoSymbols
@@ -137,7 +137,7 @@ steps:
137137
artifactName: ${{ parameters.artifactName }}
138138
- template: /eng/pipelines/common/upload-artifact-step.yml
139139
parameters:
140-
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS-NativeAOT/bin/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
140+
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS-NativeAOT/bin/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
141141
includeRootFolder: true
142142
displayName: iOS Sample App Symbols
143143
artifactName: iOSSampleAppSymbols
@@ -159,7 +159,7 @@ steps:
159159
artifactName: ${{ parameters.artifactName }}
160160
- template: /eng/pipelines/common/upload-artifact-step.yml
161161
parameters:
162-
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS-NativeAOT/bin/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
162+
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS-NativeAOT/bin/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
163163
includeRootFolder: true
164164
displayName: iOS Sample App NoSymbols
165165
artifactName: iOSSampleAppNoSymbols

src/libraries/tests.proj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,8 @@
632632
</ItemGroup>
633633

634634
<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(RunSmokeTestsOnly)' != 'true' and '$(RunGrpcTestsOnly)' != 'true' and '$(TargetOS)' == 'iossimulator'">
635-
<!-- https://github.com/dotnet/runtime/issues/57666 -->
636-
<!-- <ProjectReference Include="$(MonoProjectRoot)sample\iOS\Program.csproj"
637-
BuildInParallel="false" /> -->
635+
<ProjectReference Include="$(MonoProjectRoot)sample\iOS\Program.csproj"
636+
BuildInParallel="false" />
638637
<ProjectReference Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Simulator\**\*.Test.csproj"
639638
Exclude="@(ProjectExclusions)"
640639
BuildInParallel="false" />
@@ -647,9 +646,8 @@
647646
</ItemGroup>
648647

649648
<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(RunSmokeTestsOnly)' != 'true' and '$(RunGrpcTestsOnly)' != 'true' and '$(TargetOS)' == 'maccatalyst'">
650-
<!-- https://github.com/dotnet/runtime/issues/57666 -->
651-
<!-- <ProjectReference Include="$(MonoProjectRoot)sample\iOS\Program.csproj"
652-
BuildInParallel="false" /> -->
649+
<ProjectReference Include="$(MonoProjectRoot)sample\iOS\Program.csproj"
650+
BuildInParallel="false" />
653651
<ProjectReference Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Simulator\**\*.Test.csproj"
654652
Exclude="@(ProjectExclusions)"
655653
BuildInParallel="false" />

src/mono/msbuild/apple/build/AppleBuild.InTree.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
<UsingTask TaskName="MonoAOTCompiler" AssemblyFile="$(MonoAOTCompilerTasksAssemblyPath)" />
44
<UsingTask TaskName="RuntimeConfigParserTask" AssemblyFile="$(MonoTargetsTasksAssemblyPath)" />
55

6-
<!-- For MacCatalyst, adhoc is the default. Set it here so that we don't have to specify when running local -->
6+
<!-- For MacCatalyst, adhoc is the default. Set it here so that we don't have to specify when running local -->
77
<PropertyGroup>
8+
<DevTeamProvisioning Condition="'$(DevTeamProvisioning)' == '' and '$(TargetOS)' != 'maccatalyst'">-</DevTeamProvisioning>
89
<DevTeamProvisioning Condition="'$(DevTeamProvisioning)' == '' and '$(TargetOS)' == 'maccatalyst'">adhoc</DevTeamProvisioning>
910
</PropertyGroup>
1011

src/mono/msbuild/apple/build/AppleBuild.targets

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<BundleDir>$(AppleBundleDir)</BundleDir>
4949
<_MonoHeaderPath>$([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidNativeDir), 'include', 'mono-2.0'))</_MonoHeaderPath>
5050
<_AotModuleTablePath>$(AppleBundleDir)\modules.m</_AotModuleTablePath>
51+
<AppName Condition="'$(AppName)' == ''">$(AssemblyName)</AppName>
5152
</PropertyGroup>
5253

5354
<!-- common linker arguments for app and library builds -->
@@ -84,6 +85,7 @@
8485
<PropertyGroup>
8586
<_AppleRuntimeConfigFilePath Condition="'$(_AppleRuntimeConfigFilePath)' == ''">$([MSBuild]::NormalizePath($(AppleBuildDir), '$(AssemblyName).runtimeconfig.json'))</_AppleRuntimeConfigFilePath>
8687
<_ParsedRuntimeConfigFilePath Condition="'$(_ParsedRuntimeConfigFilePath)' == ''">$([MSBuild]::NormalizePath($(AppleBuildDir), 'runtimeconfig.bin'))</_ParsedRuntimeConfigFilePath>
88+
<UseConsoleUITemplate Condition="'$(UseConsoleUITemplate)' == ''">true</UseConsoleUITemplate>
8789
</PropertyGroup>
8890

8991
<RemoveDir Directories="$(AppleBundleDir)" />
@@ -183,6 +185,7 @@
183185
<AotArguments>@(MonoAOTCompilerDefaultAotArguments, ';')</AotArguments>
184186
<ProcessArguments>@(MonoAOTCompilerDefaultProcessArguments, ';')</ProcessArguments>
185187
</_AotInputAssemblies>
188+
<_ExcludeFromAppDir Include="$(_iOSLikeDedupAssembly)" />
186189
</ItemGroup>
187190

188191
<!--
@@ -255,10 +258,11 @@
255258
NativeMainSource="$(NativeMainSource)"
256259
Optimized="$(Optimized)"
257260
OutputDirectory="$(AppleBundleDir)"
258-
ProjectName="$(AssemblyName)"
261+
ProjectName="$(AppName)"
259262
RuntimeComponents="$(RuntimeComponents)"
260263
TargetOS="$(TargetOS)"
261-
UseConsoleUITemplate="True">
264+
ExcludeFromAppDir="@(_ExcludeFromAppDir)"
265+
UseConsoleUITemplate="$(UseConsoleUITemplate)">
262266
<Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" />
263267
<Output TaskParameter="XcodeProjectPath" PropertyName="XcodeProjectPath" />
264268
</AppleAppBuilderTask>

src/mono/sample/iOS/Makefile

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ MONO_CONFIG?=Debug
22
MONO_ARCH?=x64
33
DOTNET := ../../../../dotnet.sh
44
USE_LLVM=true
5-
AOT?=false
65
TARGET?=iossimulator
76
DEPLOY_AND_RUN?=true
87
APP_SANDBOX?=false
@@ -25,68 +24,72 @@ appbuilder:
2524
$(DOTNET) build -c Debug $(TOOLS_DIR)/AppleAppBuilder/AppleAppBuilder.csproj
2625

2726
runtimepack:
28-
../../../../build.sh Mono+Libs -os $(TARGET) -arch $(MONO_ARCH) -c $(MONO_CONFIG)
27+
../../../../build.sh mono+libs -os $(TARGET) -arch $(MONO_ARCH) -c $(MONO_CONFIG)
28+
29+
build-appbundle: clean appbuilder
30+
$(DOTNET) publish \
31+
-c $(MONO_CONFIG) \
32+
/p:TargetOS=$(TARGET) \
33+
/p:TargetArchitecture=$(MONO_ARCH) \
34+
/p:MonoEnableLLVM=$(USE_LLVM) \
35+
/p:StripDebugSymbols=$(STRIP_DEBUG_SYMBOLS) \
36+
/p:DeployAndRun=false \
37+
/bl
2938

3039
run: clean appbuilder
3140
$(DOTNET) publish \
3241
-c $(MONO_CONFIG) \
3342
/p:TargetOS=ios \
3443
/p:TargetArchitecture=$(MONO_ARCH) \
35-
/p:UseLLVM=$(USE_LLVM) \
36-
/p:ForceAOT=$(AOT) \
37-
'/p:RuntimeComponents="$(RUNTIME_COMPONENTS)"' \
38-
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
39-
'/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)"'
44+
/p:MonoEnableLLVM=$(USE_LLVM) \
45+
/p:DeployAndRun=$(DEPLOY_AND_RUN) \
46+
/p:RuntimeComponents="$(RUNTIME_COMPONENTS)" \
47+
/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)" \
48+
/bl
4049

4150
run-sim: clean appbuilder
4251
$(DOTNET) publish \
4352
-c $(MONO_CONFIG) \
4453
/p:TargetOS=iossimulator \
4554
/p:TargetArchitecture=$(MONO_ARCH) \
46-
/p:UseLLVM=$(USE_LLVM) \
47-
/p:ForceAOT=$(AOT) \
48-
'/p:RuntimeComponents="$(RUNTIME_COMPONENTS)"' \
49-
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
50-
'/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)"'
55+
/p:MonoEnableLLVM=$(USE_LLVM) \
56+
/p:DeployAndRun=$(DEPLOY_AND_RUN) \
57+
/p:RuntimeComponents="$(RUNTIME_COMPONENTS)" \
58+
/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)" \
59+
/bl
5160

52-
build-appbundle: clean appbuilder
53-
$(DOTNET) publish -c $(MONO_CONFIG) /p:TargetOS=$(TARGET) /p:TargetArchitecture=$(MONO_ARCH) \
54-
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
55-
/p:StripDebugSymbols=$(STRIP_DEBUG_SYMBOLS) \
56-
/p:UseLLVM=$(USE_LLVM) /p:ForceAOT=$(AOT) /bl \
57-
58-
run-catalyst:
61+
run-sim-interp: clean appbuilder
5962
$(DOTNET) publish \
6063
-c $(MONO_CONFIG) \
61-
/p:TargetOS=maccatalyst \
64+
/p:TargetOS=iossimulator \
6265
/p:TargetArchitecture=$(MONO_ARCH) \
63-
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
64-
/p:UseLLVM=False \
65-
/p:ForceAOT=True \
66-
/p:EnableAppSandbox=$(APP_SANDBOX)
66+
/p:MonoEnableLLVM=$(USE_LLVM) \
67+
/p:MonoForceInterpreter=true \
68+
/p:DeployAndRun=$(DEPLOY_AND_RUN) \
69+
/p:RuntimeComponents="$(RUNTIME_COMPONENTS)" \
70+
/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)" \
71+
/bl
6772

68-
run-sim-interp: clean appbuilder
73+
run-catalyst: clean appbuilder
6974
$(DOTNET) publish \
7075
-c $(MONO_CONFIG) \
71-
/p:TargetOS=iossimulator \
76+
/p:TargetOS=maccatalyst \
7277
/p:TargetArchitecture=$(MONO_ARCH) \
73-
/p:UseLLVM=$(USE_LLVM) \
74-
/p:ForceAOT=$(AOT) \
75-
/p:MonoForceInterpreter=true \
76-
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
77-
'/p:RuntimeComponents="$(RUNTIME_COMPONENTS)"' \
78-
'/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)"'
78+
/p:MonoEnableLLVM=false \
79+
/p:DeployAndRun=$(DEPLOY_AND_RUN) \
80+
/p:EnableAppSandbox=$(APP_SANDBOX) \
81+
/bl
7982

80-
run-catalyst-interp:
83+
run-catalyst-interp: clean appbuilder
8184
$(DOTNET) publish \
8285
-c $(MONO_CONFIG) \
8386
/p:TargetOS=maccatalyst \
8487
/p:TargetArchitecture=$(MONO_ARCH) \
85-
/p:UseLLVM=False \
86-
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
87-
/p:ForceAOT=True \
88+
/p:MonoEnableLLVM=False \
89+
/p:MonoForceInterpreter=true \
90+
/p:DeployAndRun=$(DEPLOY_AND_RUN) \
8891
/p:EnableAppSandbox=$(APP_SANDBOX) \
89-
/p:MonoForceInterpreter=true
92+
/bl
9093

9194
clean:
9295
rm -rf bin

0 commit comments

Comments
 (0)