From 2e06b1a227faf3a4c2f6a91c1efbdbf291f1de23 Mon Sep 17 00:00:00 2001 From: Leonid Lapshin Date: Thu, 14 Jan 2021 12:17:44 +0300 Subject: [PATCH] Removed PyPy version workaround for macOS 10.13 (#2414) * removed pypy version workaround for macOS 10.13 * fix toolcache test on macos * fixed an error * disable strict name checking for imported powershell modules * Ruby 3.0 doesn't exists on 10.13 Co-authored-by: Leonid Lapshin --- images/macos/provision/core/pypy.sh | 7 ------- images/macos/tests/Android.Tests.ps1 | 4 ++-- images/macos/tests/Common.Tests.ps1 | 2 +- images/macos/tests/Java.Tests.ps1 | 2 +- images/macos/tests/Linters.Tests.ps1 | 2 +- images/macos/tests/Node.Tests.ps1 | 2 +- images/macos/tests/Powershell.Tests.ps1 | 2 +- images/macos/tests/Python.Tests.ps1 | 2 +- images/macos/tests/Ruby.Tests.ps1 | 2 +- images/macos/tests/RunAll-Tests.ps1 | 2 +- images/macos/tests/Toolcache.Tests.ps1 | 14 +------------- images/macos/tests/Xamarin.Tests.ps1 | 2 +- images/macos/tests/XamarinNDK.Tests.ps1 | 4 ++-- images/macos/tests/Xcode.Tests.ps1 | 2 +- images/macos/toolsets/toolset-10.13.json | 3 +-- 15 files changed, 16 insertions(+), 36 deletions(-) diff --git a/images/macos/provision/core/pypy.sh b/images/macos/provision/core/pypy.sh index 30bde57c..ffcbbed1 100644 --- a/images/macos/provision/core/pypy.sh +++ b/images/macos/provision/core/pypy.sh @@ -79,13 +79,6 @@ pypyVersions=$(curl -4 -s --compressed $uri | grep 'osx64' | awk -v uri="$uri" - toolsetVersions=$(get_toolset_value '.toolcache[] | select(.name | contains("PyPy")) | .versions[]') versionPattern="v[0-9]+\.[0-9]+\.[0-9]+-" -# PyPy 7.3.2 for High Sierra is broken, use 7.3.1 instead https://foss.heptapod.net/pypy/pypy/-/issues/3311 -if is_HighSierra; then - versionPattern="v7.3.1-" - # PyPy 7.3.1 relies on system libffi.6.dylib, which is not existed in in libffi 3.3 release. As a workaround symlink can be created - ln -s libffi.7.dylib /usr/local/opt/libffi/lib/libffi.6.dylib -fi - for toolsetVersion in $toolsetVersions; do latestMajorPyPyVersion=$(echo "${pypyVersions}" | grep -E "pypy${toolsetVersion}-${versionPattern}" | head -1) if [[ -z "$latestMajorPyPyVersion" ]]; then diff --git a/images/macos/tests/Android.Tests.ps1 b/images/macos/tests/Android.Tests.ps1 index 5aadd3dc..7f8171a5 100644 --- a/images/macos/tests/Android.Tests.ps1 +++ b/images/macos/tests/Android.Tests.ps1 @@ -1,6 +1,6 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -Import-Module "$PSScriptRoot/../software-report/SoftwareReport.Android.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking +Import-Module "$PSScriptRoot/../software-report/SoftwareReport.Android.psm1" -DisableNameChecking $os = Get-OSVersion diff --git a/images/macos/tests/Common.Tests.ps1 b/images/macos/tests/Common.Tests.ps1 index 65bc3ccc..e68ab94d 100644 --- a/images/macos/tests/Common.Tests.ps1 +++ b/images/macos/tests/Common.Tests.ps1 @@ -1,5 +1,5 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking $os = Get-OSVersion diff --git a/images/macos/tests/Java.Tests.ps1 b/images/macos/tests/Java.Tests.ps1 index 1b81e2fb..db5c7441 100644 --- a/images/macos/tests/Java.Tests.ps1 +++ b/images/macos/tests/Java.Tests.ps1 @@ -1,5 +1,5 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking function Get-NativeVersionFormat { param($Version) diff --git a/images/macos/tests/Linters.Tests.ps1 b/images/macos/tests/Linters.Tests.ps1 index 31d3698c..4a383dbd 100644 --- a/images/macos/tests/Linters.Tests.ps1 +++ b/images/macos/tests/Linters.Tests.ps1 @@ -1,4 +1,4 @@ -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking $os = Get-OSVersion diff --git a/images/macos/tests/Node.Tests.ps1 b/images/macos/tests/Node.Tests.ps1 index 9a5e8c11..667f17e9 100644 --- a/images/macos/tests/Node.Tests.ps1 +++ b/images/macos/tests/Node.Tests.ps1 @@ -1,5 +1,5 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking Describe "Node.js" { BeforeAll { diff --git a/images/macos/tests/Powershell.Tests.ps1 b/images/macos/tests/Powershell.Tests.ps1 index 42db9dda..2be58e0a 100644 --- a/images/macos/tests/Powershell.Tests.ps1 +++ b/images/macos/tests/Powershell.Tests.ps1 @@ -1,5 +1,5 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking Describe "Powershell" { It "Powershell is installed" { diff --git a/images/macos/tests/Python.Tests.ps1 b/images/macos/tests/Python.Tests.ps1 index c75a7019..6d8c98dc 100644 --- a/images/macos/tests/Python.Tests.ps1 +++ b/images/macos/tests/Python.Tests.ps1 @@ -1,5 +1,5 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking $os = Get-OSVersion diff --git a/images/macos/tests/Ruby.Tests.ps1 b/images/macos/tests/Ruby.Tests.ps1 index 116f0937..222c182f 100644 --- a/images/macos/tests/Ruby.Tests.ps1 +++ b/images/macos/tests/Ruby.Tests.ps1 @@ -1,5 +1,5 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking Describe "Ruby" { It "Ruby is available" { diff --git a/images/macos/tests/RunAll-Tests.ps1 b/images/macos/tests/RunAll-Tests.ps1 index a3242dc0..015491cd 100644 --- a/images/macos/tests/RunAll-Tests.ps1 +++ b/images/macos/tests/RunAll-Tests.ps1 @@ -1,3 +1,3 @@ -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking Invoke-PesterTests "*" \ No newline at end of file diff --git a/images/macos/tests/Toolcache.Tests.ps1 b/images/macos/tests/Toolcache.Tests.ps1 index 74ac6cfd..5989288b 100644 --- a/images/macos/tests/Toolcache.Tests.ps1 +++ b/images/macos/tests/Toolcache.Tests.ps1 @@ -1,22 +1,10 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking $os = Get-OSVersion Describe "Toolcache" { $toolcacheDirectory = Join-Path $env:HOME "hostedtoolcache" - [array]$packages = @() - if ($os.IsHighSierra) { - [array]$packages += (Get-ToolcachePackages).PSObject.Properties | ForEach-Object { - $packageNameParts = $_.Name.Split("-") - return [PSCustomObject] @{ - ToolName = $packageNameParts[1] - Arch = $packageNameParts[4] - Versions = $_.Value - } - } - } - [array]$packages += Get-ToolsetValue -KeyPath "toolcache" | ForEach-Object { return [PSCustomObject] @{ ToolName = ($_.name).ToLower() diff --git a/images/macos/tests/Xamarin.Tests.ps1 b/images/macos/tests/Xamarin.Tests.ps1 index 2145f29a..745086f9 100644 --- a/images/macos/tests/Xamarin.Tests.ps1 +++ b/images/macos/tests/Xamarin.Tests.ps1 @@ -1,5 +1,5 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking $MONO_VERSIONS = Get-ToolsetValue "xamarin.mono-versions" $XAMARIN_IOS_VERSIONS = Get-ToolsetValue "xamarin.ios-versions" diff --git a/images/macos/tests/XamarinNDK.Tests.ps1 b/images/macos/tests/XamarinNDK.Tests.ps1 index 3495004f..62d45c37 100644 --- a/images/macos/tests/XamarinNDK.Tests.ps1 +++ b/images/macos/tests/XamarinNDK.Tests.ps1 @@ -1,7 +1,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -Import-Module "$PSScriptRoot/../software-report/SoftwareReport.Android.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking +Import-Module "$PSScriptRoot/../software-report/SoftwareReport.Android.psm1" -DisableNameChecking $os = Get-OSVersion diff --git a/images/macos/tests/Xcode.Tests.ps1 b/images/macos/tests/Xcode.Tests.ps1 index 244b66dc..73d86bb4 100644 --- a/images/macos/tests/Xcode.Tests.ps1 +++ b/images/macos/tests/Xcode.Tests.ps1 @@ -1,6 +1,6 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" Import-Module "$PSScriptRoot/../helpers/Xcode.Helpers.psm1" -Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" +Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking $xcodeVersions = Get-ToolsetValue "xcode.versions" $defaultXcode = Get-ToolsetValue "xcode.default" diff --git a/images/macos/toolsets/toolset-10.13.json b/images/macos/toolsets/toolset-10.13.json index 2caacab0..71134939 100644 --- a/images/macos/toolsets/toolset-10.13.json +++ b/images/macos/toolsets/toolset-10.13.json @@ -248,8 +248,7 @@ "2.4.*", "2.5.*", "2.6.*", - "2.7.*", - "3.0.*" + "2.7.*" ] } ],