diff --git a/eng/pipelines/performance/templates/build-perf-sample-apps.yml b/eng/pipelines/performance/templates/build-perf-sample-apps.yml index f3a8eb3a3acf2d..3c442e15bf49ed 100644 --- a/eng/pipelines/performance/templates/build-perf-sample-apps.yml +++ b/eng/pipelines/performance/templates/build-perf-sample-apps.yml @@ -210,6 +210,31 @@ steps: archiveExtension: '.zip' archiveType: zip + - ${{ if and(eq(parameters.osGroup, 'ios'), eq(parameters.runtimeType, 'coreclr')) }}: + # CoreCLR Interpreter Build + - script: make build-appbundle TARGET_OS=ios TARGET_ARCH=arm64 BUILD_CONFIG=Checked DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=false USE_MONO_RUNTIME=false AOT=false + env: + DevTeamProvisioning: '-' + workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS + displayName: Build HelloiOS sample app + - task: PublishBuildArtifacts@1 + condition: succeededOrFailed() + displayName: 'Publish binlog' + inputs: + pathtoPublish: $(Build.SourcesDirectory)/src/mono/sample/iOS/msbuild.binlog + artifactName: iOSCoreCLRArm64BuildLog + - template: /eng/pipelines/common/upload-artifact-step.yml + parameters: + rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/Bundle/HelloiOS/Debug-iphoneos/HelloiOS.app + includeRootFolder: true + displayName: iOS Sample App + artifactName: iOSSampleApp + archiveExtension: '.zip' + archiveType: zip + - script: rm -r -f $(Build.SourcesDirectory)/src/mono/sample/iOS/bin + workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS + displayName: Clean bindir + - ${{ if and(eq(parameters.osGroup, 'ios'), eq(parameters.nameSuffix, 'iOSNativeAOT')) }}: - script: make hello-app TARGET_OS=ios TARGET_ARCH=arm64 BUILD_CONFIG=Release DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=false env: diff --git a/eng/pipelines/performance/templates/perf-ios-scenarios-build-jobs.yml b/eng/pipelines/performance/templates/perf-ios-scenarios-build-jobs.yml index 85cff56fdc4c62..d6eea615adc807 100644 --- a/eng/pipelines/performance/templates/perf-ios-scenarios-build-jobs.yml +++ b/eng/pipelines/performance/templates/perf-ios-scenarios-build-jobs.yml @@ -1,6 +1,7 @@ parameters: hybridGlobalization: true mono: false + coreclr: false nativeAot: false jobs: @@ -22,6 +23,25 @@ jobs: parameters: hybridGlobalization: ${{ parameters.hybridGlobalization }} + - ${{ if eq(parameters.coreclr, true) }}: + # build CoreCLR iOS scenarios + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + buildConfig: checked + runtimeFlavor: coreclr + platforms: + - ios_arm64 + jobParameters: + buildArgs: -s clr+clr.runtime+libs+packs -c $(_BuildConfig) + nameSuffix: iOSCoreCLR + isOfficialBuild: false + postBuildSteps: + - template: /eng/pipelines/performance/templates/build-perf-sample-apps.yml + parameters: + hybridGlobalization: ${{ parameters.hybridGlobalization }} + runtimeType: coreclr + - ${{ if eq(parameters.nativeAot, true) }}: # build NativeAOT iOS scenarios HybridGlobalization - template: /eng/pipelines/common/platform-matrix.yml diff --git a/src/mono/sample/iOS/Makefile b/src/mono/sample/iOS/Makefile index b7e85dce7a26f2..03e3de5b8f0ee6 100644 --- a/src/mono/sample/iOS/Makefile +++ b/src/mono/sample/iOS/Makefile @@ -10,6 +10,8 @@ DEPLOY_AND_RUN?=true APP_SANDBOX?=false STRIP_DEBUG_SYMBOLS?=false # only used when measuring SOD via build-appbundle make target HYBRID_GLOBALIZATION?=true +USE_MONO_RUNTIME?=true +AOT?=true #If DIAGNOSTIC_PORTS is enabled, @(RuntimeComponents) must also include 'diagnostics_tracing'. #If @(RuntimeComponents) includes 'diagnostics_tracing', DIAGNOSTIC_PORTS is optional. @@ -42,6 +44,8 @@ build-appbundle: clean appbuilder /p:StripDebugSymbols=$(STRIP_DEBUG_SYMBOLS) \ /p:DeployAndRun=false \ /p:HybridGlobalization=$(HYBRID_GLOBALIZATION) \ + /p:RunAOTCompilation=$(AOT) \ + /p:UseMonoRuntime=$(USE_MONO_RUNTIME) \ /bl run: clean appbuilder diff --git a/src/mono/sample/iOS/Program.cs b/src/mono/sample/iOS/Program.cs index 7b69b43a358f80..e8b9d0658418b3 100644 --- a/src/mono/sample/iOS/Program.cs +++ b/src/mono/sample/iOS/Program.cs @@ -21,8 +21,8 @@ public static class Program private static void SetText(string txt) { byte[] ascii = ASCIIEncoding.ASCII.GetBytes(txt); - - unsafe + + unsafe { fixed (byte* asciiPtr = ascii) { @@ -37,7 +37,14 @@ private static void OnButtonClick() { SetText("OnButtonClick! #" + counter++); } - +#if CORECLR_TEST + public static int Main(string[] args) + { + Console.WriteLine("Done!"); + Thread.Sleep(Timeout.Infinite); + return 42; + } +#else #if CI_TEST public static async Task Main(string[] args) #else @@ -63,6 +70,7 @@ public static async Task Main(string[] args) return 42; #else await Task.Delay(-1); -#endif +#endif } +#endif } diff --git a/src/mono/sample/iOS/Program.csproj b/src/mono/sample/iOS/Program.csproj index ad1fa59aa6f906..6e97cd8896e226 100644 --- a/src/mono/sample/iOS/Program.csproj +++ b/src/mono/sample/iOS/Program.csproj @@ -6,6 +6,7 @@ iossimulator $(TargetOS)-$(TargetArchitecture) $(DefineConstants);CI_TEST + $(DefineConstants);CORECLR_TEST HelloiOS $(AssemblyName).dll true @@ -28,6 +29,9 @@ + + +