Skip to content

Commit 31c37ee

Browse files
chore: legacy server cleanups (microsoft#204570)
* chore: legacy server cleanups (microsoft#204501) * fix: revert glibc requirements for tunnel cli * chore: address feedback on wording * fix: only store state when user allows the prompt * chore: update checksums for sysroot * fix: store connection choice per distro * update rpm deps-list --------- Co-authored-by: Connor Peet <[email protected]> * fix: sysroot used for client (microsoft#204559) --------- Co-authored-by: Connor Peet <[email protected]>
1 parent a8971a9 commit 31c37ee

File tree

7 files changed

+46
-34
lines changed

7 files changed

+46
-34
lines changed

build/azure-pipelines/cli/cli-compile-and-publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,46 @@ steps:
4242
- script: |
4343
set -e
4444
if [ -n "$SYSROOT_ARCH" ]; then
45+
export VSCODE_SYSROOT_PREFIX='-glibc-2.17'
4546
export VSCODE_SYSROOT_DIR=$(Build.SourcesDirectory)/.build/sysroots
4647
node -e '(async () => { const { getVSCodeSysroot } = require("../build/linux/debian/install-sysroot.js"); await getVSCodeSysroot(process.env["SYSROOT_ARCH"]); })()'
4748
if [ "$SYSROOT_ARCH" == "arm64" ]; then
4849
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER="$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc"
4950
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C link-arg=--sysroot=$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/sysroot"
5051
export CC_aarch64_unknown_linux_gnu="$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc --sysroot=$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/sysroot"
52+
export OBJDUMP="$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/bin/objdump"
5153
elif [ "$SYSROOT_ARCH" == "amd64" ]; then
5254
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER="$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/bin/x86_64-linux-gnu-gcc"
5355
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C link-arg=--sysroot=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot -C link-arg=-L$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/usr/lib/x86_64-linux-gnu"
5456
export CC_x86_64_unknown_linux_gnu="$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/bin/x86_64-linux-gnu-gcc --sysroot=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot"
57+
export OBJDUMP="$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/bin/objdump"
5558
elif [ "$SYSROOT_ARCH" == "armhf" ]; then
5659
export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER="$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc"
5760
export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS="-C link-arg=--sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot"
5861
export CC_armv7_unknown_linux_gnueabihf="$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc --sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot"
62+
export OBJDUMP="$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/bin/objdump"
5963
fi
6064
fi
65+
6166
cargo build --release --target ${{ parameters.VSCODE_CLI_TARGET }} --bin=code
67+
68+
# verify glibc requirement
69+
if [ -n "$SYSROOT_ARCH" ]; then
70+
glibc_version="2.17"
71+
while IFS= read -r line; do
72+
if [[ $line == *"GLIBC_"* ]]; then
73+
version=$(echo "$line" | awk '{print $5}' | tr -d '()')
74+
version=${version#*_}
75+
if [[ $(printf "%s\n%s" "$version" "$glibc_version" | sort -V | tail -n1) == "$version" ]]; then
76+
glibc_version=$version
77+
fi
78+
fi
79+
done < <("$OBJDUMP" -T "$PWD/target/${{ parameters.VSCODE_CLI_TARGET }}/release/code")
80+
if [[ "$glibc_version" != "2.17" ]]; then
81+
echo "Error: binary has dependency on GLIBC > 2.17"
82+
exit 1
83+
fi
84+
fi
6285
displayName: Compile ${{ parameters.VSCODE_CLI_TARGET }}
6386
workingDirectory: $(Build.SourcesDirectory)/cli
6487
env:

build/checksums/vscode-sysroot.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
a2d51dc505ed544c52757f90bcdab44920132295fc7a67166eff86b6e0e24aa8 aarch64-linux-gnu.tar.gz
2-
032cf16bf8b965e1351305f10f3dedabf4f9868027ac6d0e8f52321ca0b70d4a arm-rpi-linux-gnueabihf.tar.gz
3-
360475a764d0faf4d3743aa866347eff78072639d20660def83e1a03eadf534c x86_64-linux-gnu.tar.gz
1+
68a17006021975ff271a1dd615f9db9eda7c25f2cc65e750c87980dc57a06c94 aarch64-linux-gnu-glibc-2.17.tar.gz
2+
0de422a81683cf9e8cf875dbd1e0c27545ac3c775b2d53015daf3ca2b31d3f15 aarch64-linux-gnu-glibc-2.28.tar.gz
3+
3ced48cb479f2cdba95aa649710fcb7778685551c745bbd76ac706c3c0ead9fb arm-rpi-linux-gnueabihf-glibc-2.17.tar.gz
4+
7aea163f7fad8cc50000c86b5108be880121d35e2f55d016ef8c96bbe54129eb arm-rpi-linux-gnueabihf-glibc-2.28.tar.gz
5+
5aae21115f1d284c3cdf32c83db15771b59bc80793f1423032abf5a823c0d658 x86_64-linux-gnu-glibc-2.17.tar.gz
6+
dbb927408393041664a020661f2641c9785741be3d29b050b9dac58980967784 x86_64-linux-gnu-glibc-2.28.tar.gz

build/linux/debian/install-sysroot.js

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/linux/debian/install-sysroot.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
8080
try {
8181
const controller = new AbortController();
8282
const timeout = setTimeout(() => controller.abort(), 30 * 1000);
83-
const version = '20231122-245579';
83+
const version = '20240129-253798';
8484
try {
8585
const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, {
8686
headers: ghApiHeaders,
@@ -137,20 +137,22 @@ type SysrootDictEntry = {
137137
export async function getVSCodeSysroot(arch: DebianArchString): Promise<string> {
138138
let expectedName: string;
139139
let triple: string;
140+
const prefix = process.env['VSCODE_SYSROOT_PREFIX'] ?? '-glibc-2.28';
140141
switch (arch) {
141142
case 'amd64':
142-
expectedName = `x86_64-linux-gnu.tar.gz`;
143+
expectedName = `x86_64-linux-gnu${prefix}.tar.gz`;
143144
triple = 'x86_64-linux-gnu';
144145
break;
145146
case 'arm64':
146-
expectedName = `aarch64-linux-gnu.tar.gz`;
147+
expectedName = `aarch64-linux-gnu${prefix}.tar.gz`;
147148
triple = 'aarch64-linux-gnu';
148149
break;
149150
case 'armhf':
150-
expectedName = `arm-rpi-linux-gnueabihf.tar.gz`;
151+
expectedName = `arm-rpi-linux-gnueabihf${prefix}.tar.gz`;
151152
triple = 'arm-rpi-linux-gnueabihf';
152153
break;
153154
}
155+
console.log(`Fetching ${expectedName} for ${triple}`);
154156
const checksumSha256 = getVSCodeSysrootChecksum(expectedName);
155157
if (!checksumSha256) {
156158
throw new Error(`Could not find checksum for ${expectedName}`);

build/linux/rpm/dep-lists.js

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/linux/rpm/dep-lists.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ export const referenceGeneratedDepsByArch = {
4141
'libc.so.6(GLIBC_2.15)(64bit)',
4242
'libc.so.6(GLIBC_2.16)(64bit)',
4343
'libc.so.6(GLIBC_2.17)(64bit)',
44-
'libc.so.6(GLIBC_2.18)(64bit)',
4544
'libc.so.6(GLIBC_2.2.5)(64bit)',
46-
'libc.so.6(GLIBC_2.25)(64bit)',
47-
'libc.so.6(GLIBC_2.27)(64bit)',
4845
'libc.so.6(GLIBC_2.28)(64bit)',
4946
'libc.so.6(GLIBC_2.3)(64bit)',
5047
'libc.so.6(GLIBC_2.3.2)(64bit)',
@@ -140,9 +137,6 @@ export const referenceGeneratedDepsByArch = {
140137
'libc.so.6(GLIBC_2.15)',
141138
'libc.so.6(GLIBC_2.16)',
142139
'libc.so.6(GLIBC_2.17)',
143-
'libc.so.6(GLIBC_2.18)',
144-
'libc.so.6(GLIBC_2.25)',
145-
'libc.so.6(GLIBC_2.27)',
146140
'libc.so.6(GLIBC_2.28)',
147141
'libc.so.6(GLIBC_2.4)',
148142
'libc.so.6(GLIBC_2.6)',
@@ -244,9 +238,6 @@ export const referenceGeneratedDepsByArch = {
244238
'libatspi.so.0()(64bit)',
245239
'libc.so.6()(64bit)',
246240
'libc.so.6(GLIBC_2.17)(64bit)',
247-
'libc.so.6(GLIBC_2.18)(64bit)',
248-
'libc.so.6(GLIBC_2.25)(64bit)',
249-
'libc.so.6(GLIBC_2.27)(64bit)',
250241
'libc.so.6(GLIBC_2.28)(64bit)',
251242
'libcairo.so.2()(64bit)',
252243
'libcurl.so.4()(64bit)',

src/vs/workbench/contrib/remote/browser/remoteConnectionHealth.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class InitialRemoteConnectionHealthContribution implements IWorkbenchCont
4949

5050
const { result, checkboxChecked } = await this.dialogService.prompt<ConnectionChoice>({
5151
type: Severity.Warning,
52-
message: localize('unsupportedGlibcWarning', "You are about to connect to an OS version that is unsupported by {0}", this.productService.nameLong),
52+
message: localize('unsupportedGlibcWarning', "You are about to connect to an OS version that is unsupported by {0}.", this.productService.nameLong),
5353
buttons: [
5454
{
5555
label: localize({ key: 'allow', comment: ['&& denotes a mnemonic'] }, "&&Allow"),
@@ -64,7 +64,7 @@ export class InitialRemoteConnectionHealthContribution implements IWorkbenchCont
6464
run: () => ConnectionChoice.Cancel
6565
},
6666
checkbox: {
67-
label: localize('remember', "Do not ask me again"),
67+
label: localize('remember', "Do not show again"),
6868
}
6969
});
7070

@@ -73,8 +73,8 @@ export class InitialRemoteConnectionHealthContribution implements IWorkbenchCont
7373
}
7474

7575
const allowed = result === ConnectionChoice.Allow;
76-
if (checkboxChecked) {
77-
this.storageService.store(REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY, allowed, StorageScope.PROFILE, StorageTarget.MACHINE);
76+
if (allowed && checkboxChecked) {
77+
this.storageService.store(`${REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY}.${this._environmentService.remoteAuthority}`, allowed, StorageScope.PROFILE, StorageTarget.MACHINE);
7878
}
7979

8080
return allowed;
@@ -85,7 +85,7 @@ export class InitialRemoteConnectionHealthContribution implements IWorkbenchCont
8585
const environment = await this._remoteAgentService.getRawEnvironment();
8686

8787
if (environment && environment.isUnsupportedGlibc) {
88-
let allowed = this.storageService.getBoolean(REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY, StorageScope.PROFILE);
88+
let allowed = this.storageService.getBoolean(`${REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY}.${this._environmentService.remoteAuthority}`, StorageScope.PROFILE);
8989
if (allowed === undefined) {
9090
allowed = await this._confirmConnection();
9191
}

0 commit comments

Comments
 (0)