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

[mono][tests] Parallel AOT compilation of runtime tests on iOS platforms #86089

Merged
merged 90 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from 89 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
9d0b8fc
Run iOS runtime tests only
kotlarmilos May 11, 2023
5535ca0
Run iOS runtime tests only
kotlarmilos May 11, 2023
fbcf861
Run iOS runtime tests only
kotlarmilos May 11, 2023
9f088ca
Test /eng/pipelines/libraries/helix.yml for runtime tests
kotlarmilos May 11, 2023
6f93d39
Merge branch 'main' into feature/parallel-aot-compilation
kotlarmilos May 15, 2023
e12ca4d
Resolve PR conflicts
kotlarmilos May 15, 2023
439e829
Update ProxyProjectForAOTOnHelix.proj to be compliant with runtime tests
kotlarmilos May 19, 2023
7677f70
Merge branch 'main' into feature/parallel-aot-compilation
kotlarmilos May 19, 2023
10a9066
Disable CI jobs
kotlarmilos May 19, 2023
9c90cb1
Parametrize UseLLVM in MonoAOTCompiler
kotlarmilos May 19, 2023
6141023
Revert extraStepsTemplate for iOS
kotlarmilos May 22, 2023
b7c3fb2
Merge branch 'main' into feature/parallel-aot-compilation
kotlarmilos May 22, 2023
8672840
Disable other tests
kotlarmilos May 22, 2023
fe40f9b
Build src/tests/tracing dir
kotlarmilos May 22, 2023
779a39a
Build src/tests/tracing dir
kotlarmilos May 22, 2023
1e66f9d
Remove testBuildArgs param
kotlarmilos May 22, 2023
a60be9d
Merge branch 'main' into feature/parallel-aot-compilation
kotlarmilos May 30, 2023
3ad22d4
Disable other tests
kotlarmilos May 30, 2023
9ccf1fc
Fix OutDir path to allow bundle archive
kotlarmilos May 30, 2023
eab4658
Copy app publish payload to legacy payload root directory
kotlarmilos May 30, 2023
6db8ce0
Copy app publish payload to legacy payload root directory
kotlarmilos May 30, 2023
38d1df4
Add verbose logs
kotlarmilos May 30, 2023
f8d65c5
Temporary path to test the CI
kotlarmilos May 31, 2023
c3852de
Temporary path to test the CI
kotlarmilos May 31, 2023
a52453a
Merge branch 'dotnet:main' into feature/parallel-aot-compilation
kotlarmilos Jun 6, 2023
1a98364
Test libraries pipeline on runtime tests
kotlarmilos Jun 6, 2023
f0349ca
Test libraries pipeline on runtime tests
kotlarmilos Jun 6, 2023
b6d40c5
Merge branch 'main' into feature/parallel-aot-compilation
kotlarmilos Jun 6, 2023
390688f
Disable other tests
kotlarmilos Jun 6, 2023
3e1dd67
Merge branch 'dotnet:main' into feature/parallel-aot-compilation
kotlarmilos Jun 7, 2023
91b11d5
Merge branch 'main' into feature/parallel-aot-compilation
kotlarmilos Jun 13, 2023
62955a9
Disable tests
kotlarmilos Jun 13, 2023
5277908
Merge branch 'dotnet:main' into feature/parallel-aot-compilation
kotlarmilos Jun 15, 2023
4bf974b
Merge branch 'dotnet:main' into feature/parallel-aot-compilation
kotlarmilos Jun 19, 2023
8895f9d
Merge branch 'main' into feature/parallel-aot-compilation
kotlarmilos Jun 24, 2023
fd02ec3
Update the runtime tests to use sendtohelix proj
kotlarmilos Jun 24, 2023
8b44a0e
Merge branch 'feature/parallel-aot-compilation' of github.com:kotlarm…
kotlarmilos Jun 24, 2023
bc75d22
Disable CI jobs
kotlarmilos Jun 24, 2023
eb82350
Customize sendtohelix params
kotlarmilos Jun 24, 2023
bdd2100
Enable JustInterpreter AOT mode for tracing/eventpipe
kotlarmilos Jun 24, 2023
69e1034
Add _AOTMode and MonoForceInterpreter values to test the CI
kotlarmilos Jun 25, 2023
97e472e
Don't use MainLibraryFileName property for the runtime tests
kotlarmilos Jun 25, 2023
6e91da5
Test xunit command
kotlarmilos Jun 26, 2023
89ed4c2
Test MainLibraryFileName property to run the app
kotlarmilos Jun 26, 2023
05b1319
Test MainLibraryFileName property to run the app
kotlarmilos Jun 26, 2023
f0bed59
Pass --set-env parameter to set the entry point for the bundle
kotlarmilos Jun 27, 2023
84d52cf
Merge branch 'main' of github.com:kotlarmilos/runtime into feature/pa…
kotlarmilos Jun 27, 2023
3ce2505
Remove MainLibraryFileName to test the CI
kotlarmilos Jun 27, 2023
2ab515f
Add test-specific AOT properties and ensure log test separation
kotlarmilos Jun 27, 2023
8fcc3e1
Add test-specific props
kotlarmilos Jun 30, 2023
bcdbed1
Merge branch 'main' into feature/parallel-aot-compilation
kotlarmilos Jul 10, 2023
a708bf5
Expand test coverage
kotlarmilos Jul 11, 2023
db90487
Ignore disabled tests
kotlarmilos Jul 11, 2023
aadc66b
Disable failing tests
kotlarmilos Jul 11, 2023
e8cb167
Code cleanup
kotlarmilos Jul 12, 2023
7678ecf
Add compileOnHelix parameter
kotlarmilos Jul 12, 2023
c27444d
Pass interpreter parameter
kotlarmilos Jul 12, 2023
89aea02
Use interp when AOT compiling runtime tests
kotlarmilos Jul 13, 2023
39c7b01
Use interp when AOT compiling runtime tests
kotlarmilos Jul 13, 2023
82e2d00
Remove RuntimeComponents and DiagnosticPorts from the Helix payload
kotlarmilos Jul 13, 2023
705bfa2
Remove assembly filtering
kotlarmilos Jul 13, 2023
d6406c7
Use libraries/helix.yml template for AOT on Helix
kotlarmilos Jul 14, 2023
ca10c8b
Refactor the pipeline to remove redundant props
kotlarmilos Jul 14, 2023
e1bea4b
Merge branch 'dotnet:main' into feature/parallel-aot-compilation
kotlarmilos Jul 14, 2023
adfcd75
Merge branch 'main' into feature/parallel-aot-compilation
kotlarmilos Jul 14, 2023
6056497
Modify the build configuration and skip recursive paths in library tests
kotlarmilos Jul 14, 2023
b2a4461
Run Helix targets after the build
kotlarmilos Jul 14, 2023
eb063cc
Use apple run command for the runtime tests
kotlarmilos Jul 15, 2023
8e37c97
Test the CI when runtime components enabled
kotlarmilos Jul 15, 2023
0725054
Disable failing tests
kotlarmilos Jul 15, 2023
92898fc
Run Mono runtime tests on tvos
kotlarmilos Jul 16, 2023
5c8ffb3
Enable runtime tests on simulators and maccatalyst
kotlarmilos Jul 16, 2023
9189d18
Skip NativeProjectBinaries check for mobile targets
kotlarmilos Jul 16, 2023
4be270a
Don't sign on simulators and maccatalyst
kotlarmilos Jul 16, 2023
3832dbf
Add --signal-app-end for simulator runs
kotlarmilos Jul 17, 2023
4b991fa
Exclude maccatalyst jobs
kotlarmilos Jul 17, 2023
d49681c
Merge branch 'dotnet:main' into feature/parallel-aot-compilation
kotlarmilos Jul 17, 2023
65fde69
Terminate execution and return non-zero code if test fail
kotlarmilos Jul 17, 2023
4afbe3e
Enable ios/tvos tests
kotlarmilos Jul 18, 2023
67e01e5
Merge branch 'main' into feature/parallel-aot-compilation
kotlarmilos Jul 18, 2023
60ccaa4
Revert issues.targets changes
kotlarmilos Jul 18, 2023
5847540
Allow local AOT compilation
kotlarmilos Jul 18, 2023
9b96482
Add extra dlls to the bundle
kotlarmilos Jul 18, 2023
ce51b80
Disable failing tests
kotlarmilos Jul 19, 2023
3d7e6b7
Disable failing tests
kotlarmilos Jul 19, 2023
21518f9
Disable failing tests
kotlarmilos Jul 19, 2023
34ecb56
Disable failing tests on simulators
kotlarmilos Jul 20, 2023
ead3bf2
Disable tests that timeouts on simulators
kotlarmilos Jul 20, 2023
d27ed9c
Disable failing tests on simulators
kotlarmilos Jul 20, 2023
b4e60f2
Refactor properties to be more descriptive
kotlarmilos Jul 21, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ parameters:
enableMicrobuild: ''
gatherAssetManifests: false
shouldContinueOnError: false
compileOnHelix: false
interpreter: false

steps:
- template: /eng/pipelines/common/templates/runtimes/build-runtime-tests.yml
Expand Down Expand Up @@ -72,49 +74,64 @@ steps:
env:
__MonoToolPrefix: aarch64-linux-gnu-

# Send tests to Helix
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml
parameters:
displayName: Send tests to Helix
buildConfig: $(buildConfigUpper)
archType: ${{ parameters.archType }}
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup}}
coreClrRepoRoot: $(Build.SourcesDirectory)/src/coreclr
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
runtimeFlavor: ${{ parameters.runtimeFlavor }}
runtimeVariant: ${{ parameters.runtimeVariant }}
# Checks the value of the compileOnHelix parameter
# and if set invokes libraries pipeline for AOT on Helix
- ${{ if eq(parameters.compileOnHelix, 'true') }}:
- template: /eng/pipelines/libraries/helix.yml
parameters:
osGroup: ${{ parameters.osGroup }}
runtimeFlavor: ${{ parameters.runtimeFlavor }}
archType: ${{ parameters.archType }}
targetRid: ${{ parameters.targetRid }}
buildConfig: ${{ parameters.buildConfig }}
interpreter: ${{ parameters.interpreter }}
testRunNamePrefixSuffix: ${{ parameters.testRunNamePrefixSuffix }}
extraHelixArguments: ${{ parameters.extraHelixArguments }}
helixQueues: ${{ parameters.helixQueues }}
creator: ${{ parameters.creator }}
- ${{ else }}:
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml
parameters:
displayName: Send tests to Helix
buildConfig: $(buildConfigUpper)
archType: ${{ parameters.archType }}
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup}}
coreClrRepoRoot: $(Build.SourcesDirectory)/src/coreclr
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
runtimeFlavor: ${{ parameters.runtimeFlavor }}
runtimeVariant: ${{ parameters.runtimeVariant }}

${{ if eq(variables['System.TeamProject'], 'public') }}:
creator: $(Build.DefinitionName)
${{ if eq(variables['System.TeamProject'], 'public') }}:
creator: $(Build.DefinitionName)

helixBuild: $(Build.BuildNumber)
helixSource: $(_HelixSource)
helixBuild: $(Build.BuildNumber)
helixSource: $(_HelixSource)

${{ if ne(parameters.readyToRun, true) }}:
helixType: 'test/functional/cli/'
${{ if ne(parameters.readyToRun, true) }}:
helixType: 'test/functional/cli/'

helixQueues: ${{ parameters.helixQueues }}
helixQueues: ${{ parameters.helixQueues }}

# This tests whether an array is empty
${{ if eq(join('', parameters.helixQueues), '') }}:
condition: false
# This tests whether an array is empty
${{ if eq(join('', parameters.helixQueues), '') }}:
condition: false

publishTestResults: true
publishTestResults: true

timeoutPerTestInMinutes: $(timeoutPerTestInMinutes)
timeoutPerTestCollectionInMinutes: $(timeoutPerTestCollectionInMinutes)
timeoutPerTestInMinutes: $(timeoutPerTestInMinutes)
timeoutPerTestCollectionInMinutes: $(timeoutPerTestCollectionInMinutes)

runCrossGen2: ${{ eq(parameters.readyToRun, true) }}
compositeBuildMode: ${{ parameters.compositeBuildMode }}
runInUnloadableContext: ${{ parameters.runInUnloadableContext }}
nativeAotTest: ${{ parameters.nativeAotTest }}
runCrossGen2: ${{ eq(parameters.readyToRun, true) }}
compositeBuildMode: ${{ parameters.compositeBuildMode }}
runInUnloadableContext: ${{ parameters.runInUnloadableContext }}
nativeAotTest: ${{ parameters.nativeAotTest }}

${{ if eq(variables['System.TeamProject'], 'internal') }}:
# Access token variable for internal project from the
# DotNet-HelixApi-Access variable group
helixAccessToken: $(HelixApiAccessToken)
${{ if eq(variables['System.TeamProject'], 'internal') }}:
# Access token variable for internal project from the
# DotNet-HelixApi-Access variable group
helixAccessToken: $(HelixApiAccessToken)

helixProjectArguments: '$(Build.SourcesDirectory)/src/tests/Common/helixpublishwitharcade.proj'
helixProjectArguments: '$(Build.SourcesDirectory)/src/tests/Common/helixpublishwitharcade.proj'

scenarios: ${{ parameters.scenarios }}
scenarios: ${{ parameters.scenarios }}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true

#
# Build the whole product using Mono for iOS/tvOS and run runtime tests with iOS/tvOS devices
# iOS/tvOS devices
# Build the whole product using Mono and run runtime tests
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
Expand Down Expand Up @@ -82,9 +83,11 @@ jobs:
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
extraStepsParameters:
creator: dotnet-bot
# FIXME: Currently, tracing/eventpipe tests are only enabled on iOS platforms. It should be expanded to include all runtime tests. Tracking issue: https://github.com/dotnet/runtime/issues/84254
testBuildArgs: tree tracing/eventpipe
compileOnHelix: true
interpreter: true
testBuildArgs: /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildTestsOnHelix=true
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true

#
# Build the whole product using NativeAOT for iOS/tvOS and run runtime tests with iOS/tvOS devices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ jobs:
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
extraStepsParameters:
creator: dotnet-bot
# FIXME: Currently, tracing/eventpipe tests are only enabled on iOS platforms. It should be expanded to include all runtime tests. Tracking issue: https://github.com/dotnet/runtime/issues/84254
testBuildArgs: tree tracing/eventpipe
compileOnHelix: true
interpreter: true
testBuildArgs: /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildTestsOnHelix=true
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true

#
# Build the whole product using Native AOT for iOSSimulator/tvOSSimulator and run runtime tests with iOS/tvOS simulators
Expand Down
28 changes: 19 additions & 9 deletions eng/testing/tests.ioslike.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
<_AOTBuildCommand>$(_AOTBuildCommand) </_AOTBuildCommand>

<_ResetSimulatorSwitch Condition="'$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvossimulator'">--reset-simulator</_ResetSimulatorSwitch>
<_SignalAppEndSwitch Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos'">--signal-app-end</_SignalAppEndSwitch>
<_SignalAppEndSwitch>--signal-app-end</_SignalAppEndSwitch>
<_AppleSignCommand Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos'">sign &quot;$app&quot;</_AppleSignCommand>

<_AfterBuildCommands>
mv $XHARNESS_OUT/AOTBuild.binlog &quot;$HELIX_WORKITEM_UPLOAD_ROOT&quot;
sign &quot;$app&quot;
$(_AppleSignCommand)
xharness apple test --app &quot;$app&quot; --output-directory &quot;$output_directory&quot; --target &quot;$target&quot; --timeout &quot;$timeout&quot; --xcode &quot;$xcode_path&quot; -v --launch-timeout &quot;$launch_timeout&quot; $(_ResetSimulatorSwitch) $(_SignalAppEndSwitch) -- </_AfterBuildCommands>

<RunScriptCommand>$(_AOTBuildCommand) $(_AfterBuildCommands)</RunScriptCommand>
Expand Down Expand Up @@ -61,14 +62,21 @@
</PropertyGroup>

<ItemGroup>
<BundleFiles Condition="'%(AppleAssembliesToBundle._IsNative)' != 'true'"
Include="@(AppleAssembliesToBundle)" TargetDir="publish\%(AppleAssembliesToBundle.RecursiveDir)" />
<BundleFiles Include="@(AppleNativeFilesToBundle)" TargetDir="publish\%(AppleNativeFilesToBundle.RecursiveDir)" />
<BundleFiles Include="$(RuntimeConfigFilePath)" TargetDir="publish" />
<!--
Checks if the directory name "AppleAssembliesToBundle" is equal to the "AssemblyName",
if they match, consider it as the root directory and copy the files there,
otherwise, copy the files to a subdirectory.
-->
<BundleFiles Condition="'%(AppleAssembliesToBundle._IsNative)' != 'true' and ($([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('%(AppleAssembliesToBundle.Identity)')))) == '$(AssemblyName)' or '$(CustomMain)' != 'true')"
Include="@(AppleAssembliesToBundle)" TargetDir="publish" />
<BundleFiles Condition="'%(AppleAssembliesToBundle._IsNative)' != 'true' and $([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('%(AppleAssembliesToBundle.Identity)')))) != '$(AssemblyName)' and '$(CustomMain)' == 'true'"
Include="@(AppleAssembliesToBundle)" TargetDir="publish\$([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('%(AppleAssembliesToBundle.Identity)'))))" />
Copy link
Member

Choose a reason for hiding this comment

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

Just a question: Why does it matter if $(CustomMain) is specified or not here?

Copy link
Member Author

@kotlarmilos kotlarmilos Jul 21, 2023

Choose a reason for hiding this comment

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

The same target is used for the library and runtime tests and the condition checks if the directory is equals to the assemblyName. In case of runtime tests that is true, but for library tests that creates recursive dirs.

Probably better to use more descriptive variable.


<BundleFiles Include="@(AppleNativeFilesToBundle)" TargetDir="publish" />

<BundleFiles Include="$(MonoProjectRoot)\msbuild\apple\data\*" TargetDir="publish" />
<BundleFiles Include="$(MonoProjectRoot)\msbuild\apple\data\*" TargetDir="publish" />
<ExtraFiles Condition="'%(AppleAssembliesToBundle._IsNative)' == 'true'"
Include="@(AppleAssembliesToBundle)" TargetDir="extraFiles\%(AppleAssembliesToBundle.RecursiveDir)" />
Include="@(AppleAssembliesToBundle)" TargetDir="extraFiles" />
</ItemGroup>

<ItemGroup Condition="'$(DebuggerSupport)' == 'true'">
Expand Down Expand Up @@ -103,6 +111,8 @@
<_ApplePropertyNames Include="HybridGlobalization" />
<_ApplePropertyNames Include="AssemblyName" />
<_ApplePropertyNames Include="MonoEnableLLVM" />
<_ApplePropertyNames Include="UseRuntimeComponents" />
<_ApplePropertyNames Include="CustomMain" />

<_ApplePropertiesToPass
Include="$(%(_ApplePropertyNames.Identity))"
Expand Down Expand Up @@ -137,7 +147,7 @@

<PropertyGroup>
<Optimized Condition="'$(Configuration)' == 'Release'">true</Optimized>
<MainLibraryFileName Condition="'$(MainLibraryFileName)' == ''">AppleTestRunner.dll</MainLibraryFileName>
<MainLibraryFileName Condition="'$(MainLibraryFileName)' == '' and '$(CustomMain)' != 'true'">AppleTestRunner.dll</MainLibraryFileName>

<AppleBuildDir>$(PublishDir)</AppleBuildDir>
<AppleBundleDir>$(BundleDir)</AppleBundleDir>
Expand Down
5 changes: 3 additions & 2 deletions eng/testing/tests.mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<RunScriptOutputPath>$([MSBuild]::NormalizePath('$(BundleDir)', '$(RunScriptOutputName)'))</RunScriptOutputPath>

<PublishingTestsRun>true</PublishingTestsRun>
<PublishTestAsSelfContainedDependsOn>Publish</PublishTestAsSelfContainedDependsOn>
<PublishTestAsSelfContainedDependsOn Condition="'$(PublishTestAsSelfContainedDependsOn)' == ''">Publish</PublishTestAsSelfContainedDependsOn>
<PublishTestAsSelfContainedAfterTargets Condition="'$(PublishTestAsSelfContainedAfterTargets)' == ''">Build</PublishTestAsSelfContainedAfterTargets>

<SkipWorkloadsTestingTargetsImport Condition="'$(SkipWorkloadsTestingTargetsImport)' == ''">true</SkipWorkloadsTestingTargetsImport>
</PropertyGroup>
Expand Down Expand Up @@ -155,7 +156,7 @@

<Target Name="PublishTestAsSelfContained"
Condition="'$(IsCrossTargetingBuild)' != 'true'"
AfterTargets="Build"
AfterTargets="$(PublishTestAsSelfContainedAfterTargets)"
DependsOnTargets="$(PublishTestAsSelfContainedDependsOn);$(BundleTestAppTargets);ArchiveTests" />

<Target Name="PrepareForTestUsingWorkloads"
Expand Down
4 changes: 4 additions & 0 deletions eng/testing/tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@
<RunScriptCommands Include="@(PostRunScriptCommands)" />
</ItemGroup>

<PropertyGroup Condition="'$(RunScriptOutputDirectory)' != ''">
<RunScriptOutputPath>$([MSBuild]::NormalizePath('$(RunScriptOutputDirectory)', '$(RunScriptOutputName)'))</RunScriptOutputPath>
</PropertyGroup>

<GenerateRunScript RunCommands="@(RunScriptCommands)"
SetCommands="@(SetScriptCommands)"
TemplatePath="$(RunScriptInputPath)"
Expand Down
2 changes: 1 addition & 1 deletion src/mono/msbuild/apple/build/AppleBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<!-- iOS/tvOS device + arm64 simulators need to AOT -->
<PropertyGroup Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos' or (('$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvossimulator') And '$(TargetArchitecture)' == 'arm64')">
<RunAOTCompilation Condition="'$(RunAOTCompilation)' == ''">true</RunAOTCompilation>
<iOSLikeDedup Condition="'$(iOSLikeDedup)' == ''">true</iOSLikeDedup>
</PropertyGroup>

<!-- iOS/tvOS arm64 simulators do not support JIT, so force interpreter fallback, devices should FullAOT -->
Expand All @@ -11,6 +10,7 @@
</PropertyGroup>

<PropertyGroup>
<iOSLikeDedup Condition="'$(iOSLikeDedup)' == '' and '$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' != 'true'">true</iOSLikeDedup>
ivanpovazan marked this conversation as resolved.
Show resolved Hide resolved
<RuntimeIdentifier>$(TargetOS)-$(TargetArchitecture.ToLowerInvariant())</RuntimeIdentifier>
<UseMonoRuntime>true</UseMonoRuntime>
<UseMonoJustInterp Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' == 'true'">true</UseMonoJustInterp>
Expand Down
4 changes: 4 additions & 0 deletions src/mono/msbuild/apple/build/AppleBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@

<ItemGroup>
<_AotExcludeAssemblies Include="*System.Runtime.WindowsRuntime.dll" />
<_AssembliesToBundleInternal>
<_InternalForceInterpret Condition="'$(MonoForceInterpreter)' == 'true' and '%(FileName)%(Extension)' != 'System.Private.CoreLib.dll'">true</_InternalForceInterpret>
<_IsNative>false</_IsNative>
</_AssembliesToBundleInternal>

<_AotInputAssemblies Include="@(_AssembliesToBundleInternal)"
Condition="'%(_AssembliesToBundleInternal._InternalForceInterpret)' != 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@
<AppleBuildDir>$(OriginalPublishDir)</AppleBuildDir>
<AppleBundleDir>$(TestRootDir)AppBundle\</AppleBundleDir>

<MainLibraryFileName>$(OriginalPublishDir)AppleTestRunner.dll</MainLibraryFileName>
<MainLibraryFileName Condition="'$(MainLibraryFileName)' == '' and '$(CustomMain)' != 'true'">$(OriginalPublishDir)AppleTestRunner.dll</MainLibraryFileName>
<Optimized Condition="'$(Configuration)' != 'Debug'">true</Optimized>
</PropertyGroup>

<PropertyGroup Condition="'$(UseRuntimeComponents)' == 'true'">
<RuntimeComponents>diagnostics_tracing;marshal-ilgen</RuntimeComponents>
<DiagnosticPorts>127.0.0.1:9000,nosuspend,listen</DiagnosticPorts>
</PropertyGroup>

<ItemGroup>
<!-- Figure out if we can support JustInterp mode -->
<AppleAssembliesToBundle Include="$(OriginalPublishDir)**\*.dll" Exclude="$(OriginalPublishDir)\**\*.resources.dll" />
Expand Down
25 changes: 24 additions & 1 deletion src/tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@
<Import Project="$(MSBuildThisFileDirectory)/Common/disableversioncheck.targets"
Condition="'$(DisableVersionCheckImported)' != 'true'" />

<PropertyGroup Condition="'$(TargetsAppleMobile)' == 'true' and '$(RuntimeFlavor)' == 'mono'">
<OSPlatformConfig>$(TargetOS).AnyCPU.$(Configuration)</OSPlatformConfig>
<TestArchiveRoot>$(ArtifactsDir)helix/</TestArchiveRoot>
<TestArchiveTestsRoot>$(TestArchiveRoot)tests/</TestArchiveTestsRoot>
<TestArchiveTestsDir>$(TestArchiveTestsRoot)$(OSPlatformConfig)/</TestArchiveTestsDir>
<TestArchiveRuntimeRoot>$(TestArchiveRoot)runtime/</TestArchiveRuntimeRoot>

<PublishTestAsSelfContainedDependsOn>BuildMonoiOSApp</PublishTestAsSelfContainedDependsOn>
<PublishTestAsSelfContainedAfterTargets>BuildMonoiOSApp</PublishTestAsSelfContainedAfterTargets>
<BundleTestAppleAppDependsOn>GenerateRunScript</BundleTestAppleAppDependsOn>

<CustomMain>true</CustomMain>
</PropertyGroup>

<Import Project="$(RepositoryEngineeringDir)testing\tests.targets"
Condition="'$(TargetsAppleMobile)' == 'true' and '$(RuntimeFlavor)' == 'mono'" />

<Target Name="_SetRunScriptOutputDirectory" Condition="'$(TargetsAppleMobile)' == 'true' and '$(RuntimeFlavor)' == 'mono' and '$(CustomMain)' == 'true'" BeforeTargets="GenerateRunScript">
<PropertyGroup>
<RunScriptOutputDirectory>$(ArtifactsDir)/tests/coreclr/obj/$(TargetOS).$(Platform).$(Configuration)/Managed/build/iOSApps/$(TestProjectName)/AppBundle</RunScriptOutputDirectory>
</PropertyGroup>
</Target>

<!-- Default priority building values. -->
<PropertyGroup>
<DisableProjectBuild Condition="'$(IsMergedTestRunnerAssembly)' == 'true' and $(BuildAsStandalone)">true</DisableProjectBuild>
Expand Down Expand Up @@ -201,7 +224,7 @@

<!-- There are currently no native project binaries on wasm or Android -->
<Error Text="The native project files are missing in $(NativeProjectOutputFolder) please run build from the root of the repo at least once"
Condition="'@(NativeProjectBinaries)' == '' And '$(TargetOS)' != 'browser' And '$(TargetOS)' != 'android' And '$(TargetOS)' != 'ios' And '$(TargetOS)' != 'iossimulator'"/>
Condition="'@(NativeProjectBinaries)' == '' And '$(TargetOS)' != 'browser' And '$(TargetsMobile)' != 'true'"/>

<Copy
SourceFiles="@(NativeProjectBinaries)"
Expand Down
Loading