-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Enable NativeAOT runtime tests on MacCatalyst #102882
base: main
Are you sure you want to change the base?
Changes from 16 commits
252bfd7
454c84b
7f1201c
5845dc7
67100e7
4faf43f
662dd78
2beb301
f321057
18919be
44e5b4e
890e1d8
8001727
8676d0e
3c9c0ff
10216ba
86777fc
ed006a2
75582d3
f90f0d7
61b4358
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't recall the initial reason for including it, and it is likely no longer needed since we now use a single build command. I believe it was related to the initial multi-command build process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this property jobs reports:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for checking it out. I think we should investigate/refactor this (as a follow-up). |
||
testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -457,7 +457,7 @@ CLRTestExitCode=$? | |
CLRTestExpectedExitCode=0 | ||
]]> | ||
</BashCLRTestLaunchCmds> | ||
<BashCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun' and ('$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'maccatalyst')"> | ||
<BashCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun' and ('$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator')"> | ||
<![CDATA[ | ||
__Command="" | ||
if [ ! -z ${__TestDotNetCmd+x} ] %3B then | ||
|
@@ -484,6 +484,35 @@ $__Command $HARNESS_RUNNER apple just-run %5c | |
-v | ||
CLRTestExitCode=$? | ||
|
||
# Exit code of xharness is zero when tests finished successfully | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need special-case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The xharness doesn't support the The Mono tests on MacCatalyst include the AppleTestRunner. To support this for Native AOT, we need to implement #91871. /cc: @premun Do you know why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I remember correctly, The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the explanation, I am good with the changes. |
||
CLRTestExpectedExitCode=0 | ||
]]> | ||
</BashCLRTestLaunchCmds> | ||
<BashCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun' and '$(TargetOS)' == 'maccatalyst'"> | ||
<![CDATA[ | ||
__Command="" | ||
if [ ! -z ${__TestDotNetCmd+x} ] %3B then | ||
__Command+=" $__TestDotNetCmd" | ||
else | ||
__Command+=" dotnet" | ||
fi | ||
|
||
if [ ! -z "$XHARNESS_CLI_PATH" ]; then | ||
# When running in CI, we only have the .NET runtime available | ||
# We need to call the XHarness CLI DLL directly via dotnet exec | ||
HARNESS_RUNNER="exec $XHARNESS_CLI_PATH" | ||
else | ||
HARNESS_RUNNER="xharness" | ||
fi | ||
|
||
$__Command $HARNESS_RUNNER apple run %5c | ||
--app="${__TestBinaryBase}/${__Category}.app" %5c | ||
--output-directory="$__OutputDir" %5c | ||
--expected-exit-code=100 %5c | ||
--targets maccatalyst %5c | ||
-v | ||
CLRTestExitCode=$? | ||
|
||
# Exit code of xharness is zero when tests finished successfully | ||
CLRTestExpectedExitCode=0 | ||
]]> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -460,14 +460,15 @@ | |
|
||
<!-- This target moves app bundles to the payload directory --> | ||
<Target Name="AfterAppleBuild"> | ||
<!-- Apparently MSBuild cannot move directories and recursively copying a | ||
a directory requires writing some sort of recursive traversal | ||
logic yourself. --> | ||
<!-- MSBuild cannot move directories or recursively copy content. --> | ||
<ItemGroup> | ||
<RecursiveCopyHack Include="$(AppBundlePath)/**/*.*" /> | ||
<BundleContent Include="$(AppBundlePath)/**/*.*" /> | ||
</ItemGroup> | ||
<MakeDir Directories="$(FinalPath)" /> | ||
<Copy SourceFiles="@(RecursiveCopyHack)" DestinationFolder="$(FinalPath)/%(RecursiveDir)" /> | ||
<!-- MacCatalyst requires Contents/Info.plist and Contents/MacOS/ApplicationBinary --> | ||
<Copy Condition="'$(TargetOS)' == 'maccatalyst' AND '%(BundleContent.Filename)%(BundleContent.Extension)' == 'Info.plist'" SourceFiles="@(BundleContent)" DestinationFolder="$(FinalPath)/Contents/%(RecursiveDir)" /> | ||
<Copy Condition="'$(TargetOS)' == 'maccatalyst' AND '%(BundleContent.Filename)%(BundleContent.Extension)' != 'Info.plist'" SourceFiles="@(BundleContent)" DestinationFolder="$(FinalPath)/Contents/MacOS/%(RecursiveDir)" /> | ||
<Copy Condition="'$(TargetOS)' != 'maccatalyst'" SourceFiles="@(BundleContent)" DestinationFolder="$(FinalPath)/%(RecursiveDir)" /> | ||
Comment on lines
-470
to
+471
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be already there, but I couldn't recursively copy content in msbuild from the build directory to the bundle. The It is in place to verify E2E tests, but I think we need to resolve this before merging. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, that is what I was confused about. |
||
<RemoveDir Directories="$(AppBundlePath)" /> | ||
<Message Importance="High" Text="Final app: $(FinalPath)" /> | ||
</Target> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be running sandboxed tests as well, as that is matching more what the end user would experience (sandbox entitlement is required by the App Store).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are failures for the Sandboxed version in the CI, I believe
DevTeamProvisioning
needs to be set toadhoc
(but not 100% sure).