Skip to content

Commit

Permalink
chore: update server detection script for legacy server (microsoft#20…
Browse files Browse the repository at this point in the history
…8000)

* chore: update server detection script for legacy server

* chore: address review feedback
  • Loading branch information
deepak1556 authored Mar 18, 2024
1 parent 010f4fc commit c45557f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions build/gulpfile.reh.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
);
Expand Down
19 changes: 17 additions & 2 deletions resources/server/bin/helpers/check-requirements-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

0 comments on commit c45557f

Please sign in to comment.