From 34ae7e3e0c5066ea210f7bef3c32f66f22ae26bf Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 May 2024 16:44:35 +0200 Subject: [PATCH 01/25] Run nativeaot/SmokeTests on MacCatalyst --- .../runtime-extra-platforms-maccatalyst.yml | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index d21dd56df2647..b9f8f0c1080e9 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -77,3 +77,40 @@ jobs: creator: dotnet-bot interpreter: true testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Build the whole product using Native AOT and run runtime tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: coreclr + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isMacCatalystOnlyBuild: ${{ parameters.isMacCatalystOnlyBuild }} + platforms: + - maccatalyst_x64 + - maccatalyst_arm64 + variables: + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: monoContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_NativeAOT_RuntimeTests + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) + timeoutInMinutes: 180 + # extra steps, run tests + extraVariablesTemplates: + - template: /eng/pipelines/common/templates/runtimes/test-variables.yml + parameters: + testGroup: innerloop + postBuildSteps: + - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml + parameters: + creator: dotnet-bot + testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true + testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) From e8566111c2c454f892059d81a0c0bce466a576ca Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 May 2024 17:49:51 +0200 Subject: [PATCH 02/25] Initialize CMAKE_OSX_DEPLOYMENT_TARGET for Swift tests on MacCatalyst --- src/tests/Interop/Swift/SwiftAbiStress/CMakeLists.txt | 5 ++++- .../Interop/Swift/SwiftCallbackAbiStress/CMakeLists.txt | 5 ++++- src/tests/Interop/Swift/SwiftErrorHandling/CMakeLists.txt | 5 ++++- src/tests/Interop/Swift/SwiftInvalidCallConv/CMakeLists.txt | 5 ++++- src/tests/Interop/Swift/SwiftRetAbiStress/CMakeLists.txt | 5 ++++- src/tests/Interop/Swift/SwiftSelfContext/CMakeLists.txt | 5 ++++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/tests/Interop/Swift/SwiftAbiStress/CMakeLists.txt b/src/tests/Interop/Swift/SwiftAbiStress/CMakeLists.txt index 6170fe8367846..6ba90f2aa1794 100644 --- a/src/tests/Interop/Swift/SwiftAbiStress/CMakeLists.txt +++ b/src/tests/Interop/Swift/SwiftAbiStress/CMakeLists.txt @@ -3,9 +3,12 @@ include ("${CLR_INTEROP_TEST_ROOT}/Interop.cmake") set(SOURCE SwiftAbiStress) -if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_OSX) +if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_APPLE) set(SWIFT_PLATFORM "macosx") set(SWIFT_PLATFORM_SUFFIX "") + if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) + set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0") + endif() set(SWIFT_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET}) set(SWIFT_COMPILER_TARGET "${CMAKE_OSX_ARCHITECTURES}-apple-${SWIFT_PLATFORM}${SWIFT_DEPLOYMENT_TARGET}${SWIFT_PLATFORM_SUFFIX}") endif() diff --git a/src/tests/Interop/Swift/SwiftCallbackAbiStress/CMakeLists.txt b/src/tests/Interop/Swift/SwiftCallbackAbiStress/CMakeLists.txt index 283ea0eb65430..4d9806201fb38 100644 --- a/src/tests/Interop/Swift/SwiftCallbackAbiStress/CMakeLists.txt +++ b/src/tests/Interop/Swift/SwiftCallbackAbiStress/CMakeLists.txt @@ -3,9 +3,12 @@ include ("${CLR_INTEROP_TEST_ROOT}/Interop.cmake") set(SOURCE SwiftCallbackAbiStress) -if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_OSX) +if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_APPLE) set(SWIFT_PLATFORM "macosx") set(SWIFT_PLATFORM_SUFFIX "") + if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) + set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0") + endif() set(SWIFT_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET}) set(SWIFT_COMPILER_TARGET "${CMAKE_OSX_ARCHITECTURES}-apple-${SWIFT_PLATFORM}${SWIFT_DEPLOYMENT_TARGET}${SWIFT_PLATFORM_SUFFIX}") endif() diff --git a/src/tests/Interop/Swift/SwiftErrorHandling/CMakeLists.txt b/src/tests/Interop/Swift/SwiftErrorHandling/CMakeLists.txt index 2d07bd3bf745c..dc721fc13c54d 100644 --- a/src/tests/Interop/Swift/SwiftErrorHandling/CMakeLists.txt +++ b/src/tests/Interop/Swift/SwiftErrorHandling/CMakeLists.txt @@ -3,9 +3,12 @@ include ("${CLR_INTEROP_TEST_ROOT}/Interop.cmake") set(SOURCE SwiftErrorHandling) -if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_OSX) +if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_APPLE) set(SWIFT_PLATFORM "macosx") set(SWIFT_PLATFORM_SUFFIX "") + if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) + set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0") + endif() set(SWIFT_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET}) set(SWIFT_COMPILER_TARGET "${CMAKE_OSX_ARCHITECTURES}-apple-${SWIFT_PLATFORM}${SWIFT_DEPLOYMENT_TARGET}${SWIFT_PLATFORM_SUFFIX}") endif() diff --git a/src/tests/Interop/Swift/SwiftInvalidCallConv/CMakeLists.txt b/src/tests/Interop/Swift/SwiftInvalidCallConv/CMakeLists.txt index dea341f587c15..dce97e33c0a6c 100644 --- a/src/tests/Interop/Swift/SwiftInvalidCallConv/CMakeLists.txt +++ b/src/tests/Interop/Swift/SwiftInvalidCallConv/CMakeLists.txt @@ -3,9 +3,12 @@ include ("${CLR_INTEROP_TEST_ROOT}/Interop.cmake") set(SOURCE SwiftInvalidCallConv) -if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_OSX) +if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_APPLE) set(SWIFT_PLATFORM "macosx") set(SWIFT_PLATFORM_SUFFIX "") + if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) + set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0") + endif() set(SWIFT_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET}) set(SWIFT_COMPILER_TARGET "${CMAKE_OSX_ARCHITECTURES}-apple-${SWIFT_PLATFORM}${SWIFT_DEPLOYMENT_TARGET}${SWIFT_PLATFORM_SUFFIX}") endif() diff --git a/src/tests/Interop/Swift/SwiftRetAbiStress/CMakeLists.txt b/src/tests/Interop/Swift/SwiftRetAbiStress/CMakeLists.txt index 9f0e2a3423b2a..ee3e93acd79b8 100644 --- a/src/tests/Interop/Swift/SwiftRetAbiStress/CMakeLists.txt +++ b/src/tests/Interop/Swift/SwiftRetAbiStress/CMakeLists.txt @@ -3,9 +3,12 @@ include ("${CLR_INTEROP_TEST_ROOT}/Interop.cmake") set(SOURCE SwiftRetAbiStress) -if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_OSX) +if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_APPLE) set(SWIFT_PLATFORM "macosx") set(SWIFT_PLATFORM_SUFFIX "") + if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) + set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0") + endif() set(SWIFT_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET}) set(SWIFT_COMPILER_TARGET "${CMAKE_OSX_ARCHITECTURES}-apple-${SWIFT_PLATFORM}${SWIFT_DEPLOYMENT_TARGET}${SWIFT_PLATFORM_SUFFIX}") endif() diff --git a/src/tests/Interop/Swift/SwiftSelfContext/CMakeLists.txt b/src/tests/Interop/Swift/SwiftSelfContext/CMakeLists.txt index 294fcd0e0ba28..61564d1e0a835 100644 --- a/src/tests/Interop/Swift/SwiftSelfContext/CMakeLists.txt +++ b/src/tests/Interop/Swift/SwiftSelfContext/CMakeLists.txt @@ -3,9 +3,12 @@ include ("${CLR_INTEROP_TEST_ROOT}/Interop.cmake") set(SOURCE SwiftSelfContext) -if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_OSX) +if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_APPLE) set(SWIFT_PLATFORM "macosx") set(SWIFT_PLATFORM_SUFFIX "") + if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) + set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0") + endif() set(SWIFT_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET}) set(SWIFT_COMPILER_TARGET "${CMAKE_OSX_ARCHITECTURES}-apple-${SWIFT_PLATFORM}${SWIFT_DEPLOYMENT_TARGET}${SWIFT_PLATFORM_SUFFIX}") endif() From 5d5f3b4e766c6ccdafae929806a636955b14bbcf Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 31 May 2024 09:41:37 +0200 Subject: [PATCH 03/25] Include dotnet sdk for MacCatalyst target --- src/libraries/sendtohelix-mobile.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/sendtohelix-mobile.targets b/src/libraries/sendtohelix-mobile.targets index 0a3a091fdf4fc..bf14d7b4a4dfb 100644 --- a/src/libraries/sendtohelix-mobile.targets +++ b/src/libraries/sendtohelix-mobile.targets @@ -4,7 +4,7 @@ false false - true + true true From 3fc991ac1ca6de37d5c9b48c0d3f62352224298d Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 31 May 2024 10:37:54 +0200 Subject: [PATCH 04/25] Include dotnet sdk for MacCatalyst target --- src/libraries/sendtohelix-mobile.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/sendtohelix-mobile.targets b/src/libraries/sendtohelix-mobile.targets index bf14d7b4a4dfb..f006c968e52df 100644 --- a/src/libraries/sendtohelix-mobile.targets +++ b/src/libraries/sendtohelix-mobile.targets @@ -4,8 +4,8 @@ false false - true - true + true + true From d05f567e1039f92829dd1868019b2fe7c5f75c0f Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 31 May 2024 11:11:02 +0200 Subject: [PATCH 05/25] Include dotnet sdk for MacCatalyst target --- src/libraries/sendtohelix-mobile.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/sendtohelix-mobile.targets b/src/libraries/sendtohelix-mobile.targets index f006c968e52df..987d69cd140c5 100644 --- a/src/libraries/sendtohelix-mobile.targets +++ b/src/libraries/sendtohelix-mobile.targets @@ -5,7 +5,7 @@ false true - true + true @@ -27,7 +27,7 @@ - + true true true From a0861aee1c92d18856b22e32a982e896303959b5 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 31 May 2024 12:05:43 +0200 Subject: [PATCH 06/25] Include dotnet sdk for MacCatalyst target --- src/libraries/sendtohelix-mobile.targets | 4 ++-- src/tests/Common/helixpublishwitharcade.proj | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libraries/sendtohelix-mobile.targets b/src/libraries/sendtohelix-mobile.targets index 987d69cd140c5..3d128ce22a3aa 100644 --- a/src/libraries/sendtohelix-mobile.targets +++ b/src/libraries/sendtohelix-mobile.targets @@ -27,7 +27,7 @@ - + true true true @@ -40,7 +40,7 @@ - + ios-simulator-64 tvos-simulator ios-device diff --git a/src/tests/Common/helixpublishwitharcade.proj b/src/tests/Common/helixpublishwitharcade.proj index b5d5153343897..507bd360870b7 100644 --- a/src/tests/Common/helixpublishwitharcade.proj +++ b/src/tests/Common/helixpublishwitharcade.proj @@ -109,7 +109,7 @@ SuperPmiCollect=$(_SuperPmiCollect) - <_PropertiesToPass Condition="'$(TargetOS)' == 'browser' Or '$(TargetsAndroid)' == 'true' Or '$(TargetsiOS)' == 'true' Or '$(TargetsiOSSimulator)' == 'true' Or '$(TargetstvOS)' == 'true' Or '$(TargetstvOSSimulator)' == 'true'"> + <_PropertiesToPass Condition="'$(TargetOS)' == 'browser' Or '$(TargetsAndroid)' == 'true' Or '$(TargetsAppleMobile)' == 'true'"> $(_PropertiesToPass); IncludeDotNetCli=$(IncludeDotNetCli); DotNetCliRuntime=$(DotNetCliRuntime); @@ -623,7 +623,7 @@ $([System.TimeSpan]::FromMinutes($(TimeoutPerTestInMinutes)).TotalMilliseconds) true <_XUnitParallelMode>collections - <_XUnitParallelMode Condition=" '$(TargetsAndroid)' == 'true' or '$(TargetsiOSSimulator)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOSSimulator)' == 'true' or '$(TargetstvOS)' == 'true'">none + <_XUnitParallelMode Condition=" '$(TargetsAndroid)' == 'true' or '$(TargetsAppleMobile)' == 'true'">none <_XUnitParallelMode Condition=" '$(LongRunningGCTests)' == 'true' ">none <_XUnitParallelMode Condition=" '$(GcSimulatorTests)' == 'true' ">none -parallel $(_XUnitParallelMode) -nocolor -noshadow -xml testResults.xml @@ -761,7 +761,7 @@ - + sos https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/flat2/dotnet-sos/$(DotnetSosVersion)/dotnet-sos.$(DotnetSosVersion).nupkg From b2c3e181544afdc91005c3625c6078aec39940d0 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 31 May 2024 13:35:42 +0200 Subject: [PATCH 07/25] Add maccatalyst target to xharness command --- src/tests/Common/CLRTest.Execute.Bash.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 81a50db81cacc..cba09434785b0 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -64,6 +64,7 @@ WARNING: When setting properties based on their current state (for example: ios-device tvos-simulator tvos-device + maccatalyst Date: Fri, 31 May 2024 15:16:12 +0200 Subject: [PATCH 08/25] Update test runner to support maccatalyst --- src/tests/Common/CLRTest.Execute.Bash.targets | 33 +++++++++++++++++-- .../CoreclrTestWrapperLib.cs | 3 +- src/tests/xunit-wrappers.targets | 8 +++-- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index cba09434785b0..6139a74cbeb90 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -64,7 +64,6 @@ WARNING: When setting properties based on their current state (for example: ios-device tvos-simulator tvos-device - maccatalyst - + + + + diff --git a/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs b/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs index 3b42c400d5769..7548c13f8e56b 100644 --- a/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs +++ b/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs @@ -667,7 +667,7 @@ static unsafe IEnumerable FindChildProcessesByName(Process process, str return children; } - public int RunTest(string executable, string outputFile, string errorFile, string category, string testBinaryBase, string outputDir) + public int RunTest(string executable, string outputFile, string errorFile, string appFilename, string category, string testBinaryBase, string outputDir) { Debug.Assert(outputFile != errorFile); @@ -709,6 +709,7 @@ public int RunTest(string executable, string outputFile, string errorFile, strin process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.StartInfo.EnvironmentVariables.Add("__Category", category); + process.StartInfo.EnvironmentVariables.Add("__AppFilename", appFilename); process.StartInfo.EnvironmentVariables.Add("__TestBinaryBase", testBinaryBase); process.StartInfo.EnvironmentVariables.Add("__OutputDir", outputDir); diff --git a/src/tests/xunit-wrappers.targets b/src/tests/xunit-wrappers.targets index ebc92dcc2d348..e0b429ccaa3f4 100644 --- a/src/tests/xunit-wrappers.targets +++ b/src/tests/xunit-wrappers.targets @@ -131,6 +131,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). internal static string reportBase%3B internal static string testBinaryBase%3B internal static string coreRoot%3B + internal static string appFilename%3B internal static string category%3B internal static string helixUploadRoot%3B @@ -139,6 +140,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). reportBase = Environment.GetEnvironmentVariable(%22XunitTestReportDirBase%22)%3B testBinaryBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)%3B coreRoot = Environment.GetEnvironmentVariable(%22CORE_ROOT%22)%3B + appFilename = "$(Category)"%3B category = "$([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").Replace("-","_"))"%3B helixUploadRoot = Environment.GetEnvironmentVariable(%22HELIX_WORKITEM_UPLOAD_ROOT%22)%3B if (!String.IsNullOrEmpty(helixUploadRoot)) { @@ -185,6 +187,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). public string reportBase%3B public string testBinaryBase%3B public string coreRoot%3B + public string appFilename%3B public string category%3B public string helixUploadRoot%3B public MobileAppHandler handler = new MobileAppHandler()%3B @@ -194,6 +197,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). reportBase = Environment.GetEnvironmentVariable(%22XunitTestReportDirBase%22)%3B testBinaryBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)%3B coreRoot = Environment.GetEnvironmentVariable(%22CORE_ROOT%22)%3B + appFilename = "$(Category)"%3B category = "$([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").Replace("-","_"))"%3B helixUploadRoot = Environment.GetEnvironmentVariable(%22HELIX_WORKITEM_UPLOAD_ROOT%22)%3B int retCode = -100%3B @@ -316,7 +320,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). System.IO.Directory.CreateDirectory(_Global.reportBase + testSubfolder)%3B - ret = wrapper.RunTest(testExecutable, outputFile, errorFile, _Global.category, _Global.testBinaryBase, outputDir)%3B + ret = wrapper.RunTest(testExecutable, outputFile, errorFile, _Global.appFilename, _Global.category, _Global.testBinaryBase, outputDir)%3B } catch (Exception ex) { @@ -423,7 +427,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). System.IO.Directory.CreateDirectory(globalVar.reportBase + testSubfolder)%3B - ret = wrapper.RunTest(testExecutable, outputFile, errorFile, globalVar.category, globalVar.testBinaryBase, outputDir)%3B + ret = wrapper.RunTest(testExecutable, outputFile, errorFile, globalVar.appFilename, globalVar.category, globalVar.testBinaryBase, outputDir)%3B } catch (Exception ex) { From 10cb54512e1b2b5f9bb0caedd6a7641c8d8ed3ea Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 31 May 2024 16:23:30 +0200 Subject: [PATCH 09/25] Fix app path --- src/tests/Common/CLRTest.Execute.Bash.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 6139a74cbeb90..f89dc6576ad8b 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -506,7 +506,7 @@ else fi $__Command $HARNESS_RUNNER apple test %5c - --app="{__TestBinaryBase}/${__AppFilename}.app" %5c + --app="${__TestBinaryBase}/${__Category}.app" %5c --output-directory="$__OutputDir" %5c --target maccatalyst %5c --timeout 01:15:00 From 21292b3505b165667244aa03de8c8714a358f583 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 31 May 2024 17:12:16 +0200 Subject: [PATCH 10/25] Fix app path --- src/tests/Common/CLRTest.Execute.Bash.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index f89dc6576ad8b..7119a4c99ab7d 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -506,7 +506,7 @@ else fi $__Command $HARNESS_RUNNER apple test %5c - --app="${__TestBinaryBase}/${__Category}.app" %5c + --app="${__TestBinaryBase}/${__AppFilename}/${__Category}.app" %5c --output-directory="$__OutputDir" %5c --target maccatalyst %5c --timeout 01:15:00 From a26f16ab09e2f40796f28ee157ad60447816c9f5 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 5 Jun 2024 12:09:20 +0200 Subject: [PATCH 11/25] Fix app path and update test runner --- src/tests/Common/CLRTest.Execute.Bash.targets | 4 +--- src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 7119a4c99ab7d..b96c3ee232b1d 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -506,12 +506,10 @@ else fi $__Command $HARNESS_RUNNER apple test %5c - --app="${__TestBinaryBase}/${__AppFilename}/${__Category}.app" %5c + --app="${__TestBinaryBase}/${__Category}.app" %5c --output-directory="$__OutputDir" %5c --target maccatalyst %5c --timeout 01:15:00 - --launch-timeout 01:15:00 - -v CLRTestExitCode=$? # Exit code of xharness is zero when tests finished successfully diff --git a/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs b/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs index 66937878587dd..725e222f2fe14 100644 --- a/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs +++ b/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs @@ -86,7 +86,7 @@ public static void RunOutOfProcessTest(string assemblyPath, string testPathPrefi System.IO.Directory.CreateDirectory(outputDir); - ret = wrapper.RunTest(testExecutable, outputFile, errorFile, Assembly.GetEntryAssembly()!.FullName!, testBinaryBase, outputDir); + ret = wrapper.RunTest(testExecutable, outputFile, errorFile, string.Empty, Assembly.GetEntryAssembly()!.FullName!, testBinaryBase, outputDir); } catch (Exception ex) { From f66559f784e9e4eb384b3018f4cb121491868192 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 6 Jun 2024 14:46:30 +0200 Subject: [PATCH 12/25] Fix contents path --- src/tests/build.proj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tests/build.proj b/src/tests/build.proj index 0222d6b95a6bc..3cb9eb7bae11b 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -467,7 +467,9 @@ - + + + From 0e2838713319daf1cb46507f658f08308a606103 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 6 Jun 2024 17:18:41 +0200 Subject: [PATCH 13/25] Add --xcode option to xharness command --- src/tests/Common/CLRTest.Execute.Bash.targets | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index b96c3ee232b1d..d480748534d70 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -509,7 +509,10 @@ $__Command $HARNESS_RUNNER apple test %5c --app="${__TestBinaryBase}/${__Category}.app" %5c --output-directory="$__OutputDir" %5c --target maccatalyst %5c - --timeout 01:15:00 + --timeout 01:15:00 %5c + --launch-timeout 01:15:00 %5c + --xcode /Applications/Xcode131.app %5c + -v CLRTestExitCode=$? # Exit code of xharness is zero when tests finished successfully From c7eb67fcebf1966db858d8b067da7edf2ed651b1 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 7 Jun 2024 10:28:23 +0200 Subject: [PATCH 14/25] Fix app path --- src/tests/Common/CLRTest.Execute.Bash.targets | 1 - src/tests/build.proj | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index d480748534d70..1f7ce3915c043 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -511,7 +511,6 @@ $__Command $HARNESS_RUNNER apple test %5c --target maccatalyst %5c --timeout 01:15:00 %5c --launch-timeout 01:15:00 %5c - --xcode /Applications/Xcode131.app %5c -v CLRTestExitCode=$? diff --git a/src/tests/build.proj b/src/tests/build.proj index 3cb9eb7bae11b..fd689ed54ea81 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -469,6 +469,7 @@ + From 6090f8b42150786d9058b5a120f70801b43e7cb5 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 7 Jun 2024 13:36:42 +0200 Subject: [PATCH 15/25] Fix test runner for MacCatalyst target --- src/tests/Common/CLRTest.Execute.Bash.targets | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 1f7ce3915c043..23205302d972e 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -505,12 +505,11 @@ else HARNESS_RUNNER="xharness" fi -$__Command $HARNESS_RUNNER apple test %5c +$__Command $HARNESS_RUNNER apple run %5c --app="${__TestBinaryBase}/${__Category}.app" %5c --output-directory="$__OutputDir" %5c - --target maccatalyst %5c - --timeout 01:15:00 %5c - --launch-timeout 01:15:00 %5c + --expected-exit-code=100 %5c + --targets maccatalyst %5c -v CLRTestExitCode=$? From 01abe70b23b147dad647dc4d81589789a2365b3b Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 7 Jun 2024 15:34:41 +0200 Subject: [PATCH 16/25] Revert changes --- .../Common/CoreCLRTestLibrary/OutOfProcessTest.cs | 2 +- .../Coreclr.TestWrapper/CoreclrTestWrapperLib.cs | 3 +-- src/tests/build.proj | 14 ++++++-------- src/tests/xunit-wrappers.targets | 8 ++------ 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs b/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs index 725e222f2fe14..66937878587dd 100644 --- a/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs +++ b/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs @@ -86,7 +86,7 @@ public static void RunOutOfProcessTest(string assemblyPath, string testPathPrefi System.IO.Directory.CreateDirectory(outputDir); - ret = wrapper.RunTest(testExecutable, outputFile, errorFile, string.Empty, Assembly.GetEntryAssembly()!.FullName!, testBinaryBase, outputDir); + ret = wrapper.RunTest(testExecutable, outputFile, errorFile, Assembly.GetEntryAssembly()!.FullName!, testBinaryBase, outputDir); } catch (Exception ex) { diff --git a/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs b/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs index 7548c13f8e56b..3b42c400d5769 100644 --- a/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs +++ b/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs @@ -667,7 +667,7 @@ static unsafe IEnumerable FindChildProcessesByName(Process process, str return children; } - public int RunTest(string executable, string outputFile, string errorFile, string appFilename, string category, string testBinaryBase, string outputDir) + public int RunTest(string executable, string outputFile, string errorFile, string category, string testBinaryBase, string outputDir) { Debug.Assert(outputFile != errorFile); @@ -709,7 +709,6 @@ public int RunTest(string executable, string outputFile, string errorFile, strin process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.StartInfo.EnvironmentVariables.Add("__Category", category); - process.StartInfo.EnvironmentVariables.Add("__AppFilename", appFilename); process.StartInfo.EnvironmentVariables.Add("__TestBinaryBase", testBinaryBase); process.StartInfo.EnvironmentVariables.Add("__OutputDir", outputDir); diff --git a/src/tests/build.proj b/src/tests/build.proj index fd689ed54ea81..622438aa376af 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -460,17 +460,15 @@ - + - + - - - - + + + + diff --git a/src/tests/xunit-wrappers.targets b/src/tests/xunit-wrappers.targets index e0b429ccaa3f4..ebc92dcc2d348 100644 --- a/src/tests/xunit-wrappers.targets +++ b/src/tests/xunit-wrappers.targets @@ -131,7 +131,6 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). internal static string reportBase%3B internal static string testBinaryBase%3B internal static string coreRoot%3B - internal static string appFilename%3B internal static string category%3B internal static string helixUploadRoot%3B @@ -140,7 +139,6 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). reportBase = Environment.GetEnvironmentVariable(%22XunitTestReportDirBase%22)%3B testBinaryBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)%3B coreRoot = Environment.GetEnvironmentVariable(%22CORE_ROOT%22)%3B - appFilename = "$(Category)"%3B category = "$([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").Replace("-","_"))"%3B helixUploadRoot = Environment.GetEnvironmentVariable(%22HELIX_WORKITEM_UPLOAD_ROOT%22)%3B if (!String.IsNullOrEmpty(helixUploadRoot)) { @@ -187,7 +185,6 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). public string reportBase%3B public string testBinaryBase%3B public string coreRoot%3B - public string appFilename%3B public string category%3B public string helixUploadRoot%3B public MobileAppHandler handler = new MobileAppHandler()%3B @@ -197,7 +194,6 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). reportBase = Environment.GetEnvironmentVariable(%22XunitTestReportDirBase%22)%3B testBinaryBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)%3B coreRoot = Environment.GetEnvironmentVariable(%22CORE_ROOT%22)%3B - appFilename = "$(Category)"%3B category = "$([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").Replace("-","_"))"%3B helixUploadRoot = Environment.GetEnvironmentVariable(%22HELIX_WORKITEM_UPLOAD_ROOT%22)%3B int retCode = -100%3B @@ -320,7 +316,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). System.IO.Directory.CreateDirectory(_Global.reportBase + testSubfolder)%3B - ret = wrapper.RunTest(testExecutable, outputFile, errorFile, _Global.appFilename, _Global.category, _Global.testBinaryBase, outputDir)%3B + ret = wrapper.RunTest(testExecutable, outputFile, errorFile, _Global.category, _Global.testBinaryBase, outputDir)%3B } catch (Exception ex) { @@ -427,7 +423,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). System.IO.Directory.CreateDirectory(globalVar.reportBase + testSubfolder)%3B - ret = wrapper.RunTest(testExecutable, outputFile, errorFile, globalVar.appFilename, globalVar.category, globalVar.testBinaryBase, outputDir)%3B + ret = wrapper.RunTest(testExecutable, outputFile, errorFile, globalVar.category, globalVar.testBinaryBase, outputDir)%3B } catch (Exception ex) { From 0ce9e02db86952b63911e30e4f769b9d96ffe9e4 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 11 Jun 2024 15:33:13 +0200 Subject: [PATCH 17/25] Remove BuildNativeAOTRuntimePack prop --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 2 +- .../runtime-extra-platforms-ioslikesimulator.yml | 2 +- .../extra-platforms/runtime-extra-platforms-maccatalyst.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 9794c736e2e82..3d4e20590f656 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -163,5 +163,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true + testBuildArgs: tree nativeaot/SmokeTests testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index 7ce0a0c3568aa..dd427c0ceafcc 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -137,5 +137,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true + testBuildArgs: tree nativeaot/SmokeTests testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index b9f8f0c1080e9..1615e053700d3 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -112,5 +112,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true + testBuildArgs: tree nativeaot/SmokeTests testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) From 8d8f9bd26d3a48d40b6876c3c4f40b5fb2b4a977 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 11 Jun 2024 15:33:49 +0200 Subject: [PATCH 18/25] Add App Sandbox entitlement tests --- .../runtime-extra-platforms-maccatalyst.yml | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index 1615e053700d3..8ffdb8eb9406f 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -114,3 +114,40 @@ jobs: creator: dotnet-bot testBuildArgs: tree nativeaot/SmokeTests testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) + +# +# Build the whole product using Native AOT with the App Sandbox entitlement and run runtime tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: coreclr + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isMacCatalystOnlyBuild: ${{ parameters.isMacCatalystOnlyBuild }} + platforms: + - maccatalyst_x64 + - maccatalyst_arm64 + variables: + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: monoContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_NativeAOT_RuntimeTests_AppSandbox + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) + timeoutInMinutes: 180 + # extra steps, run tests + extraVariablesTemplates: + - template: /eng/pipelines/common/templates/runtimes/test-variables.yml + parameters: + testGroup: innerloop + postBuildSteps: + - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml + parameters: + creator: dotnet-bot + testBuildArgs: tree nativeaot/SmokeTests /p:EnableAppSandbox=true + testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) From 9ec56c47ff633db7ff85f3eca6ab4f34f8cbc72b Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 12 Jun 2024 13:05:31 +0200 Subject: [PATCH 19/25] Add BuildNativeAOTRuntimePack property --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 2 +- .../runtime-extra-platforms-ioslikesimulator.yml | 2 +- .../extra-platforms/runtime-extra-platforms-maccatalyst.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 3d4e20590f656..9794c736e2e82 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -163,5 +163,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests + testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index dd427c0ceafcc..7ce0a0c3568aa 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -137,5 +137,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests + testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index 8ffdb8eb9406f..ff85b06e8a8f2 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -112,7 +112,7 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests + testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) # @@ -149,5 +149,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:EnableAppSandbox=true + testBuildArgs: tree nativeaot/SmokeTests /p:EnableAppSandbox=true /p:BuildNativeAOTRuntimePack=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) From 0329bd6f7ad5deb4af587f72c67dc37b403bf7a2 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 12 Jun 2024 13:18:50 +0200 Subject: [PATCH 20/25] Move BuildNativeAOTRuntimePack to build args --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 4 ++-- .../runtime-extra-platforms-ioslikesimulator.yml | 4 ++-- .../runtime-extra-platforms-maccatalyst.yml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 9794c736e2e82..f598aecfa0e63 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -153,7 +153,7 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_RuntimeTests timeoutInMinutes: 480 - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) /p:BuildNativeAOTRuntimePack=true # extra steps, run tests extraVariablesTemplates: - template: /eng/pipelines/common/templates/runtimes/test-variables.yml @@ -163,5 +163,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true + testBuildArgs: tree nativeaot/SmokeTests testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index 7ce0a0c3568aa..a85464da205fe 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -127,7 +127,7 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_RuntimeTests timeoutInMinutes: 240 - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) /p:BuildNativeAOTRuntimePack=true # extra steps, run tests extraVariablesTemplates: - template: /eng/pipelines/common/templates/runtimes/test-variables.yml @@ -137,5 +137,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true + testBuildArgs: tree nativeaot/SmokeTests testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index ff85b06e8a8f2..3341e0e229ba9 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -101,7 +101,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_RuntimeTests - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) /p:BuildNativeAOTRuntimePack=true timeoutInMinutes: 180 # extra steps, run tests extraVariablesTemplates: @@ -112,7 +112,7 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true + testBuildArgs: tree nativeaot/SmokeTests testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) # @@ -138,7 +138,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_RuntimeTests_AppSandbox - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) /p:BuildNativeAOTRuntimePack=true timeoutInMinutes: 180 # extra steps, run tests extraVariablesTemplates: @@ -149,5 +149,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:EnableAppSandbox=true /p:BuildNativeAOTRuntimePack=true + testBuildArgs: tree nativeaot/SmokeTests /p:EnableAppSandbox=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) From c3072fc967204e022174bb5ff6b06a754444b23a Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 12 Jun 2024 17:49:27 +0200 Subject: [PATCH 21/25] Revert changes --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 4 ++-- .../runtime-extra-platforms-ioslikesimulator.yml | 4 ++-- .../runtime-extra-platforms-maccatalyst.yml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index f598aecfa0e63..9794c736e2e82 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -153,7 +153,7 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_RuntimeTests timeoutInMinutes: 480 - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) /p:BuildNativeAOTRuntimePack=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) # extra steps, run tests extraVariablesTemplates: - template: /eng/pipelines/common/templates/runtimes/test-variables.yml @@ -163,5 +163,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests + testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index a85464da205fe..7ce0a0c3568aa 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -127,7 +127,7 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_RuntimeTests timeoutInMinutes: 240 - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) /p:BuildNativeAOTRuntimePack=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) # extra steps, run tests extraVariablesTemplates: - template: /eng/pipelines/common/templates/runtimes/test-variables.yml @@ -137,5 +137,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests + testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index 3341e0e229ba9..827bb0bfc6927 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -101,7 +101,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_RuntimeTests - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) /p:BuildNativeAOTRuntimePack=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) timeoutInMinutes: 180 # extra steps, run tests extraVariablesTemplates: @@ -112,7 +112,7 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests + testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) # @@ -138,7 +138,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_RuntimeTests_AppSandbox - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) /p:BuildNativeAOTRuntimePack=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) timeoutInMinutes: 180 # extra steps, run tests extraVariablesTemplates: @@ -149,5 +149,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:EnableAppSandbox=true + testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true /p:EnableAppSandbox=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) From 798a7c4926d97d404de6c19925d59f0da9a07029 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Fri, 19 Jul 2024 09:08:38 +0200 Subject: [PATCH 22/25] Adjust SwiftIndirectResult tests makefile --- src/tests/Interop/Swift/SwiftIndirectResult/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tests/Interop/Swift/SwiftIndirectResult/CMakeLists.txt b/src/tests/Interop/Swift/SwiftIndirectResult/CMakeLists.txt index 7490bbf39ce62..d073b6fc147cd 100644 --- a/src/tests/Interop/Swift/SwiftIndirectResult/CMakeLists.txt +++ b/src/tests/Interop/Swift/SwiftIndirectResult/CMakeLists.txt @@ -3,9 +3,12 @@ include ("${CLR_INTEROP_TEST_ROOT}/Interop.cmake") set(SOURCE SwiftIndirectResult) -if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_OSX) +if (NOT SWIFT_COMPILER_TARGET AND CLR_CMAKE_TARGET_APPLE) set(SWIFT_PLATFORM "macosx") set(SWIFT_PLATFORM_SUFFIX "") + if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) + set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0") + endif() set(SWIFT_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET}) set(SWIFT_COMPILER_TARGET "${CMAKE_OSX_ARCHITECTURES}-apple-${SWIFT_PLATFORM}${SWIFT_DEPLOYMENT_TARGET}${SWIFT_PLATFORM_SUFFIX}") endif() From fdb481339dd22d206c86d3b5a715c09d5dd4540c Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Fri, 19 Jul 2024 09:10:09 +0200 Subject: [PATCH 23/25] Set adhoc provisioning profile --- .../extra-platforms/runtime-extra-platforms-maccatalyst.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index 827bb0bfc6927..8c9d16d9701ae 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -149,5 +149,5 @@ jobs: - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true /p:EnableAppSandbox=true + testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true /p:DevTeamProvisioning=adhoc /p:EnableAppSandbox=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) From 97159f36368095a29ad3f120968d41f202681de4 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Fri, 19 Jul 2024 15:08:51 +0200 Subject: [PATCH 24/25] Fix passing DevTeamProvisioning property down the build chain for NativeAOT runtime tests --- src/tests/build.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/build.proj b/src/tests/build.proj index 622438aa376af..5ea8d9ceca443 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -431,7 +431,7 @@ - - + - true true $(AppDir) From b906a65fcf81bc3667aba3c2a3aefb65eb3702b4 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Fri, 19 Jul 2024 15:09:18 +0200 Subject: [PATCH 25/25] Do not try to sign files that do not exist --- .../Templates/CMakeLists-librarymode.txt.template | 2 +- src/tasks/AppleAppBuilder/Templates/CMakeLists.txt.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tasks/AppleAppBuilder/Templates/CMakeLists-librarymode.txt.template b/src/tasks/AppleAppBuilder/Templates/CMakeLists-librarymode.txt.template index 2b40c6dd1b4ef..d8ac7dcaaecf0 100644 --- a/src/tasks/AppleAppBuilder/Templates/CMakeLists-librarymode.txt.template +++ b/src/tasks/AppleAppBuilder/Templates/CMakeLists-librarymode.txt.template @@ -50,7 +50,7 @@ if("${HARDENED_RUNTIME}") set_target_properties(%ProjectName% PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "app.entitlements") add_custom_command( TARGET %ProjectName% POST_BUILD - COMMAND if test \"$CODE_SIGN_IDENTITY\"\; then codesign -fs \"$CODE_SIGN_IDENTITY\" $CODESIGNING_FOLDER_PATH/Contents/Resources/*.dylib\; fi + COMMAND if test \"$CODE_SIGN_IDENTITY\" && ls -1 $CODESIGNING_FOLDER_PATH/Contents/Resources/*.dylib 2>/dev/null | grep -q .\; then codesign -fs \"$CODE_SIGN_IDENTITY\" $CODESIGNING_FOLDER_PATH/Contents/Resources/*.dylib\; fi ) endif() endif() diff --git a/src/tasks/AppleAppBuilder/Templates/CMakeLists.txt.template b/src/tasks/AppleAppBuilder/Templates/CMakeLists.txt.template index 614d9a7cf64fb..ec1bc10bc833b 100644 --- a/src/tasks/AppleAppBuilder/Templates/CMakeLists.txt.template +++ b/src/tasks/AppleAppBuilder/Templates/CMakeLists.txt.template @@ -59,7 +59,7 @@ if("${HARDENED_RUNTIME}") set_target_properties(%ProjectName% PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "app.entitlements") add_custom_command( TARGET %ProjectName% POST_BUILD - COMMAND if test \"$CODE_SIGN_IDENTITY\"\; then codesign -fs \"$CODE_SIGN_IDENTITY\" $CODESIGNING_FOLDER_PATH/Contents/Resources/*.dylib\; fi + COMMAND if test \"$CODE_SIGN_IDENTITY\" && ls -1 $CODESIGNING_FOLDER_PATH/Contents/Resources/*.dylib 2>/dev/null | grep -q .\; then codesign -fs \"$CODE_SIGN_IDENTITY\" $CODESIGNING_FOLDER_PATH/Contents/Resources/*.dylib\; fi ) endif() endif()