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

[ios][tests] Run functional tests with Mono and Native AOT on Helix #87773

Merged
merged 106 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
74481af
Initial commit
kotlarmilos Jun 19, 2023
ca86967
Add Native AOT library pipeline for iOS and disable other tests
kotlarmilos Jun 19, 2023
98522fd
Disable other tests
kotlarmilos Jun 19, 2023
6ade906
Disable other tests
kotlarmilos Jun 19, 2023
0e7a920
Test build configuration
kotlarmilos Jun 19, 2023
1aca721
Test build configuration
kotlarmilos Jun 19, 2023
774ed6b
Test build configuration
kotlarmilos Jun 19, 2023
034fff1
Add properties to the proxy AOT project
kotlarmilos Jun 20, 2023
a12779b
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Jun 20, 2023
abfe7c1
Add AppName to the proxy props
kotlarmilos Jun 20, 2023
09c6097
Remove AppName from the proxy props
kotlarmilos Jun 20, 2023
063995d
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Jun 21, 2023
3693155
Add ILC payload to Helix
kotlarmilos Jun 21, 2023
5344255
Update the Helix targets to support Native AOT tests
kotlarmilos Jun 23, 2023
7c426a5
Fix ILLink and ILC paths on Helix
kotlarmilos Jun 23, 2023
30ae9eb
Import Directory.Build.props/targets to initialize local applebuild p…
kotlarmilos Jun 23, 2023
fff4849
Remove the SDK reference to test the CI
kotlarmilos Jun 23, 2023
df51223
Update run script to include Native AOT params
kotlarmilos Jun 24, 2023
0e7325e
Update sendtohelix conditions to use runtimeFlavor
kotlarmilos Jun 24, 2023
ce43877
Add TargetFramework property to AppleBuild on Helix
kotlarmilos Jun 24, 2023
6304c83
Use AppendTargetFrameworkToOutputPath to fix the Native AOT publish path
kotlarmilos Jun 24, 2023
6eb91b7
Add exit code for functional tests
kotlarmilos Jun 24, 2023
228ba32
Add exit code for functional tests
kotlarmilos Jun 24, 2023
f42f06a
Fix mono sample to output executable
kotlarmilos Jun 24, 2023
a667de7
Add publish path to the mono sample
kotlarmilos Jun 24, 2023
e0ec3aa
Disable size optimization in mono app
kotlarmilos Jun 25, 2023
a681087
Update ExpectedExitCode to be 42
kotlarmilos Jun 25, 2023
eb23036
Optimize bundle size in mono sample
kotlarmilos Jun 25, 2023
a811966
Update ExpectedExitCode property
kotlarmilos Jun 25, 2023
9374010
Use filename to set ExpectedExitCode
kotlarmilos Jun 25, 2023
44f40ca
Use filename to set ExpectedExitCode
kotlarmilos Jun 25, 2023
8d47870
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Jun 25, 2023
2eecc7e
Tests return 0 when run on iOS
kotlarmilos Jun 25, 2023
ae8ea04
Exclude unnecessary files from the bundle for SOD measurements
kotlarmilos Jun 25, 2023
f168689
Run AddTestRunnersToPublishedFiles when MainLibraryFileName is null
kotlarmilos Jun 26, 2023
72053e0
Merge branch 'main' of github.com:kotlarmilos/runtime into feature/io…
kotlarmilos Jun 27, 2023
a5c8f8b
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Jun 29, 2023
5ac774f
Simplify the build process for Native AOT sample app
kotlarmilos Jun 29, 2023
9b5641c
Revert disabled tests
kotlarmilos Jun 30, 2023
048a5b9
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Jul 10, 2023
13fa800
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Jul 12, 2023
8a46827
Use cross build for Native AOT tests
kotlarmilos Jul 12, 2023
c8515cd
Enable functional tests and fix ilc path
kotlarmilos Jul 12, 2023
d715082
Enable functional tests
kotlarmilos Jul 12, 2023
99cc75b
Run functional test on the CI
kotlarmilos Jul 13, 2023
d0911d3
Use AssemblyName as the MainLibraryFileName
kotlarmilos Jul 13, 2023
7a9cace
Set UseConsoleUITemplate for the functional tests
kotlarmilos Jul 13, 2023
fd39b23
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Jul 14, 2023
a826dbe
Use predefined MainLibraryFileName in functional tests
kotlarmilos Jul 14, 2023
4438806
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Jul 15, 2023
9e06c1f
Disable trimming of the sample apps
kotlarmilos Jul 15, 2023
29911b9
Parametrize xharness apple command with test and run options
kotlarmilos Jul 15, 2023
6a420d3
Add --expected-exit-code for apple run command
kotlarmilos Jul 15, 2023
d2d83b0
Run Native AOT functional test on the CI
kotlarmilos Jul 15, 2023
917ce00
Use cross-compiler dir for ilc
kotlarmilos Jul 16, 2023
dc52f2f
Don't use MainLibraryFileName in Native AOT app bundle
kotlarmilos Jul 16, 2023
9bb44e6
Make console template compatible with Native AOT
kotlarmilos Jul 16, 2023
cd8a7f1
Remove redundant props
kotlarmilos Jul 16, 2023
e7e4d1a
Add native dependencies to the app bundle
kotlarmilos Jul 16, 2023
77f7cf4
Run Native AOT tests on simulators and maccatalyst
kotlarmilos Jul 16, 2023
b7b285e
Remove maccatalyst tests
kotlarmilos Jul 16, 2023
486c1a3
Enable iOS.Device.Aot-Llvm.Test.csproj test
kotlarmilos Jul 16, 2023
0d7d88b
Add targets and props from the libraries CI
kotlarmilos Jul 16, 2023
8470e8f
Run functional test on tvos
kotlarmilos Jul 16, 2023
454f40f
Merge branch 'dotnet:main' into feature/ios-functional-tests
kotlarmilos Jul 17, 2023
e260892
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Jul 18, 2023
e50a647
Run tvOS sample on the CI
kotlarmilos Jul 19, 2023
f3d9b25
Fix IncludesTestRunner property
kotlarmilos Jul 19, 2023
f14e668
Add Native AOT specific props
kotlarmilos Jul 19, 2023
297c69f
Use DirectPInvoke in Native AOT run
kotlarmilos Jul 19, 2023
751a911
Remove unused props
kotlarmilos Jul 19, 2023
3f28fd1
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Jul 21, 2023
1ff7d9d
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Jul 25, 2023
bbcc827
Don't run _ScanAssembliesDecideLightweightMarshaler with Native AOT
kotlarmilos Jul 25, 2023
d8e7ebd
Don't run _ScanAssembliesDecideLightweightMarshaler with Native AOT
kotlarmilos Jul 26, 2023
25a057c
Remove redundant props
kotlarmilos Jul 26, 2023
cedc3f0
Update apple build targets with Native AOT props
kotlarmilos Jul 26, 2023
a2d57da
Remove redundant props
kotlarmilos Jul 26, 2023
c06f211
Add IncludesTestRunner property to the Helix payload
kotlarmilos Jul 26, 2023
161e45f
Simplify sample app to use AppleBuild targets
kotlarmilos Jul 27, 2023
d992084
Import ilc targets with UseNativeAOTRuntime prop
kotlarmilos Jul 27, 2023
6d13f76
Merge branch 'dotnet:main' into feature/ios-functional-tests
kotlarmilos Jul 28, 2023
3517646
Remove redundant props
kotlarmilos Aug 1, 2023
a35bbb7
Revert simulator changes
kotlarmilos Aug 1, 2023
05170f9
Merge branch 'feature/ios-functional-tests' of github.com:kotlarmilos…
kotlarmilos Aug 1, 2023
295d640
Merge branch 'dotnet:main' into feature/ios-functional-tests
kotlarmilos Aug 1, 2023
5d7af31
Merge branch 'feature/ios-functional-tests' of github.com:kotlarmilos…
kotlarmilos Aug 1, 2023
989cbca
Add native libs for globalization
kotlarmilos Aug 1, 2023
3b20520
Remove redundant props and fix MainLibraryFileName for non-device sce…
kotlarmilos Aug 1, 2023
d092326
Rename functional tests and include additional ios test
kotlarmilos Aug 1, 2023
d4a3a56
Include more functional tests
kotlarmilos Aug 1, 2023
3b62fc8
Remove redundant Directory.Build files
kotlarmilos Aug 2, 2023
36368e2
Add IsTestProject property
kotlarmilos Aug 2, 2023
496acec
Revert the Directory.Build files
kotlarmilos Aug 2, 2023
aa66bb1
Enable aggressive trimming for Mono builds
kotlarmilos Aug 3, 2023
e47d986
Simplify the sample app and disable aggressive trimming
kotlarmilos Aug 3, 2023
cf56983
Remove redundant props
kotlarmilos Aug 4, 2023
26955e0
Add globalization static libraries for Native AOT builds
kotlarmilos Aug 4, 2023
7637762
Add MonoForceInterpreter property to the functional tests
kotlarmilos Aug 8, 2023
e152e73
Merge branch 'main' into feature/ios-functional-tests
kotlarmilos Aug 8, 2023
4af46f8
Don't use runtime components for Native AOT builds
kotlarmilos Aug 9, 2023
8a59bca
Resolve PR comments
kotlarmilos Aug 9, 2023
7dd5b27
Merge branch 'dotnet:main' into feature/ios-functional-tests
kotlarmilos Aug 11, 2023
8663185
Use item group for native dependencies
kotlarmilos Aug 11, 2023
2238ba2
Add conditions to the CI jobs
kotlarmilos Aug 11, 2023
cc5313a
Update formatting
kotlarmilos Aug 11, 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
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@
<CoreCLRToolPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'coreclr', '$(TargetOS).$(TargetArchitecture).$(RuntimeConfiguration)'))</CoreCLRToolPath>
<ILAsmToolPath Condition="'$(DotNetBuildFromSource)' == 'true' or '$(BuildArchitecture)' == 's390x' or '$(BuildArchitecture)' == 'ppc64le'">$(CoreCLRToolPath)</ILAsmToolPath>

<NativeAotTargetsPath>$([MSBuild]::NormalizeDirectory('$(CoreClrProjectRoot)', 'nativeaot', 'BuildIntegration'))</NativeAotTargetsPath>
kotlarmilos marked this conversation as resolved.
Show resolved Hide resolved

<WasmtimeDir Condition="'$(WasmtimeDir)' == '' and '$(WASMTIME_PATH)' != '' and Exists($(WASMTIME_PATH))">$(WASMTIME_PATH)</WasmtimeDir>
<WasmtimeDir Condition="'$(WasmtimeDir)' == ''">$([MSBuild]::NormalizeDirectory($(ArtifactsObjDir), 'wasmtime'))</WasmtimeDir>
<InstallWasmtimeForTests Condition="'$(InstallWasmtimeForTests)' == '' and !Exists($(WasmtimeDir))">true</InstallWasmtimeForTests>
Expand Down
25 changes: 25 additions & 0 deletions eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,31 @@ jobs:
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true

#
# iOS/tvOS devices
# Build the whole product using Native AOT and run libraries tests
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: coreclr
platforms:
- ios_arm64
- tvos_arm64
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_NativeAOT
buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true
timeoutInMinutes: 180
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig)
extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true

#
# Build the whole product using NativeAOT for iOS/tvOS and run runtime tests with iOS/tvOS devices
#
Expand Down
25 changes: 25 additions & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,31 @@ extends:
eq(variables['monoContainsChange'], true),
eq(variables['isRollingBuild'], true))

#
# iOS/tvOS devices
# Build the whole product using Native AOT and run libraries tests
#
- template: /eng/pipelines/common/platform-matrix.yml
Copy link
Member

Choose a reason for hiding this comment

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

We don't have the capacity to run these on every PR. Even when we kick off runtime-ioslike manually, there may be a capacity issue running both mono and nativeaot together.

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, my concern was all libraries tests (when we get to it) and I see it's running smoke tests only.

parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: coreclr
platforms:
- ios_arm64
- tvos_arm64
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_NativeAOT
buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true
timeoutInMinutes: 180
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig)
extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true

#
# MacCatalyst interp - requires AOT Compilation and Interp flags
# Build the whole product using Mono and run libraries tests
Expand Down
15 changes: 11 additions & 4 deletions eng/testing/tests.ioslike.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@
<!-- running aot-helix tests locally, so we can test with the same project file as CI -->
<_AOTBuildCommand Condition="'$(ContinuousIntegrationBuild)' != 'true'">$(_AOTBuildCommand) /p:RuntimeSrcDir=$(RepoRoot) /p:RuntimeConfig=$(Configuration)</_AOTBuildCommand>

<_AOTBuildCommand>$(_AOTBuildCommand) /p:XHARNESS_EXECUTION_DIR=&quot;$XHARNESS_EXECUTION_DIR&quot; /p:RunAOTCompilation=$(RunAOTCompilation) /p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:MonoForceInterpreter=$(MonoForceInterpreter) /p:MonoEnableLLVM=true /p:DevTeamProvisioning=$(DevTeamProvisioning) /p:UsePortableRuntimePack=true /p:Configuration=$(Configuration)</_AOTBuildCommand>
<_AOTBuildCommand>$(_AOTBuildCommand) /p:XHARNESS_EXECUTION_DIR=&quot;$XHARNESS_EXECUTION_DIR&quot; /p:RunAOTCompilation=$(RunAOTCompilation) /p:UseNativeAOTRuntime=$(UseNativeAOTRuntime) /p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:MonoForceInterpreter=$(MonoForceInterpreter) /p:DevTeamProvisioning=$(DevTeamProvisioning) /p:UsePortableRuntimePack=true /p:Configuration=$(Configuration)</_AOTBuildCommand>
Copy link
Member

Choose a reason for hiding this comment

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

Just to clarify: You removed /p:MonoEnableLLVM=true because it is supposed to be set in the project file of the functional test?

Copy link
Member Author

@kotlarmilos kotlarmilos Aug 1, 2023

Choose a reason for hiding this comment

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

Correct, it should be set in the project file.

Correct, it should be set in the project file in the Helix payload.

Copy link
Member

Choose a reason for hiding this comment

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

In that case, I assume /p:MonoForceInterpreter=$(MonoForceInterpreter) could be also removed?

Copy link
Member Author

@kotlarmilos kotlarmilos Aug 1, 2023

Choose a reason for hiding this comment

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

When AOT compiling on Helix, there is a set of parameters passed when the script is invoked, such as RunAOTCompilation, UseNativeAOTRuntime, TargetOS, TargetArchitecture. These parameters are usually set through the build command. Additionally, there are parameters that configure AOT compilation like EnableLLVM, IncludesTestRunner, UseRuntimeComponents, etc.

The MonoForceInterpreter parameter is passed through the build command, so it may be reasonable to keep it within the build command on the Helix as well.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks. We should verify what is happening during the build of functional tests, as in functional tests project files the property is treated with: TreatAsLocalProperty="MonoForceInterpreter" which afaik, means the build system will not allow overwriting MonoForceInterpreter value as long as it is defined in the project file - locally.

So since MonoForceInterpreter=false got removed from the project file: https://github.com/dotnet/runtime/pull/87773/files#diff-67da87e0a0169c2fa25ef2d8106257412638ac6a05f4534bab3a62469fdf73aeL5
doing build -p:MonoForceInterpreter=true on Helix - could build the test project differently then before.

Copy link
Member

Choose a reason for hiding this comment

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

Looking at the other functional tests project files, most of them have MonoForceInterpreter set, but some have TreatAsLocalProperty="MonoForceInterpreter" some don't, so I believe the TreatAsLocalProperty was added as a workaround to prevent overwriting what a project specifies through the command line - like building on Helix.

To conclude, I feel like this needs to be refactored (maybe not in this PR), with either removing any notion of MonoForceInterpreter from the functional test's project file (and test the change), or leave it how it was to prevent any unwanted regression.

@steveisok what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Here is a related change #52606. My understanding is that it was added for local development and testing.

Copy link
Member Author

Choose a reason for hiding this comment

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

All the relevant tests have passed. @steveisok What do you suggest doing here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ivanpovazan Reverted the changes to be on the safe side. Please take a look again at this PR and let's try to resolve comments before the RC1 snap.

Copy link
Member

Choose a reason for hiding this comment

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

Looking at the other functional tests project files, most of them have MonoForceInterpreter set, but some have TreatAsLocalProperty="MonoForceInterpreter" some don't, so I believe the TreatAsLocalProperty was added as a workaround to prevent overwriting what a project specifies through the command line - like building on Helix.

To conclude, I feel like this needs to be refactored (maybe not in this PR), with either removing any notion of MonoForceInterpreter from the functional test's project file (and test the change), or leave it how it was to prevent any unwanted regression.

@steveisok what do you think?

I would suggest keeping it and slowly unwinding in a follow up.

<_AOTBuildCommand>$(_AOTBuildCommand) </_AOTBuildCommand>

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

<IncludesTestRunner Condition="'$(IncludesTestRunner)' == ''">true</IncludesTestRunner>

<_AppleBuildCommand Condition="'$(IncludesTestRunner)' == 'true'">apple test</_AppleBuildCommand>
<_AppleBuildCommand Condition="'$(IncludesTestRunner)' != 'true'">apple run</_AppleBuildCommand>
<_AppleExpectedExitCode Condition="'$(ExpectedExitCode)' != ''">--expected-exit-code $(ExpectedExitCode)</_AppleExpectedExitCode>
<_AfterBuildCommands>
mv $XHARNESS_OUT/AOTBuild.binlog &quot;$HELIX_WORKITEM_UPLOAD_ROOT&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>
xharness $(_AppleBuildCommand) --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) $(_AppleExpectedExitCode) -- </_AfterBuildCommands>

<RunScriptCommand>$(_AOTBuildCommand) $(_AfterBuildCommands)</RunScriptCommand>
</PropertyGroup>
Expand Down Expand Up @@ -103,8 +108,10 @@
<_ApplePropertyNames Include="HybridGlobalization" />
<_ApplePropertyNames Include="AssemblyName" />
<_ApplePropertyNames Include="MonoEnableLLVM" />
<_ApplePropertyNames Include="MainLibraryFileName" />
<_ApplePropertyNames Include="UseConsoleUITemplate" />
<_ApplePropertyNames Include="UseRuntimeComponents" />
<_ApplePropertyNames Include="IsRuntimeTests" />
<_ApplePropertyNames Include="IncludesTestRunner" />

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

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

<AppleBuildDir>$(PublishDir)</AppleBuildDir>
<AppleBundleDir>$(BundleDir)</AppleBundleDir>
Expand Down
7 changes: 4 additions & 3 deletions eng/testing/tests.mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
<SkipWorkloadsTestingTargetsImport Condition="'$(SkipWorkloadsTestingTargetsImport)' == ''">true</SkipWorkloadsTestingTargetsImport>
</PropertyGroup>

<PropertyGroup>
<RunAOTCompilation Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos'">true</RunAOTCompilation>
<PropertyGroup Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos'">
<RunAOTCompilation Condition="'$(RuntimeFlavor)' == 'Mono' ">true</RunAOTCompilation>
<UseNativeAOTRuntime Condition="'$(RuntimeFlavor)' == 'CoreCLR'">true</UseNativeAOTRuntime>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -134,7 +135,7 @@

<Target Name="AddTestRunnersToPublishedFiles"
AfterTargets="ComputeResolvedFilesToPublishList"
Condition="'$(TestFramework)' == 'xunit'">
Condition="'$(TestFramework)' == 'xunit' and '$(MainLibraryFileName)' == ''">
<ItemGroup>
<_runnerFilesToPublish Include="$(AndroidTestRunnerDir)*" Condition="'$(TargetOS)' == 'android'" />
<_runnerFilesToPublish Include="$(AppleTestRunnerDir)*" Condition="'$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator'" />
Expand Down
9 changes: 7 additions & 2 deletions src/libraries/sendtohelix-mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,22 @@
<_XHarnessAppleCustomCommand Condition="'$(NeedsiOSSDK)' == 'true'">
source build-apple-app.sh
</_XHarnessAppleCustomCommand>
<ILLinkDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', '..', '.packages', 'microsoft.net.illink.tasks', '$(MicrosoftNETILLinkTasksVersion)'))</ILLinkDir>
kotlarmilos marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

<ItemGroup Condition="'$(NeedsiOSSDK)' == 'true'">
<HelixCorrelationPayload Include="cmake" Uri="$(CMakeUrl)" Destination="build/cmake" />
<HelixCorrelationPayload Include="$(AppleAppBuilderDir)" Destination="build/AppleAppBuilder" />
<HelixCorrelationPayload Include="$(MonoAOTCompilerDir)" Destination="build/MonoAOTCompiler" />
<HelixCorrelationPayload Include="$(MonoAOTCompilerDir)" Destination="build/MonoAOTCompiler" Condition="'$(RuntimeFlavor)' == 'mono'" />
<HelixCorrelationPayload Include="$(MicrosoftNetCoreAppRuntimePackDir)" Destination="build/microsoft.netcore.app.runtime.$(TargetOS)-$(TargetArchitecture.ToLower())" />
<HelixCorrelationPayload Include="$(iOSLikeBuildTargetsDir)" Destination="build/apple" />
<HelixCorrelationPayload Include="$(iOSLikeLibraryBuilderTargetsDir)" Destination="build/common" />
<HelixCorrelationPayload Include="$(MonoAotCrossDir)" Destination="build/cross" />
<HelixCorrelationPayload Include="$(MonoAotCrossDir)" Destination="build/cross" Condition="'$(RuntimeFlavor)' == 'mono'" />
kotlarmilos marked this conversation as resolved.
Show resolved Hide resolved
<HelixCorrelationPayload Include="$(MonoTargetsTasksDir)" Destination="build/MonoTargetsTasks" />
<HelixCorrelationPayload Include="$(CoreCLRCrossILCompilerDir)" Destination="build/ilc" Condition="'$(RuntimeFlavor)' == 'coreclr'" />
<HelixCorrelationPayload Include="$(NativeAotTargetsPath)" Destination="build/BuildIntegration" Condition="'$(RuntimeFlavor)' == 'coreclr'" />
<HelixCorrelationPayload Include="$(CoreCLRAotSdkDir)" Destination="build/aotsdk" Condition="'$(RuntimeFlavor)' == 'coreclr'" />
<HelixCorrelationPayload Include="$(ILLinkDir)" Destination="build/microsoft.net.illink.tasks" />
</ItemGroup>

<ItemGroup Condition="'$(TargetsAppleMobile)' == 'true'">
Expand Down
24 changes: 11 additions & 13 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,7 @@
<ProjectExclusions Include="$(MSBuildThisFileDirectory)*\tests\**\*.Tests.csproj" />

<!-- Functional tests on devices have problems with return codes from mlaunch -->
<ProjectExclusions Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Device\**\*.Test.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'iossimulator' and '$(TargetArchitecture)' == 'arm64' and '$(RunDisablediOSTests)' != 'true'">
<!-- Functional tests on arm64 simulator have problems with return codes from mlaunch -->
<ProjectExclusions Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Simulator\**\*.Test.csproj" />
<ProjectExclusions Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Device\**\*.Test.csproj" Exclude="$(RepoRoot)\src\tests\FunctionalTests\iOS\Device\**\iOS.Device.Aot-Llvm.Test.csproj" />
</ItemGroup>
kotlarmilos marked this conversation as resolved.
Show resolved Hide resolved

<ItemGroup Condition="'$(TargetOS)' == 'tvos' and '$(RunDisablediOSTests)' != 'true'">
Expand Down Expand Up @@ -285,7 +280,7 @@
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.RegularExpressions\tests\FunctionalTests\System.Text.RegularExpressions.Tests.csproj" />

<!-- Functional tests on devices have problems with return codes from mlaunch -->
<ProjectExclusions Include="$(RepoRoot)\src\tests\FunctionalTests\$(TargetOS)\Device\**\*.Test.csproj" />
<ProjectExclusions Include="$(RepoRoot)\src\tests\FunctionalTests\$(TargetOS)\Device\**\*.Test.csproj" Exclude="$(RepoRoot)\src\tests\FunctionalTests\$(TargetOS)\Device\**\$(TargetOS).Device.Aot-Llvm.Test.csproj" />

<!-- https://github.com/dotnet/runtime/issues/73041 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.CSharp\tests\Microsoft.CSharp.Tests.csproj" />
Expand Down Expand Up @@ -519,7 +514,7 @@
</ItemGroup>

<ItemGroup>
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests.csproj" />
<SmokeTestProject Condition="'$(UseNativeAOTRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests.csproj" />
kotlarmilos marked this conversation as resolved.
Show resolved Hide resolved
<GrpcTestProject Include="$(RepoRoot)\src\tests\FunctionalTests\Android\Device_Emulator\gRPC\Android.Device_Emulator.gRPC.Test.csproj" />
</ItemGroup>

Expand Down Expand Up @@ -615,7 +610,7 @@
BuildInParallel="false" />
</ItemGroup>

<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(TargetOS)' == 'ios'">
<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(TargetOS)' == 'ios' and '$(RunAOTCompilation)' == 'true'">
<!-- Only System.Runtime tests on iOS for now -->
<ProjectReference Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests.csproj" />

Expand All @@ -624,6 +619,13 @@
BuildInParallel="false" />
</ItemGroup>


<ItemGroup Condition="'$(ArchiveTests)' == 'true' and ('$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos') and '$(UseNativeAOTRuntime)' == 'true'">
<ProjectReference Include="$(RepoRoot)\src\tests\FunctionalTests\$(TargetOS)\Device\**\*.Test.csproj"
Exclude="@(ProjectExclusions)"
BuildInParallel="false" />
</ItemGroup>

<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(TargetOS)' == 'ios' and '$(IsManualOrRollingBuild)' == 'true'">
<!-- These crash on tvOS, but do not on iOS. Run these only on the rolling builds -->
<ProjectReference Include="$(MSBuildThisFileDirectory)System.IO.MemoryMappedFiles\tests\System.IO.MemoryMappedFiles.Tests.csproj" />
Expand All @@ -632,8 +634,6 @@
</ItemGroup>

<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(RunSmokeTestsOnly)' != 'true' and '$(RunGrpcTestsOnly)' != 'true' and '$(TargetOS)' == 'iossimulator'">
<ProjectReference Include="$(MonoProjectRoot)sample\iOS\Program.csproj"
BuildInParallel="false" />
<ProjectReference Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Simulator\**\*.Test.csproj"
Exclude="@(ProjectExclusions)"
BuildInParallel="false" />
Expand All @@ -646,8 +646,6 @@
</ItemGroup>

<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(RunSmokeTestsOnly)' != 'true' and '$(RunGrpcTestsOnly)' != 'true' and '$(TargetOS)' == 'maccatalyst'">
<ProjectReference Include="$(MonoProjectRoot)sample\iOS\Program.csproj"
BuildInParallel="false" />
<ProjectReference Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Simulator\**\*.Test.csproj"
Exclude="@(ProjectExclusions)"
BuildInParallel="false" />
Expand Down
12 changes: 11 additions & 1 deletion src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

<PropertyGroup>
<_NetCoreAppCurrent>net8.0</_NetCoreAppCurrent>
<_NetCoreAppToolCurrent>net8.0</_NetCoreAppToolCurrent>
<TargetFramework>$(_NetCoreAppCurrent)</TargetFramework>
<_NetCoreAppToolCurrent>$(_NetCoreAppCurrent)</_NetCoreAppToolCurrent>
<MSBuildEnableWorkloadResolver>false</MSBuildEnableWorkloadResolver>
</PropertyGroup>

Expand Down Expand Up @@ -56,6 +57,15 @@
<LibraryBuilderDir>$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'LibraryBuilder'))</LibraryBuilderDir>

<MonoAotCrossDir>$([MSBuild]::NormalizePath($(BuildBaseDir), 'cross'))</MonoAotCrossDir>
<CoreCLRILCompilerDir>$([MSBuild]::NormalizeDirectory('$(BuildBaseDir)', 'ilc'))</CoreCLRILCompilerDir>
<ILCompilerTargetsDir>$([MSBuild]::NormalizePath('$(BuildBaseDir)', 'BuildIntegration'))</ILCompilerTargetsDir>
kotlarmilos marked this conversation as resolved.
Show resolved Hide resolved
<ILCompilerTargetsPath>$([MSBuild]::NormalizePath('$(ILCompilerTargetsDir)', 'Microsoft.DotNet.ILCompiler.SingleEntry.targets'))</ILCompilerTargetsPath>
<IlcToolsPath>$(CoreCLRILCompilerDir)</IlcToolsPath>
<IlcSdkPath>$([MSBuild]::NormalizeDirectory('$(BuildBaseDir)', 'aotsdk'))</IlcSdkPath>
<IlcFrameworkPath>$(MicrosoftNetCoreAppRuntimePackLibDir)</IlcFrameworkPath>
<IlcFrameworkNativePath>$(MicrosoftNetCoreAppRuntimePackNativeDir)</IlcFrameworkNativePath>
<ILLinkTargetsPath>$([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', 'build', 'Microsoft.NET.ILLink.targets'))</ILLinkTargetsPath>
<ILLinkTasksAssembly>$([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', 'tools', '$(_NetCoreAppCurrent)', 'ILLink.Tasks.dll'))</ILLinkTasksAssembly>
kotlarmilos marked this conversation as resolved.
Show resolved Hide resolved
<_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross'))</_MonoAotCrossCompilerPath>
<_MonoAotCrossCompilerPath Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">$(_MonoAotCrossCompilerPath).exe</_MonoAotCrossCompilerPath>
</PropertyGroup>
Expand Down
6 changes: 5 additions & 1 deletion src/mono/msbuild/apple/build/AppleBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@

<_IsLibraryMode Condition="'$(NativeLib)' != ''">true</_IsLibraryMode>

<_AotCompileTargetName Condition="'$(UseNativeAOTRuntime)' == 'true'">_AppleNativeAotCompile</_AotCompileTargetName>
<_AotCompileTargetName Condition="'$(UseNativeAOTRuntime)' != 'true'">_AppleAotCompile</_AotCompileTargetName>
<IlcCompileDependsOn>ComputeIlcCompileInputs;SetupOSSpecificProps;PrepareForILLink</IlcCompileDependsOn>

<AppleBuildAfterThisTarget Condition="'$(AppleBuildAfterThisTarget)' == ''">Publish</AppleBuildAfterThisTarget>
<AppleBuildDependsOn>
_InitializeCommonProperties;
_BeforeAppleBuild;
_AppleResolveReferences;
_ScanAssembliesDecideLightweightMarshaler;
$(_ProcessRuntimeComponentsForLibraryMode);
_AppleAotCompile;
$(_AotCompileTargetName);
_BuildNativeLibrary;
_AppleGenerateAppBundle;
_AfterAppleBuild
Expand Down
Loading
Loading