fix: don't package detection script in legacy server (#208274)

* fix: don't package detection script in legacy server

* chore: address review feedback

* chore: rename download asset name
This commit is contained in:
Robo 2024-03-21 22:11:57 +09:00 committed by GitHub
parent d187a75687
commit 5e0394c8d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 20 additions and 27 deletions

View file

@ -421,12 +421,12 @@ function getPlatform(product, os, arch, type, isLegacy) {
case 'client':
return `linux-${arch}`;
case 'server':
return isLegacy ? `legacy-server-linux-${arch}` : `server-linux-${arch}`;
return isLegacy ? `server-linux-legacy-${arch}` : `server-linux-${arch}`;
case 'web':
if (arch === 'standalone') {
return 'web-standalone';
}
return isLegacy ? `legacy-server-linux-${arch}-web` : `server-linux-${arch}-web`;
return isLegacy ? `server-linux-legacy-${arch}-web` : `server-linux-${arch}-web`;
default:
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
}

View file

@ -582,12 +582,12 @@ function getPlatform(product: string, os: string, arch: string, type: string, is
case 'client':
return `linux-${arch}`;
case 'server':
return isLegacy ? `legacy-server-linux-${arch}` : `server-linux-${arch}`;
return isLegacy ? `server-linux-legacy-${arch}` : `server-linux-${arch}`;
case 'web':
if (arch === 'standalone') {
return 'web-standalone';
}
return isLegacy ? `legacy-server-linux-${arch}-web` : `server-linux-${arch}-web`;
return isLegacy ? `server-linux-legacy-${arch}-web` : `server-linux-${arch}-web`;
default:
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
}

View file

@ -223,7 +223,6 @@ steps:
- script: |
set -e
export VSCODE_NODE_GLIBC='-glibc-2.17'
yarn gulp vscode-reh-linux-$(VSCODE_ARCH)-min-ci
mv ../vscode-reh-linux-$(VSCODE_ARCH) ../vscode-server-linux-$(VSCODE_ARCH) # TODO@joaomoreno
ARCHIVE_PATH=".build/linux/server/vscode-server-linux-$(VSCODE_ARCH).tar.gz"
@ -236,7 +235,6 @@ steps:
- script: |
set -e
export VSCODE_NODE_GLIBC='-glibc-2.17'
yarn gulp vscode-reh-web-linux-$(VSCODE_ARCH)-min-ci
mv ../vscode-reh-web-linux-$(VSCODE_ARCH) ../vscode-server-linux-$(VSCODE_ARCH)-web # TODO@joaomoreno
ARCHIVE_PATH=".build/linux/web/vscode-server-linux-$(VSCODE_ARCH)-web.tar.gz"

View file

@ -373,7 +373,13 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
);
}
if (platform === 'linux' || platform === 'alpine') {
if (platform === 'linux' && process.env['VSCODE_NODE_GLIBC'] === '-glibc-2.17') {
result = es.merge(result,
gulp.src(`resources/server/bin/helpers/check-requirements-linux-legacy.sh`, { base: '.' })
.pipe(rename(`bin/helpers/check-requirements.sh`))
.pipe(util.setExecutableBit())
);
} else 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))

View file

@ -9,24 +9,4 @@ esac
ROOT="$(dirname "$(dirname "$(readlink -f "$0")")")"
# 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
# file before the server is downloaded and installed.
skip_check=0
if [ -f "/tmp/vscode-skip-server-requirements-check" ]; then
echo "!!! WARNING: Skipping server pre-requisite check !!!"
echo "!!! Server stability is not guaranteed. Proceed at your own risk. !!!"
skip_check=1
fi
# Check platform requirements
if [ "$(echo "$@" | grep -c -- "--skip-requirements-check")" -eq 0 ] && [ $skip_check -eq 0 ]; then
$ROOT/bin/helpers/check-requirements.sh
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
fi
"$ROOT/node" ${INSPECT:-} "$ROOT/out/server-main.js" "$@"

View file

@ -0,0 +1,9 @@
#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
set -e
echo "!!! WARNING: Using legacy server, please check https://aka.ms/vscode-remote/faq/old-linux for additional information !!!"
exit 0