From cfdccdc086119e44ba9f0bed0b722be003bf2da6 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 25 Mar 2022 16:38:02 +0100 Subject: [PATCH 1/9] [devops] Upload binlogs from the tests run as well as the build. (#14458) --- .../automation/templates/tests/run-tests.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/devops/automation/templates/tests/run-tests.yml b/tools/devops/automation/templates/tests/run-tests.yml index 18af947a83..08831dbdea 100644 --- a/tools/devops/automation/templates/tests/run-tests.yml +++ b/tools/devops/automation/templates/tests/run-tests.yml @@ -273,6 +273,25 @@ steps: continueOnError: true condition: succeededOrFailed() +# Upload all the binlogs +# Copy all the binlogs to a separate directory, keeping directory structure. +- script: | + set -x + mkdir -p $(Build.ArtifactStagingDirectory)/all-binlogs + rsync -av --prune-empty-dirs --include '*/' --include '*.binlog' --exclude '*' $(Build.SourcesDirectory)/xamarin-macios $(Build.ArtifactStagingDirectory)/all-binlogs + displayName: Copy all binlogs + continueOnError: true + condition: succeededOrFailed() + +# Publish all the binlogs we collected in the previous step +- task: PublishPipelineArtifact@1 + displayName: 'Publish Artifact: All binlogs' + inputs: + targetPath: $(Build.ArtifactStagingDirectory)/all-binlogs + artifactName: all-binlogs-test-$(Build.BuildId) + continueOnError: true + condition: succeededOrFailed() + # Be nice and clean behind you - pwsh: | cd $Env:SYSTEM_DEFAULTWORKINGDIRECTORY/xamarin-macios/tools/devops/automation/scripts/ From ab513555a62485fb5f229cc0dce6e8defb3e7139 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 25 Mar 2022 16:38:37 +0100 Subject: [PATCH 2/9] [tests] There's no need to have different logic to compute the source root path on Azure DevOps. (#14485) --- tests/common/Configuration.cs | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/tests/common/Configuration.cs b/tests/common/Configuration.cs index a1acc09de2..14386c2f77 100644 --- a/tests/common/Configuration.cs +++ b/tests/common/Configuration.cs @@ -318,31 +318,18 @@ namespace Xamarin.Tests public static string RootPath { get { - if (IsVsts) { - var workingDir = Environment.GetEnvironmentVariable ("SYSTEM_DEFAULTWORKINGDIRECTORY"); - var git = Path.Combine (workingDir, ".git"); - if (Directory.Exists (git)) { - return workingDir; - } else { - var xamarin = Path.Combine (workingDir, "xamarin-macios"); - if (!Directory.Exists (xamarin)) - throw new Exception ($"Could not find the xamarin-macios repo given the test working directory {workingDir}"); - return xamarin; - } - } else { - var dir = TestAssemblyDirectory; - var path = Path.Combine (dir, ".git"); - while (!Directory.Exists (path) && path.Length > 3) { - dir = Path.GetDirectoryName (dir); - if (dir is null) - throw new Exception ($"Could not find the xamarin-macios repo given the test assembly directory {TestAssemblyDirectory}"); - path = Path.Combine (dir, ".git"); - } - path = Path.GetDirectoryName (path); - if (!Directory.Exists (path)) + var dir = TestAssemblyDirectory; + var path = Path.Combine (dir, ".git"); + while (!Directory.Exists (path) && path.Length > 3) { + dir = Path.GetDirectoryName (dir); + if (dir is null) throw new Exception ($"Could not find the xamarin-macios repo given the test assembly directory {TestAssemblyDirectory}"); - return path; + path = Path.Combine (dir, ".git"); } + path = Path.GetDirectoryName (path); + if (!Directory.Exists (path)) + throw new Exception ($"Could not find the xamarin-macios repo given the test assembly directory {TestAssemblyDirectory}"); + return path; } } From d36d87f11e8dedb454dbec86ff3c029c1276f58f Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 25 Mar 2022 11:38:52 -0400 Subject: [PATCH 3/9] [CI] Checkout the head ref rather than the merge or a reset, this should fix issues with the test selector. (#14496) --- tests/xharness/GitHub.cs | 4 ++-- tools/devops/automation/templates/build/build.yml | 8 +++++++- tools/devops/automation/templates/tests/build.yml | 8 +++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/xharness/GitHub.cs b/tests/xharness/GitHub.cs index 06785a06a0..749a5a74b7 100644 --- a/tests/xharness/GitHub.cs +++ b/tests/xharness/GitHub.cs @@ -164,8 +164,8 @@ namespace Xharness { IEnumerable GetModifiedFilesLocally (int pullRequest) { - var base_commit = $"origin/pr/{pullRequest}/merge^"; - var head_commit = $"origin/pr/{pullRequest}/merge"; + var base_commit = $"origin/pull/{pullRequest}/merge^"; + var head_commit = $"origin/pull/{pullRequest}/merge"; harness.Log ("Fetching modified files for commit range {0}..{1}", base_commit, head_commit); diff --git a/tools/devops/automation/templates/build/build.yml b/tools/devops/automation/templates/build/build.yml index af36934169..36d0e61f95 100644 --- a/tools/devops/automation/templates/build/build.yml +++ b/tools/devops/automation/templates/build/build.yml @@ -52,7 +52,13 @@ steps: - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - pwsh: | - git reset --hard HEAD^2 + git config remote.origin.fetch '+refs/pull/*:refs/remotes/origin/pull/*' + git fetch origin + $branch="$(Build.SourceBranch)".Replace("merge", "head") + $branch=$branch.Replace("refs", "origin") + Write-Host "Checking out branch $branch" + git checkout $branch + git branch -a displayName: "Undo Github merge" workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-macios diff --git a/tools/devops/automation/templates/tests/build.yml b/tools/devops/automation/templates/tests/build.yml index 79ec21be85..91dbf17b39 100644 --- a/tools/devops/automation/templates/tests/build.yml +++ b/tools/devops/automation/templates/tests/build.yml @@ -54,7 +54,13 @@ steps: - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - pwsh: | - git reset --hard HEAD^2 + git config remote.origin.fetch '+refs/pull/*:refs/remotes/origin/pull/*' + git fetch origin + $branch="$(Build.SourceBranch)".Replace("merge", "head") + $branch=$branch.Replace("refs", "origin") + Write-Host "Checking out branch $branch" + git checkout $branch + git branch -a displayName: "Undo Github merge" workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-macios From d3ee7165f4b30aa76709c093784690a727420675 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 28 Mar 2022 08:05:11 +0200 Subject: [PATCH 4/9] [devops] Fix typo on step name. (#14500) --- tools/devops/automation/templates/common/download-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/devops/automation/templates/common/download-artifacts.yml b/tools/devops/automation/templates/common/download-artifacts.yml index 524c2b8007..8b870674c7 100644 --- a/tools/devops/automation/templates/common/download-artifacts.yml +++ b/tools/devops/automation/templates/common/download-artifacts.yml @@ -43,5 +43,5 @@ steps: - powershell: | Write-Host "##vso[task.setvariable variable=TEST_SUMMARY_PATH]$Env:SYSTEM_DEFAULTWORKINGDIRECTORY\Reports\TestSummary-${{ parameters.testPrefix }}\TestSummary.md" Write-Host "##vso[task.setvariable variable=HTML_REPORT_PATH]$Env:SYSTEM_DEFAULTWORKINGDIRECTORY\HtmlReport-${{ parameters.testPrefix }}" - displayName: Pusblish artifact paths + displayName: Publish artifact paths name: artifacts # not to be confused with the displayName, this is used to later use the name of the step to access the output variables from an other job From 1e8e4bb69ba3751e6c40b01ac3984aa13d8e04aa Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 28 Mar 2022 08:29:56 +0200 Subject: [PATCH 5/9] [devops] Stop asking *all* tests print *all* stack traces. (#14499) This makes stdout much more readable. It also fixes https://github.com/xamarin/maccore/issues/2562. --- tools/devops/automation/templates/tests/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/devops/automation/templates/tests/run-tests.yml b/tools/devops/automation/templates/tests/run-tests.yml index 08831dbdea..efdbdd01a9 100644 --- a/tools/devops/automation/templates/tests/run-tests.yml +++ b/tools/devops/automation/templates/tests/run-tests.yml @@ -219,7 +219,7 @@ steps: make -C builds downloads -j || true make -C builds .stamp-mono-ios-sdk-destdir -j || true RC=0 - MONO_ENV_OPTIONS=--trace=E:all make -C tests ${{ parameters.makeTarget }} || RC=$? + make -C tests ${{ parameters.makeTarget }} || RC=$? if [ $RC -eq 0 ]; then echo "##vso[task.setvariable variable=TESTS_JOBSTATUS;isOutput=true]Succeeded" else From 685cf52bff389c8f059040fad9c95012e6c9879d Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 28 Mar 2022 08:58:37 +0200 Subject: [PATCH 6/9] [dotnet-linker] Always use 'dlsym' on Mac Catalyst to work around #14437. (#14483) The problem is: 1. On Mac Catalyst we AOT-compile managed code by default (since we can't JIT). 2. We recently added a binding for the `ASAuthorizationAllSupportedPublicKeyCredentialDescriptorTransports` native function, which is only available on Mac Catalyst 15+. The containing framework (`AuthenticationServices`) is available in Mac Catalyst 13+ (which means we won't link weakly with the framework). 3. The AOT compiler emits a non-weak reference to the `ASAuthorizationAllSupportedPublicKeyCredentialDescriptorTransports` symbol. 4. macOS verifies that there aren't any undefined non-weak symbol references at launch. 5. The `ASAuthorizationAllSupportedPublicKeyCredentialDescriptorTransports` symbol doesn't exist on macOS 11, and thus the app crashes at launch on macOS 11. I tried the same thing on iOS, and the problem doesn't occur because iOS doesn't to step 4 - the symbol reference are resolved at first use, which means that everything works just fine until the first time the P/Invoke is called (and then the app aborts). The workaround is to tell the AOT compiler to not emit a direct reference to the P/Invoke (and use dlsym instead) - this fixes case 3) above. Drawbacks: dlsym is slower than a direct reference. Fixes https://github.com/xamarin/xamarin-macios/issues/14437. --- tools/common/Application.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/common/Application.cs b/tools/common/Application.cs index c36ce659a4..30d07342f9 100644 --- a/tools/common/Application.cs +++ b/tools/common/Application.cs @@ -1701,8 +1701,10 @@ namespace Xamarin.Bundler { return !Profile.IsSdkAssembly (Path.GetFileNameWithoutExtension (assembly)); case ApplePlatform.TVOS: case ApplePlatform.WatchOS: - case ApplePlatform.MacCatalyst: return false; + case ApplePlatform.MacCatalyst: + // https://github.com/xamarin/xamarin-macios/issues/14437 + return true; default: throw ErrorHelper.CreateError (71, Errors.MX0071, Platform, ProductName); } From 0802e2c3598fc807e2d663099a672f0008ca02a9 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 28 Mar 2022 08:59:29 +0200 Subject: [PATCH 7/9] [tests] Store symlinks in zips. Fixes #xamarin/maccore@2548. (#14459) Fixes https://github.com/xamarin/maccore/issues/2548. --- tests/Makefile | 2 +- tests/dotnet/UnitTests/BundleStructureTest.cs | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index f01d0edea6..a4b574900c 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -400,5 +400,5 @@ package-test-libraries.zip: $(Q) @$(MAKE) all -C test-libraries $(Q) mkdir -p $@.tmpdir $(Q) $(CP) -a test-libraries/* $@.tmpdir - $(Q_GEN) cd $@.tmpdir && zip -9r $(abspath $@) . + $(Q_GEN) cd $@.tmpdir && zip -9r --symlinks $(abspath $@) . $(Q) rm -rf $@.tmpdir diff --git a/tests/dotnet/UnitTests/BundleStructureTest.cs b/tests/dotnet/UnitTests/BundleStructureTest.cs index 436b618fe0..10272c3fad 100644 --- a/tests/dotnet/UnitTests/BundleStructureTest.cs +++ b/tests/dotnet/UnitTests/BundleStructureTest.cs @@ -535,19 +535,15 @@ namespace Xamarin.Tests { // Debug [TestCase (ApplePlatform.iOS, "ios-arm64;ios-arm", CodeSignature.All, "Debug")] [TestCase (ApplePlatform.iOS, "iossimulator-x64", CodeSignature.Frameworks, "Debug")] -#if !NET //ignore due to https://github.com/xamarin/maccore/issues/2548 [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64", CodeSignature.All, "Debug")] [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64;maccatalyst-arm64", CodeSignature.All, "Debug")] - [TestCase (ApplePlatform.MacOSX, "osx-x64", CodeSignature.None, "Debug")] - [TestCase (ApplePlatform.MacOSX, "osx-x64;osx-arm64", CodeSignature.None, "Debug")] -#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64", CodeSignature.Frameworks, "Debug")] + [TestCase (ApplePlatform.MacOSX, "osx-x64;osx-arm64", CodeSignature.Frameworks, "Debug")] [TestCase (ApplePlatform.TVOS, "tvos-arm64", CodeSignature.All, "Debug")] // Release [TestCase (ApplePlatform.iOS, "ios-arm64;ios-arm", CodeSignature.All, "Release")] -#if !NET // ignore due to https://github.com/xamarin/maccore/issues/2548 [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64;maccatalyst-arm64", CodeSignature.All, "Release")] - [TestCase (ApplePlatform.MacOSX, "osx-x64", CodeSignature.None, "Release")] -#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64", CodeSignature.Frameworks, "Release")] [TestCase (ApplePlatform.TVOS, "tvos-arm64", CodeSignature.All, "Release")] public void Build (ApplePlatform platform, string runtimeIdentifiers, CodeSignature signature, string configuration) { From df7f86c53bf0e20ee0c265f5d6c3ff6f74b64c9e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 28 Mar 2022 09:47:17 +0200 Subject: [PATCH 8/9] Update dependencies from https://github.com/dotnet/installer build 20220325.4 (#14516) Microsoft.Dotnet.Sdk.Internal From Version 6.0.300-preview.22173.2 -> To Version 6.0.300-preview.22175.4 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 95e177f371..e51e5e06f3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/installer - 89d0c23a2e4356bf77230dfd705ef027e193f681 + 6791ff652bd2d5d007b92a66203d3483ca1948cf https://github.com/dotnet/linker diff --git a/eng/Versions.props b/eng/Versions.props index b825e47f1a..3700ca2137 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,7 +1,7 @@ - 6.0.300-preview.22173.2 + 6.0.300-preview.22175.4 6.0.200-1.22124.2 6.0.0-beta.21212.6 6.0.0-rc.2.21468.3 From 00d9e1ba1ac835abc0c72702347d292f046be3d7 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 28 Mar 2022 10:19:12 +0200 Subject: [PATCH 9/9] [fabricbot] Add initial config file. (#14501) This initial config file tells the author of an issue that if anybody adds the `need-info` label, they have 7 days to answer before we close the issue due to lack of response. --- .github/fabricbot.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/fabricbot.json diff --git a/.github/fabricbot.json b/.github/fabricbot.json new file mode 100644 index 0000000000..1e963aa1e9 --- /dev/null +++ b/.github/fabricbot.json @@ -0,0 +1,35 @@ +[ + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "IssuesOnlyResponder", + "version": "1.0", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "name": "labelAdded", + "parameters": { + "label": "need-info" + } + } + ] + }, + "eventType": "issue", + "eventNames": [ + "issues", + "project_card" + ], + "taskName": "Add comment when 'need-info' is applied to issue", + "actions": [ + { + "name": "addReply", + "parameters": { + "comment": "Hi @${issueAuthor}. We have added the \"need-info\" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time." + } + } + ] + } + } +]