Skip to content

Commit b73aade

Browse files
authored
fix: use legacy server as default with additional warnings (microsoft#204377) (microsoft#204482)
* fix: use legacy server as default with additional warnings (microsoft#204377) * ci: switch to glibc 2.17 remote server * chore: signal user about unsupported connection * chore: address review comments * chore: update nodejs build * chore: bump distro * chore: lower the minimum requirements * fix: glibc version check * chore: remove explicit connection disposal * chore: update distro
1 parent 4e52791 commit b73aade

File tree

18 files changed

+298
-162
lines changed

18 files changed

+298
-162
lines changed

build/.cachesalt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-12-07T16:21:36.646Z
1+
2024-02-06T12:08:15.607Z

build/azure-pipelines/linux/install.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ if [ "$npm_config_arch" == "x64" ]; then
3434
export CXX="$PWD/.build/CR_Clang/bin/clang++ --gcc-toolchain=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu"
3535
export CXXFLAGS="-nostdinc++ -D__NO_INLINE__ -I$PWD/.build/libcxx_headers -isystem$PWD/.build/libcxx_headers/include -isystem$PWD/.build/libcxxabi_headers/include -fPIC -flto=thin -fsplit-lto-unit -D_LIBCPP_ABI_NAMESPACE=Cr --sysroot=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot"
3636
export LDFLAGS="-stdlib=libc++ --sysroot=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot -fuse-ld=lld -flto=thin -L$PWD/.build/libcxx-objects -lc++abi -L$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/usr/lib/x86_64-linux-gnu -L$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/lib/x86_64-linux-gnu -Wl,--lto-O0"
37-
# Set compiler toolchain for remote server
38-
export VSCODE_REMOTE_CC=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/bin/x86_64-linux-gnu-gcc
39-
export VSCODE_REMOTE_CXX=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/bin/x86_64-linux-gnu-g++
40-
export VSCODE_REMOTE_CXXFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot"
41-
export VSCODE_REMOTE_LDFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot -L$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/usr/lib/x86_64-linux-gnu -L$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/lib/x86_64-linux-gnu"
4237
elif [ "$npm_config_arch" == "arm64" ]; then
4338
# Set compiler toolchain for client native modules and remote server
4439
export CC=$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc

build/azure-pipelines/linux/product-build-linux.yml

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -121,53 +121,23 @@ steps:
121121
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
122122
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
123123
GITHUB_TOKEN: "$(github-distro-mixin-password)"
124+
VSCODE_HOST_MOUNT: "/mnt/vss/_work/1/s"
125+
${{ if or(eq(parameters.VSCODE_ARCH, 'x64'), eq(parameters.VSCODE_ARCH, 'arm64')) }}:
126+
VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME: vscodehub.azurecr.io/vscode-linux-build-agent:centos7-devtoolset8-$(VSCODE_ARCH)
127+
${{ if eq(parameters.VSCODE_ARCH, 'armhf') }}:
128+
VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME: vscodehub.azurecr.io/vscode-linux-build-agent:bionic-arm32v7
124129
displayName: Install dependencies (non-OSS)
125130
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
126131
127-
- script: |
128-
set -e
132+
- ${{ if or(eq(parameters.VSCODE_ARCH, 'x64'), eq(parameters.VSCODE_ARCH, 'arm64')) }}:
133+
- script: |
134+
set -e
129135
130-
TRIPLE="x86_64-linux-gnu"
131-
if [ "$VSCODE_ARCH" == "arm64" ]; then
132-
TRIPLE="aarch64-linux-gnu"
133-
elif [ "$VSCODE_ARCH" == "armhf" ]; then
134-
TRIPLE="arm-rpi-linux-gnueabihf"
135-
fi
136-
137-
# Get all files with .node extension from remote/node_modules folder
138-
files=$(find remote/node_modules -name "*.node")
139-
140-
# Check if any file has dependency of GLIBC > 2.28 or GLIBCXX > 3.4.25
141-
for file in $files; do
142-
glibc_version="2.28"
143-
glibcxx_version="3.4.25"
144-
while IFS= read -r line; do
145-
if [[ $line == *"GLIBC_"* ]]; then
146-
version=$(echo "$line" | awk '{print $5}' | tr -d '()')
147-
version=${version#*_}
148-
if [[ $(printf "%s\n%s" "$version" "$glibc_version" | sort -V | tail -n1) == "$version" ]]; then
149-
glibc_version=$version
150-
fi
151-
elif [[ $line == *"GLIBCXX_"* ]]; then
152-
version=$(echo "$line" | awk '{print $5}' | tr -d '()')
153-
version=${version#*_}
154-
if [[ $(printf "%s\n%s" "$version" "$glibcxx_version" | sort -V | tail -n1) == "$version" ]]; then
155-
glibcxx_version=$version
156-
fi
157-
fi
158-
done < <("$PWD/.build/sysroots/$TRIPLE/$TRIPLE/bin/objdump" -T "$file")
159-
160-
if [[ "$glibc_version" != "2.28" ]]; then
161-
echo "Error: File $file has dependency on GLIBC > 2.28"
162-
exit 1
163-
fi
164-
if [[ "$glibcxx_version" != "3.4.25" ]]; then
165-
echo "Error: File $file has dependency on GLIBCXX > 3.4.25"
166-
exit 1
167-
fi
168-
done
169-
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
170-
displayName: Check GLIBC and GLIBCXX dependencies in remote/node_modules
136+
EXPECTED_GLIBC_VERSION="2.17" \
137+
EXPECTED_GLIBCXX_VERSION="3.4.19" \
138+
./build/azure-pipelines/linux/verify-glibc-requirements.sh
139+
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
140+
displayName: Check GLIBC and GLIBCXX dependencies in remote/node_modules
171141
172142
- script: node build/azure-pipelines/distro/mixin-npm
173143
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
@@ -248,6 +218,7 @@ steps:
248218
249219
- script: |
250220
set -e
221+
export VSCODE_NODE_GLIBC='-glibc-2.17'
251222
yarn gulp vscode-reh-linux-$(VSCODE_ARCH)-min-ci
252223
mv ../vscode-reh-linux-$(VSCODE_ARCH) ../vscode-server-linux-$(VSCODE_ARCH) # TODO@joaomoreno
253224
ARCHIVE_PATH=".build/linux/server/vscode-server-linux-$(VSCODE_ARCH).tar.gz"
@@ -260,6 +231,7 @@ steps:
260231
261232
- script: |
262233
set -e
234+
export VSCODE_NODE_GLIBC='-glibc-2.17'
263235
yarn gulp vscode-reh-web-linux-$(VSCODE_ARCH)-min-ci
264236
mv ../vscode-reh-web-linux-$(VSCODE_ARCH) ../vscode-server-linux-$(VSCODE_ARCH)-web # TODO@joaomoreno
265237
ARCHIVE_PATH=".build/linux/web/vscode-server-linux-$(VSCODE_ARCH)-web.tar.gz"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
TRIPLE="x86_64-linux-gnu"
6+
if [ "$VSCODE_ARCH" == "arm64" ]; then
7+
TRIPLE="aarch64-linux-gnu"
8+
elif [ "$VSCODE_ARCH" == "armhf" ]; then
9+
TRIPLE="arm-rpi-linux-gnueabihf"
10+
fi
11+
12+
# Get all files with .node extension from remote/node_modules folder
13+
files=$(find remote/node_modules -name "*.node" -not -path "*prebuilds*")
14+
15+
echo "Verifying requirements for files: $files"
16+
17+
for file in $files; do
18+
glibc_version="$EXPECTED_GLIBC_VERSION"
19+
glibcxx_version="$EXPECTED_GLIBCXX_VERSION"
20+
while IFS= read -r line; do
21+
if [[ $line == *"GLIBC_"* ]]; then
22+
version=$(echo "$line" | awk '{print $5}' | tr -d '()')
23+
version=${version#*_}
24+
if [[ $(printf "%s\n%s" "$version" "$glibc_version" | sort -V | tail -n1) == "$version" ]]; then
25+
glibc_version=$version
26+
fi
27+
elif [[ $line == *"GLIBCXX_"* ]]; then
28+
version=$(echo "$line" | awk '{print $5}' | tr -d '()')
29+
version=${version#*_}
30+
if [[ $(printf "%s\n%s" "$version" "$glibcxx_version" | sort -V | tail -n1) == "$version" ]]; then
31+
glibcxx_version=$version
32+
fi
33+
fi
34+
done < <("$PWD/.build/sysroots/$TRIPLE/$TRIPLE/bin/objdump" -T "$file")
35+
36+
if [[ "$glibc_version" != "$EXPECTED_GLIBC_VERSION" ]]; then
37+
echo "Error: File $file has dependency on GLIBC > $EXPECTED_GLIBC_VERSION"
38+
exit 1
39+
fi
40+
if [[ "$glibcxx_version" != "$EXPECTED_GLIBCXX_VERSION" ]]; then
41+
echo "Error: File $file has dependency on GLIBCXX > $EXPECTED_GLIBCXX_VERSION"
42+
exit 1
43+
fi
44+
done

build/gulpfile.reh.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function getNodeVersion() {
125125
return { nodeVersion, internalNodeVersion };
126126
}
127127

128-
function getNodeChecksum(nodeVersion, platform, arch) {
128+
function getNodeChecksum(nodeVersion, platform, arch, glibcPrefix) {
129129
let expectedName;
130130
switch (platform) {
131131
case 'win32':
@@ -135,7 +135,7 @@ function getNodeChecksum(nodeVersion, platform, arch) {
135135
case 'darwin':
136136
case 'alpine':
137137
case 'linux':
138-
expectedName = `node-v${nodeVersion}-${platform}-${arch}.tar.gz`;
138+
expectedName = `node-v${nodeVersion}${glibcPrefix}-${platform}-${arch}.tar.gz`;
139139
break;
140140
}
141141

@@ -193,7 +193,8 @@ function nodejs(platform, arch) {
193193

194194
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from ${product.nodejsRepository}...`);
195195

196-
const checksumSha256 = getNodeChecksum(nodeVersion, platform, arch);
196+
const glibcPrefix = process.env['VSCODE_NODE_GLIBC'] ?? '';
197+
const checksumSha256 = getNodeChecksum(nodeVersion, platform, arch, glibcPrefix);
197198

198199
if (checksumSha256) {
199200
log(`Using SHA256 checksum for checking integrity: ${checksumSha256}`);
@@ -210,7 +211,7 @@ function nodejs(platform, arch) {
210211
case 'darwin':
211212
case 'linux':
212213
return (product.nodejsRepository !== 'https://nodejs.org' ?
213-
fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: `node-v${nodeVersion}-${platform}-${arch}.tar.gz`, checksumSha256 }) :
214+
fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: `node-v${nodeVersion}${glibcPrefix}-${platform}-${arch}.tar.gz`, checksumSha256 }) :
214215
fetchUrls(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', checksumSha256 })
215216
).pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
216217
.pipe(filter('**/node'))

build/npm/postinstall.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,14 @@ function yarnInstall(dir, opts) {
5353
console.log(`Installing dependencies in ${dir} inside container ${process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME']}...`);
5454

5555
opts.cwd = root;
56-
if (process.env['npm_config_arch'] === 'arm64') {
56+
if (process.env['npm_config_arch'] === 'arm64' || process.env['npm_config_arch'] === 'arm') {
5757
run('sudo', ['docker', 'run', '--rm', '--privileged', 'multiarch/qemu-user-static', '--reset', '-p', 'yes'], opts);
5858
}
59-
run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/root/vscode`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/root/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts);
59+
if (process.env['npm_config_arch'] === 'arm') {
60+
run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/home/builduser`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/home/builduser/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts);
61+
} else {
62+
run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/root/vscode`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/root/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts);
63+
}
6064
run('sudo', ['chown', '-R', `${userinfo.uid}:${userinfo.gid}`, `${dir}/node_modules`], opts);
6165
} else {
6266
console.log(`Installing dependencies in ${dir}...`);
@@ -102,8 +106,19 @@ for (let dir of dirs) {
102106
if (/^(.build\/distro\/npm\/)?remote$/.test(dir)) {
103107
// node modules used by vscode server
104108
const env = { ...process.env };
105-
if (process.env['VSCODE_REMOTE_CC']) { env['CC'] = process.env['VSCODE_REMOTE_CC']; }
106-
if (process.env['VSCODE_REMOTE_CXX']) { env['CXX'] = process.env['VSCODE_REMOTE_CXX']; }
109+
if (process.env['VSCODE_REMOTE_CC']) {
110+
env['CC'] = process.env['VSCODE_REMOTE_CC'];
111+
} else {
112+
delete env['CC'];
113+
}
114+
if (process.env['VSCODE_REMOTE_CXX']) {
115+
env['CXX'] = process.env['VSCODE_REMOTE_CXX'];
116+
} else {
117+
delete env['CXX'];
118+
}
119+
if (process.env['CXXFLAGS']) { delete env['CXXFLAGS']; }
120+
if (process.env['CFLAGS']) { delete env['CFLAGS']; }
121+
if (process.env['LDFLAGS']) { delete env['LDFLAGS']; }
107122
if (process.env['VSCODE_REMOTE_CXXFLAGS']) { env['CXXFLAGS'] = process.env['VSCODE_REMOTE_CXXFLAGS']; }
108123
if (process.env['VSCODE_REMOTE_LDFLAGS']) { env['LDFLAGS'] = process.env['VSCODE_REMOTE_LDFLAGS']; }
109124
if (process.env['VSCODE_REMOTE_NODE_GYP']) { env['npm_config_node_gyp'] = process.env['VSCODE_REMOTE_NODE_GYP']; }

cli/src/util/prereqs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ lazy_static! {
2020
static ref GENERIC_VERSION_RE: Regex = Regex::new(r"^([0-9]+)\.([0-9]+)$").unwrap();
2121
static ref LIBSTD_CXX_VERSION_RE: BinRegex =
2222
BinRegex::new(r"GLIBCXX_([0-9]+)\.([0-9]+)(?:\.([0-9]+))?").unwrap();
23-
static ref MIN_CXX_VERSION: SimpleSemver = SimpleSemver::new(3, 4, 25);
24-
static ref MIN_LDD_VERSION: SimpleSemver = SimpleSemver::new(2, 28, 0);
23+
static ref MIN_CXX_VERSION: SimpleSemver = SimpleSemver::new(3, 4, 19);
24+
static ref MIN_LDD_VERSION: SimpleSemver = SimpleSemver::new(2, 17, 0);
2525
}
2626

2727
const NIXOS_TEST_PATH: &str = "/etc/NIXOS";

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-oss-dev",
33
"version": "1.86.1",
4-
"distro": "6c14240015f9a76b34c29b4212fb8df761106443",
4+
"distro": "04f21699c6c8659f3bcff81b7696e48aec2a0f23",
55
"author": {
66
"name": "Microsoft Corporation"
77
},

remote/.yarnrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
disturl "https://nodejs.org/dist"
22
target "18.17.1"
3-
ms_build_id "252256"
3+
ms_build_id "255375"
44
runtime "node"
55
build_from_source "true"

resources/server/bin/helpers/check-requirements-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,5 @@ fi
117117
if [ "$found_required_glibc" = "0" ] || [ "$found_required_glibcxx" = "0" ]; then
118118
echo "Error: Missing required dependencies. Please refer to our FAQ https://aka.ms/vscode-remote/faq/old-linux for additional information."
119119
# Custom exit code based on https://tldp.org/LDP/abs/html/exitcodes.html
120-
exit 99
120+
#exit 99
121121
fi

0 commit comments

Comments
 (0)