chore: update server detection script for legacy server (#208000)

* chore: update server detection script for legacy server

* chore: address review feedback
This commit is contained in:
Robo 2024-03-19 00:09:27 +09:00 committed by GitHub
parent 010f4fc3cb
commit c45557f69b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 2 deletions

View file

@ -376,6 +376,7 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
if (platform === 'linux' || platform === 'alpine') {
result = es.merge(result,
gulp.src(`resources/server/bin/helpers/check-requirements-linux.sh`, { base: '.' })
.pipe(replace('@@SERVER_APPLICATION_NAME@@', product.serverApplicationName))
.pipe(rename(`bin/helpers/check-requirements.sh`))
.pipe(util.setExecutableBit())
);

View file

@ -5,6 +5,15 @@
set -e
# The script checks necessary server requirements for the classic server
# scenarios. Currently, the script can exit with any of the following
# 3 exit codes and should be handled accordingly on the extension side.
#
# 0: All requirements are met, use the default server.
# 99: Unsupported OS, abort server startup with appropriate error message.
# 100: Use legacy server.
#
# Do not remove this check.
# Provides a way to skip the server requirements check from
# outside the install flow. A system process can create this
@ -19,6 +28,12 @@ if [ -f "/tmp/vscode-skip-server-requirements-check" ]; then
exit 0
fi
# Default to legacy server if the following file is present.
if [ -f "$HOME/@@SERVER_APPLICATION_NAME@@-use-legacy" ]; then
echo "!!! WARNING: Using legacy server due to the presence of $HOME/@@SERVER_APPLICATION_NAME@@-use-legacy !!!"
exit 100
fi
ARCH=$(uname -m)
found_required_glibc=0
found_required_glibcxx=0
@ -144,7 +159,7 @@ else
fi
if [ "$found_required_glibc" = "0" ] || [ "$found_required_glibcxx" = "0" ]; then
echo "Error: Missing required dependencies. Please refer to our FAQ https://aka.ms/vscode-remote/faq/old-linux for additional information."
echo "Warning: Missing required dependencies. Please refer to our FAQ https://aka.ms/vscode-remote/faq/old-linux for additional information."
# Custom exit code based on https://tldp.org/LDP/abs/html/exitcodes.html
#exit 99
exit 100
fi