diff options
author | Parker Bibus <parkerbibus@microsoft.com> | 2022-03-10 01:55:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 01:55:02 +0300 |
commit | f06d2c07d84f2b535ea0fae3ba7d8e4e3cad5a98 (patch) | |
tree | 8ff6cf52c8b22e977840c751ffa4500fa2bf92f7 /eng | |
parent | d4f7ef48ac016fe9e3cc2cba712d0224e04de8ac (diff) |
[MAUI][PERF] Add IPA file usage for iOS Maui SOD (#66358)
* [PERF][MAUI] Add ios-arm64 logic to create .ipa for perf runs
Switches from simulator builds to device builds so we can track the size for the .ipa.
We generate a dummy codesigning cert and provisioning profile since device builds require that.
* First run with new ipa compatible ios perf setup and ipa app passthrough.
* Temporarily use preview 14 until all packages are synced for 6.0.300 for testing.
* Changed MacCatalyst folder copied on perf setup and made the mono ios app have it's subfolders copied.
* Update the calling args so xcopy knows the files are directories.
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Diffstat (limited to 'eng')
-rw-r--r-- | eng/pipelines/coreclr/templates/build-perf-maui-apps.yml | 20 | ||||
-rw-r--r-- | eng/pipelines/coreclr/templates/perf-job.yml | 8 | ||||
-rwxr-xr-x | eng/testing/performance/create-provisioning-profile.sh | 106 | ||||
-rw-r--r-- | eng/testing/performance/ios_scenarios.proj | 14 | ||||
-rw-r--r-- | eng/testing/performance/performance-setup.ps1 | 4 |
5 files changed, 137 insertions, 15 deletions
diff --git a/eng/pipelines/coreclr/templates/build-perf-maui-apps.yml b/eng/pipelines/coreclr/templates/build-perf-maui-apps.yml index 998c01ea513..bc747bda773 100644 --- a/eng/pipelines/coreclr/templates/build-perf-maui-apps.yml +++ b/eng/pipelines/coreclr/templates/build-perf-maui-apps.yml @@ -121,6 +121,9 @@ steps: displayName: Install MAUI workload workingDirectory: $(Build.SourcesDirectory) + - script: $(Build.SourcesDirectory)/eng/testing/performance/create-provisioning-profile.sh + displayName: Create iOS code signing and provisioning profile + - script: | ./dotnet new maui -n MauiTesting cd MauiTesting @@ -151,8 +154,15 @@ steps: - script: | chmod -R a+r . - ../dotnet build -bl:MauiiOS.binlog -f net6.0-ios -c Release - mv ./bin/Release/net6.0-ios/iossimulator-x64/MauiTesting.app ./MauiiOSDefault.app + + # remove net6.0-maccatalyst to work around https://github.com/dotnet/sdk/issues/21877 + cp MauiTesting.csproj MauiTesting.csproj.bak + sed -i'' -e 's/net6.0-ios;net6.0-maccatalyst/net6.0-ios/g' MauiTesting.csproj + + ../dotnet publish -bl:MauiiOS.binlog -f net6.0-ios --self-contained -r ios-arm64 -c Release /p:_RequireCodeSigning=false + mv ./bin/Release/net6.0-ios/ios-arm64/publish/MauiTesting.ipa ./MauiiOSDefault.ipa + + cp MauiTesting.csproj.bak MauiTesting.csproj displayName: Build MAUI iOS workingDirectory: $(Build.SourcesDirectory)/MauiTesting @@ -196,10 +206,10 @@ steps: - template: /eng/pipelines/common/upload-artifact-step.yml parameters: - rootFolder: $(Build.SourcesDirectory)/MauiTesting/MauiiOSDefault.app + rootFolder: $(Build.SourcesDirectory)/MauiTesting/MauiiOSDefault.ipa includeRootFolder: true - displayName: Maui iOS App - artifactName: MauiiOSDefault + displayName: Maui iOS IPA + artifactName: MauiiOSDefaultIPA archiveExtension: '.tar.gz' archiveType: tar tarCompression: gz diff --git a/eng/pipelines/coreclr/templates/perf-job.yml b/eng/pipelines/coreclr/templates/perf-job.yml index 18912fe3151..e95b5f03ec2 100644 --- a/eng/pipelines/coreclr/templates/perf-job.yml +++ b/eng/pipelines/coreclr/templates/perf-job.yml @@ -185,11 +185,11 @@ jobs: displayName: 'iOS Sample App LLVM' - template: /eng/pipelines/common/download-artifact-step.yml parameters: - unpackFolder: $(Build.SourcesDirectory)/MauiiOSDefault + unpackFolder: $(Build.SourcesDirectory)/MauiiOSDefaultIPA cleanUnpackFolder: false - artifactFileName: 'MauiiOSDefault.tar.gz' - artifactName: 'MauiiOSDefault' - displayName: 'Maui iOS App' + artifactFileName: 'MauiiOSDefaultIPA.tar.gz' + artifactName: 'MauiiOSDefaultIPA' + displayName: 'Maui iOS IPA' - template: /eng/pipelines/common/download-artifact-step.yml parameters: unpackFolder: $(Build.SourcesDirectory)/MauiMacCatalystDefault diff --git a/eng/testing/performance/create-provisioning-profile.sh b/eng/testing/performance/create-provisioning-profile.sh new file mode 100755 index 00000000000..e257022299c --- /dev/null +++ b/eng/testing/performance/create-provisioning-profile.sh @@ -0,0 +1,106 @@ +#!/usr/bin/env bash + +set -ex + +CERT_COMMON_NAME="Apple Development: Self Sign" +TEMP_FOLDER=$(mktemp -d) + +cd "$TEMP_FOLDER" + +# Generate self-signed codesigning cert +cat <<EOF > selfsigncert.conf +[ req ] +distinguished_name = self_sign +prompt = no +[ self_sign ] +CN = $CERT_COMMON_NAME +[ extensions ] +basicConstraints = critical,CA:false +keyUsage = critical,digitalSignature +extendedKeyUsage = critical,1.3.6.1.5.5.7.3.3 +EOF + +openssl genrsa -out selfsigncert.key 2048 +openssl req -x509 -new -config selfsigncert.conf -nodes -key selfsigncert.key -extensions extensions -sha256 -out selfsigncert.crt +openssl pkcs12 -export -inkey selfsigncert.key -in selfsigncert.crt -passout pass:PLACEHOLDERselfsignpass -out selfsigncert.p12 + +# create keychain and import cert into it +security delete-keychain selfsign.keychain || true +security create-keychain -p PLACEHOLDERselfsignpass selfsign.keychain +security import selfsigncert.p12 -P PLACEHOLDERselfsignpass -k selfsign.keychain -T /usr/bin/codesign -T /usr/bin/security +security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k PLACEHOLDERselfsignpass selfsign.keychain +security unlock-keychain -p PLACEHOLDERselfsignpass selfsign.keychain +security set-keychain-settings -lut 21600 selfsign.keychain + +# create template for provisioning profile .plist +cat <<EOF > SelfSign.plist +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>ApplicationIdentifierPrefix</key> + <array> + <string>SELFSIGN</string> + </array> + <key>CreationDate</key> + <date>2000-01-01T00:00:00Z</date> + <key>Platform</key> + <array> + <string>iOS</string> + </array> + <key>DeveloperCertificates</key> + <array> + </array> + <key>Entitlements</key> + <dict> + <key>keychain-access-groups</key> + <array> + <string>SELFSIGN.*</string> + </array> + <key>get-task-allow</key> + <false/> + <key>application-identifier</key> + <string>SELFSIGN.*</string> + <key>com.apple.developer.team-identifier</key> + <string>SELFSIGN</string> + </dict> + <key>ExpirationDate</key> + <date>2100-01-01T00:00:00Z</date> + <key>Name</key> + <string>Self Sign Profile</string> + <key>ProvisionedDevices</key> + <array> + </array> + <key>TeamIdentifier</key> + <array> + <string>SELFSIGN</string> + </array> + <key>TeamName</key> + <string>Selfsign Team</string> + <key>TimeToLive</key> + <integer>36500</integer> + <key>UUID</key> + <string></string> + <key>Version</key> + <integer>1</integer> +</dict> +</plist> +EOF + +# fill out the template (UUID and the certificate content) +PROFILE_UUID=$(uuidgen) +CERT_CONTENT=$(sed -e '/BEGIN CERTIFICATE/d;/END CERTIFICATE/d' selfsigncert.crt) + +plutil -replace UUID -string "$PROFILE_UUID" SelfSign.plist +plutil -replace DeveloperCertificates.0 -data "$CERT_CONTENT" SelfSign.plist + +# append new keychain to keychain search so "security cms" finds the new certs +security list-keychains -d user -s $(security list-keychains -d user | tr -d '"') selfsign.keychain + +# build .mobileprovision file out of the provisioning profile .plist +security cms -S -N "$CERT_COMMON_NAME" -k selfsign.keychain -p PLACEHOLDERselfsignpass -i SelfSign.plist -o SelfSign.mobileprovision + +# copy provisioning profile to the right location +mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles/" +rm -f "$HOME/Library/MobileDevice/Provisioning Profiles/SelfSign.mobileprovision" +cp SelfSign.mobileprovision "$HOME/Library/MobileDevice/Provisioning Profiles/SelfSign.mobileprovision" diff --git a/eng/testing/performance/ios_scenarios.proj b/eng/testing/performance/ios_scenarios.proj index c4e87d7ac58..6af44c3e951 100644 --- a/eng/testing/performance/ios_scenarios.proj +++ b/eng/testing/performance/ios_scenarios.proj @@ -26,19 +26,25 @@ <ItemGroup> <HelixWorkItem Include="SOD - iOS HelloWorld .app Size"> <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory> - <PreCommands>cd $(ScenarioDirectory)helloios;xcopy %HELIX_CORRELATION_PAYLOAD%\iosHelloWorld\$(LlvmPath) .\app\/e;$(Python) pre.py</PreCommands> + <PreCommands>cd $(ScenarioDirectory)helloios;xcopy %HELIX_CORRELATION_PAYLOAD%\iosHelloWorld\$(LlvmPath) .\app/e/i;$(Python) pre.py --name app</PreCommands> <Command>$(Python) test.py sod --scenario-name "%(Identity)"</Command> <PostCommands>$(Python) post.py</PostCommands> </HelixWorkItem> - <HelixWorkItem Include="SOD - Maui iOS .app Size" Condition="'$(iOSLlvmBuild)' == 'False'"> + <HelixWorkItem Include="SOD - Maui iOS IPA Size" Condition="'$(iOSLlvmBuild)' == 'False'"> <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory> - <PreCommands>cd $(ScenarioDirectory)mauiios;xcopy %HELIX_CORRELATION_PAYLOAD%\MauiiOSDefault .\app\/e;$(Python) pre.py</PreCommands> + <PreCommands>cd $(ScenarioDirectory)mauiios;copy %HELIX_CORRELATION_PAYLOAD%\MauiiOSDefaultIPA\MauiiOSDefault.ipa .;$(Python) pre.py --name MauiiOSDefault.ipa</PreCommands> + <Command>$(Python) test.py sod --scenario-name "%(Identity)"</Command> + <PostCommands>$(Python) post.py</PostCommands> + </HelixWorkItem> + <HelixWorkItem Include="SOD - Maui iOS IPA Size Unzipped" Condition="'$(iOSLlvmBuild)' == 'False'"> + <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory> + <PreCommands>cd $(ScenarioDirectory)mauiios;copy %HELIX_CORRELATION_PAYLOAD%\MauiiOSDefaultIPA\MauiiOSDefault.ipa .;$(Python) pre.py --unzip --name MauiiOSDefault.ipa</PreCommands> <Command>$(Python) test.py sod --scenario-name "%(Identity)"</Command> <PostCommands>$(Python) post.py</PostCommands> </HelixWorkItem> <HelixWorkItem Include="SOD - Maui MacCatalyst .app Size" Condition="'$(iOSLlvmBuild)' == 'False'"> <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory> - <PreCommands>cd $(ScenarioDirectory)mauiios;xcopy %HELIX_CORRELATION_PAYLOAD%\MauiMacCatalystDefault .\app\/e;$(Python) pre.py</PreCommands> + <PreCommands>cd $(ScenarioDirectory)mauiios;xcopy %HELIX_CORRELATION_PAYLOAD%\MauiMacCatalystDefault .\app/e/i;$(Python) pre.py --name app</PreCommands> <Command>$(Python) test.py sod --scenario-name "%(Identity)"</Command> <PostCommands>$(Python) post.py</PostCommands> </HelixWorkItem> diff --git a/eng/testing/performance/performance-setup.ps1 b/eng/testing/performance/performance-setup.ps1 index 1151d0d47ed..3eca57f9cdd 100644 --- a/eng/testing/performance/performance-setup.ps1 +++ b/eng/testing/performance/performance-setup.ps1 @@ -169,8 +169,8 @@ if ($iOSMono) { Copy-Item -path "$SourceDirectory\iosHelloWorld\llvm" $PayloadDirectory\iosHelloWorld\llvm -Recurse } else { Copy-Item -path "$SourceDirectory\iosHelloWorld\nollvm" $PayloadDirectory\iosHelloWorld\nollvm -Recurse - Copy-Item -path "$SourceDirectory\MauiiOSDefault" $PayloadDirectory\MauiiOSDefault -Recurse - Copy-Item -path "$SourceDirectory\MauiMacCatalystDefault" $PayloadDirectory\MauiMacCatalystDefault -Recurse + Copy-Item -path "$SourceDirectory\MauiiOSDefaultIPA" $PayloadDirectory\MauiiOSDefaultIPA -Recurse + Copy-Item -path "$SourceDirectory\MauiMacCatalystDefault\MauiMacCatalystDefault.app" $PayloadDirectory\MauiMacCatalystDefault -Recurse } $SetupArguments = $SetupArguments -replace $Architecture, 'arm64' |