From d63a5f8867f3f23dfd85cbc36487437f33f69fe1 Mon Sep 17 00:00:00 2001 From: Jeremiah <42397676+jlsnow301@users.noreply.github.com> Date: Sun, 31 Mar 2024 20:41:25 -0700 Subject: [PATCH 1/4] Creates a node compatibility mode (#82334) ## About The Pull Request By default this will install node v20 LTS, but if a user is detected to be using win 7 it's node v14 This lets us run higher node versions (with presumably more stable and performant content) while allowing win 7 users to play I should note that this is making clean tgui builds run at ~6.7sec which is about a 6.9% speed increase (nice) from the previous #80310 ## Why It's Good For The Game Better tools ## Changelog N/A nothing player facing --- dependencies.sh | 3 ++- tgui/.prettierignore | 1 + tools/bootstrap/node | 4 ++-- tools/bootstrap/node_.ps1 | 14 +++++++++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/dependencies.sh b/dependencies.sh index 62463ad41604..2f3d3c3377fd 100644 --- a/dependencies.sh +++ b/dependencies.sh @@ -12,7 +12,8 @@ export RUST_G_VERSION=3.1.0 #node version export NODE_VERSION=14 -export NODE_VERSION_PRECISE=14.16.1 +export NODE_VERSION_LTS=20.12.0 +export NODE_VERSION_COMPAT=14.16.1 # SpacemanDMM git tag export SPACEMAN_DMM_VERSION=suite-1.8 diff --git a/tgui/.prettierignore b/tgui/.prettierignore index 79e703c95440..a91324ebe6e8 100644 --- a/tgui/.prettierignore +++ b/tgui/.prettierignore @@ -6,6 +6,7 @@ /yarn.lock /.pnp.* +.swcrc /docs /public /packages/tgui-polyfill diff --git a/tools/bootstrap/node b/tools/bootstrap/node index 6757035d135c..10701bc39af2 100755 --- a/tools/bootstrap/node +++ b/tools/bootstrap/node @@ -16,9 +16,9 @@ if [ "$TG_BOOTSTRAP_CACHE" ]; then fi OldPWD="$PWD" cd "$Bootstrap/../.." -. ./dependencies.sh # sets NODE_VERSION_PRECISE +. ./dependencies.sh # sets NODE_VERSION_LTS cd "$OldPWD" -NodeVersion="$NODE_VERSION_PRECISE" +NodeVersion="$NODE_VERSION_LTS" NodeFullVersion="node-v$NodeVersion-win-x64" NodeDir="$Cache/$NodeFullVersion" NodeExe="$NodeDir/node.exe" diff --git a/tools/bootstrap/node_.ps1 b/tools/bootstrap/node_.ps1 index 1107d9542c8e..d56d6f457bf4 100644 --- a/tools/bootstrap/node_.ps1 +++ b/tools/bootstrap/node_.ps1 @@ -30,7 +30,19 @@ $Cache = "$BaseDir\.cache" if ($Env:TG_BOOTSTRAP_CACHE) { $Cache = $Env:TG_BOOTSTRAP_CACHE } -$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_PRECISE" + +# Get OS version +$OSVersion = (Get-WmiObject -Class Win32_OperatingSystem).Version + +# Set Node version based on OS version +if ($OSVersion -gt 6.1) { + # Windows 7 is version 6.1 + $NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_COMPAT" +} +else { + $NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_LTS" +} + $NodeSource = "https://nodejs.org/download/release/v$NodeVersion/win-x64/node.exe" $NodeTargetDir = "$Cache\node-v$NodeVersion-x64" $NodeTarget = "$NodeTargetDir\node.exe" From 5852872376fb8699e07946def86c544752bc26ef Mon Sep 17 00:00:00 2001 From: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> Date: Wed, 3 Apr 2024 02:53:10 -0400 Subject: [PATCH 2/4] Compiling the servers works again (#82420) "Compat" node version didn't work at all --- dependencies.sh | 3 +-- tools/bootstrap/node_.ps1 | 13 +------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/dependencies.sh b/dependencies.sh index 2f3d3c3377fd..d8164fec30ee 100644 --- a/dependencies.sh +++ b/dependencies.sh @@ -11,9 +11,8 @@ export BYOND_MINOR=1633 export RUST_G_VERSION=3.1.0 #node version -export NODE_VERSION=14 +export NODE_VERSION=20 export NODE_VERSION_LTS=20.12.0 -export NODE_VERSION_COMPAT=14.16.1 # SpacemanDMM git tag export SPACEMAN_DMM_VERSION=suite-1.8 diff --git a/tools/bootstrap/node_.ps1 b/tools/bootstrap/node_.ps1 index d56d6f457bf4..31cca39d1419 100644 --- a/tools/bootstrap/node_.ps1 +++ b/tools/bootstrap/node_.ps1 @@ -31,18 +31,7 @@ if ($Env:TG_BOOTSTRAP_CACHE) { $Cache = $Env:TG_BOOTSTRAP_CACHE } -# Get OS version -$OSVersion = (Get-WmiObject -Class Win32_OperatingSystem).Version - -# Set Node version based on OS version -if ($OSVersion -gt 6.1) { - # Windows 7 is version 6.1 - $NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_COMPAT" -} -else { - $NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_LTS" -} - +$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_LTS" $NodeSource = "https://nodejs.org/download/release/v$NodeVersion/win-x64/node.exe" $NodeTargetDir = "$Cache\node-v$NodeVersion-x64" $NodeTarget = "$NodeTargetDir\node.exe" From a674b53f21ea001ea7c8845afe260c917181ddcd Mon Sep 17 00:00:00 2001 From: Jeremiah <42397676+jlsnow301@users.noreply.github.com> Date: Sat, 11 May 2024 01:17:07 -0700 Subject: [PATCH 3/4] Reimplements node compatibility mode (#83141) ## About The Pull Request Puts a switch inside our build tools that will download the appropriate node version based on your OS. #82334 ## Why It's Good For The Game Closes #83076 Allows players to play the game --- dependencies.sh | 5 +++-- tools/bootstrap/node_.ps1 | 13 ++++++++++++- tools/ci/install_node.sh | 4 ++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dependencies.sh b/dependencies.sh index d8164fec30ee..f6687b574e00 100644 --- a/dependencies.sh +++ b/dependencies.sh @@ -11,8 +11,9 @@ export BYOND_MINOR=1633 export RUST_G_VERSION=3.1.0 #node version -export NODE_VERSION=20 -export NODE_VERSION_LTS=20.12.0 +export NODE_VERSION_LTS=20.13.0 +# compatiblility mode MUST work with windows 7 +export NODE_VERSION_COMPAT=20.2.0 # SpacemanDMM git tag export SPACEMAN_DMM_VERSION=suite-1.8 diff --git a/tools/bootstrap/node_.ps1 b/tools/bootstrap/node_.ps1 index 31cca39d1419..d4df216773b8 100644 --- a/tools/bootstrap/node_.ps1 +++ b/tools/bootstrap/node_.ps1 @@ -31,7 +31,18 @@ if ($Env:TG_BOOTSTRAP_CACHE) { $Cache = $Env:TG_BOOTSTRAP_CACHE } -$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_LTS" +# Get OS version +$OSMajor = (Get-WmiObject -Class Win32_OperatingSystem).Version.Split(".")[0] + +# Set Node version based on OS version +if ($OSMajor -lt 10) { + # Anything under Windows 10 + $NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_COMPAT" +} +else { + $NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_LTS" +} + $NodeSource = "https://nodejs.org/download/release/v$NodeVersion/win-x64/node.exe" $NodeTargetDir = "$Cache\node-v$NodeVersion-x64" $NodeTarget = "$NodeTargetDir\node.exe" diff --git a/tools/ci/install_node.sh b/tools/ci/install_node.sh index c21b8f0110b0..906984ed3fa1 100644 --- a/tools/ci/install_node.sh +++ b/tools/ci/install_node.sh @@ -5,6 +5,6 @@ source dependencies.sh if [[ -e ~/.nvm/nvm.sh ]]; then source ~/.nvm/nvm.sh - nvm install $NODE_VERSION - nvm use $NODE_VERSION + nvm install $NODE_VERSION_COMPAT + nvm use $NODE_VERSION_COMPAT fi From 4c372f8b66106459b913cb4566512cf30c6a8bee Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Sun, 12 May 2024 19:15:08 -0700 Subject: [PATCH 4/4] Node Bootstrap: Cast OS version to int so compat code works (#83190) This wasn't working for me because `OSMajor` was set to a string, not a number, so it failed the if check. Making this change made it work --- tools/bootstrap/node_.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bootstrap/node_.ps1 b/tools/bootstrap/node_.ps1 index d4df216773b8..8e3c96517f94 100644 --- a/tools/bootstrap/node_.ps1 +++ b/tools/bootstrap/node_.ps1 @@ -32,7 +32,7 @@ if ($Env:TG_BOOTSTRAP_CACHE) { } # Get OS version -$OSMajor = (Get-WmiObject -Class Win32_OperatingSystem).Version.Split(".")[0] +[int]$OSMajor = (Get-WmiObject -Class Win32_OperatingSystem).Version.Split(".")[0] # Set Node version based on OS version if ($OSMajor -lt 10) {