-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[infra] Enable trimming on Helix for Apple mobile #96169
Conversation
Tagging subscribers to this area: @directhex Issue DetailsDescriptionThis PR tests trimming on Helix for Apple mobile targets. Initial work is available at #92719.
|
/azp run runtime-ioslike |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-ioslike |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-ioslike |
Azure Pipelines successfully started running 1 pipeline(s). |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-ioslike |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-ioslikesimulator |
Azure Pipelines successfully started running 1 pipeline(s). |
testBuildArgs: /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildTestsOnHelix=true | ||
testRunNamePrefixSuffix: Mono_$(_BuildConfig) | ||
extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true | ||
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml |
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 moved from extraStepsTemplate/extraStepsParameters in #92375, is there a particular reason as to why we are moving back?
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.
Thanks, reverted. I assume this was a merge conflict issue.
eng/testing/tests.ioslike.targets
Outdated
@@ -16,7 +16,7 @@ | |||
<!-- 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> | |||
<!-- The command below sets default properties for runtime and library tests --> | |||
<_AOTBuildCommand>$(_AOTBuildCommand) /p:XHARNESS_EXECUTION_DIR="$XHARNESS_EXECUTION_DIR" /p:RunAOTCompilation=$(RunAOTCompilation) /p:UseNativeAOTRuntime=$(UseNativeAOTRuntime) /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="$XHARNESS_EXECUTION_DIR" /p:EnableAggressiveTrimming=$(EnableAggressiveTrimming) /p:UsePortableRuntimePack=$(UsePortableRuntimePack) /p:RunAOTCompilation=$(RunAOTCompilation) /p:UseNativeAOTRuntime=$(UseNativeAOTRuntime) /p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:MonoForceInterpreter=$(MonoForceInterpreter) /p:MonoEnableLLVM=true /p:DevTeamProvisioning=$(DevTeamProvisioning) /p:Configuration=$(Configuration)</_AOTBuildCommand> |
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.
Which scenarios would we not want to use the portable runtime pack?
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 can revert this change. We were testing different options for trimming on helix and one of them was to trim on build machines.
<OriginalPublishDir>$([System.IO.Path]::GetFullPath('$(TestRootDir)..\publish\'))</OriginalPublishDir> | ||
<ExtraFilesPath>$(OriginalPublishDir)..\extraFiles\</ExtraFilesPath> |
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.
These are overwriting L6/L7
<Copy SourceFiles="@(_RuntimePackFiles)" | ||
DestinationFolder="$(OriginalPublishDir)" /> | ||
</Target> | ||
|
||
<Target Name="_TrimApp" DependsOnTargets="ILLink;CopyFilesToPublishDirectory"> | ||
<Delete Files="@(_RemovedManagedAssembly)" /> |
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.
Should we be deleting these files?
Is the main intent to prevent them from being added to AppleAssembliesToBundle?
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.
Right, let's try to use _RemovedManagedAssembly
to filter out AppleAssembliesToBundle
.
<ReferencePath Include="@(AppleReferenceSharedPathFiles->'$(MicrosoftNetCoreAppRuntimePackLibDir)%(FileName)%(Extension)')" /> | ||
<ReferencePath Include="@(AppleReferenceExtraPathFiles->'$(ExtraFilesPath)%(FileName)%(Extension)')" /> |
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.
What do these do?
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.
The ReferencePath
items are used by ILLink targets.
<AppleBuildDependsOn Condition="'$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAOTRuntime)' != 'true'">ConfigureTrimming;_TrimApp;$(AppleBuildDependsOn)</AppleBuildDependsOn> | ||
<AppleBuildDependsOn>_PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;$(AppleBuildDependsOn);_AfterAppleBuildOnHelix</AppleBuildDependsOn> | ||
<!-- Forced by ILLink targets --> | ||
<SelfContained>true</SelfContained> |
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.
Are we always hitting ILLink targets now (if so, we can probably remove L29 which also sets SelfContained to true right?)? Or is this now required because of ConfigureTrimming being added (if so we should only set this for the same conditions that ConfigureTrimming has right?)
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.
Yes, I believe we can remove it.
<AppleBuildDependsOn>_PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;$(AppleBuildDependsOn);_AfterAppleBuildOnHelix</AppleBuildDependsOn> | ||
<!-- Forced by ILLink targets --> | ||
<SelfContained>true</SelfContained> | ||
<PublishDir>$(OriginalPublishDir)</PublishDir> |
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.
Is this also forced by ILLink targets? Or is there another reason to have this?
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.
I think it is used by ILLink targets.
|
||
<Target Name="BundleTestAppleApp" DependsOnTargets="AppleBuild" /> | ||
|
||
<Target Name="_PrepareForAppleBuildAppOnHelix" DependsOnTargets="_PublishRuntimePack"> | ||
<Target Name="_PrepareForAppleBuildAppOnHelix"> |
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.
Out of curiosity, does moving _PublishRuntimePack
from this target's DependsOnTargets up to AppleBuildDependsOn
change anything functionally?
If this target is the primary reason to have _PublishRuntimePack, I think it would be better to keep that dependency.
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.
It shouldn't change the functionality. The primary reason for moving it to the AppleBuildDependsOn
is to have a clear list of targets executed.
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.
Do you think it should be reverted/added as a DependsOnTargets
in _PrepareForAppleBuildAppOnHelix
?
/azp run runtime-ioslike |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-ioslike |
Azure Pipelines successfully started running 1 pipeline(s). |
Closing this PR in favor of #100669 which has rebased commits. |
Description
This PR (fixes #91923) introduces the trimming of library tests on Helix for Apple mobile targets. With trimming enabled, the configuration more closely mirrors the experience of an end user when building Apple mobile applications.
This change results in a
20min (42%) reduction in CI job builds for iOS
(a subset of tests) and a22min (18%) reduction for tvOS
(the complete coverage)Initial work is available at #92719.
Test job run: https://dev.azure.com/dnceng-public/public/_build/results?buildId=622954&view=results