From b0f800029fd63b3e2fb51a8d0409c60c6e1d15c6 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Mon, 18 Dec 2023 12:50:38 +1300 Subject: [PATCH 1/2] Update build-sentry-native.ps1 --- scripts/build-sentry-native.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/build-sentry-native.ps1 b/scripts/build-sentry-native.ps1 index fc9d41002d..11bff72196 100644 --- a/scripts/build-sentry-native.ps1 +++ b/scripts/build-sentry-native.ps1 @@ -5,6 +5,19 @@ $ErrorActionPreference = "Stop" Push-Location $PSScriptRoot/.. try { + if ($PSVersionTable.PSVersion.Major -ge 6) { + # PowerShell Core + $IsWindows = $PSVersionTable.OS -like "*Win*" + $IsLinux = $PSVersionTable.OS -like "*Linux*" + $IsMacOS = $PSVersionTable.OS -like "*Darwin*" + } else { + # Windows PowerShell + $os = [System.Environment]::OSVersion + $IsWindows = $os.Platform -eq [System.PlatformID]::Win32NT + $IsLinux = $os.Platform -eq [System.PlatformID]::Unix + $IsMacOS = $false # macOS determination is complex in Windows PowerShell + } + $submodule = 'modules/sentry-native' $outDir = 'src/Sentry/Platforms/Native/sentry-native' $buildDir = "$submodule/build" From bef7872e888a333adf44692e4fb39d5d616e78e6 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Mon, 18 Dec 2023 13:03:26 +1300 Subject: [PATCH 2/2] Reverted OS detection and added a note to contributing.md about PS version requirements --- CONTRIBUTING.md | 2 +- scripts/build-sentry-native.ps1 | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 879db4689d..2e61ed89c8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ For big feature it's advised to raise an issue to discuss it first. * You'll need `CMake` somewhere on your PATH. If you don't already have this, one way to get it is to install the [C++ CMake tools for Windows](https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170#installation) -* You'll need [`pwsh`](https://github.com/PowerShell/PowerShell#get-powershell) on PATH. +* You'll need [`pwsh`](https://github.com/PowerShell/PowerShell#get-powershell) Core version 6 or later on PATH. * On Windows: - [.NET Framework](https://dotnet.microsoft.com/download/dotnet-framework) 4.6.2 or higher. diff --git a/scripts/build-sentry-native.ps1 b/scripts/build-sentry-native.ps1 index 11bff72196..fc9d41002d 100644 --- a/scripts/build-sentry-native.ps1 +++ b/scripts/build-sentry-native.ps1 @@ -5,19 +5,6 @@ $ErrorActionPreference = "Stop" Push-Location $PSScriptRoot/.. try { - if ($PSVersionTable.PSVersion.Major -ge 6) { - # PowerShell Core - $IsWindows = $PSVersionTable.OS -like "*Win*" - $IsLinux = $PSVersionTable.OS -like "*Linux*" - $IsMacOS = $PSVersionTable.OS -like "*Darwin*" - } else { - # Windows PowerShell - $os = [System.Environment]::OSVersion - $IsWindows = $os.Platform -eq [System.PlatformID]::Win32NT - $IsLinux = $os.Platform -eq [System.PlatformID]::Unix - $IsMacOS = $false # macOS determination is complex in Windows PowerShell - } - $submodule = 'modules/sentry-native' $outDir = 'src/Sentry/Platforms/Native/sentry-native' $buildDir = "$submodule/build"