From 83a701c02549a7a3c2d5de7fa73c59255cd130b5 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Mon, 7 Apr 2025 16:24:12 +0200 Subject: [PATCH] feat: cli binary (#2313) --- build.sh | 6 + build_cli.sh | 61 ++++++ dev/cli.sh | 12 ++ patches/cli.patch | 300 +++++++++++++++++++++++++++++ patches/linux/arch-1-ppc64le.patch | 46 ++--- patches/linux/arch-2-riscv64.patch | 82 ++++---- patches/linux/arch-3-loong64.patch | 56 +++--- patches/linux/arch-4-s390x.patch | 106 ++++------ prepare_vscode.sh | 13 +- 9 files changed, 509 insertions(+), 173 deletions(-) create mode 100755 build_cli.sh create mode 100755 dev/cli.sh create mode 100644 patches/cli.patch diff --git a/build.sh b/build.sh index 36ea63c..834ac4c 100755 --- a/build.sh +++ b/build.sh @@ -30,6 +30,8 @@ if [[ "${SHOULD_BUILD}" == "yes" ]]; then find "../VSCode-darwin-${VSCODE_ARCH}" -print0 | xargs -0 touch -c + . ../build_cli.sh + VSCODE_PLATFORM="darwin" elif [[ "${OS_NAME}" == "windows" ]]; then # generate Group Policy definitions @@ -45,6 +47,8 @@ if [[ "${SHOULD_BUILD}" == "yes" ]]; then SHOULD_BUILD_REH="no" SHOULD_BUILD_REH_WEB="no" fi + + . ../build_cli.sh fi VSCODE_PLATFORM="win32" @@ -54,6 +58,8 @@ if [[ "${SHOULD_BUILD}" == "yes" ]]; then npm run gulp "vscode-linux-${VSCODE_ARCH}-min-ci" find "../VSCode-linux-${VSCODE_ARCH}" -print0 | xargs -0 touch -c + + . ../build_cli.sh fi VSCODE_PLATFORM="linux" diff --git a/build_cli.sh b/build_cli.sh new file mode 100755 index 0000000..82c2897 --- /dev/null +++ b/build_cli.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +set -ex + +cd cli + +export CARGO_NET_GIT_FETCH_WITH_CLI="true" +export VSCODE_CLI_APP_NAME="$( echo "${APP_NAME}" | awk '{print tolower($0)}' )" +export VSCODE_CLI_BINARY_NAME="$( node -p "require(\"../product.json\").serverApplicationName" )" + +TUNNEL_APPLICATION_NAME="$( node -p "require(\"../product.json\").tunnelApplicationName" )" +NAME_SHORT="$( node -p "require(\"../product.json\").nameShort" )" + +if [[ "${OS_NAME}" == "osx" ]]; then + if [[ "${VSCODE_ARCH}" == "arm64" ]]; then + VSCODE_CLI_TARGET="aarch64-apple-darwin" + else + VSCODE_CLI_TARGET="x86_64-apple-darwin" + fi + + cargo build --release --target "${VSCODE_CLI_TARGET}" --bin=code + + cp "target/${VSCODE_CLI_TARGET}/release/code" "../../VSCode-darwin-${VSCODE_ARCH}/${NAME_SHORT}.app/Contents/Resources/app/bin/${TUNNEL_APPLICATION_NAME}" +elif [[ "${OS_NAME}" == "windows" ]]; then + if [[ "${VSCODE_ARCH}" == "arm64" ]]; then + VSCODE_CLI_TARGET="aarch64-pc-windows-msvc" + export VSCODE_CLI_RUST="-C target-feature=+crt-static -Clink-args=/guard:cf -Clink-args=/CETCOMPAT:NO" + else + VSCODE_CLI_TARGET="x86_64-pc-windows-msvc" + export VSCODE_CLI_RUSTFLAGS="-Ctarget-feature=+crt-static -Clink-args=/guard:cf -Clink-args=/CETCOMPAT" + fi + export VSCODE_CLI_CFLAGS="/guard:cf /Qspectre" + + rustup target add x86_64-pc-windows-msvc + + cargo build --release --target "${VSCODE_CLI_TARGET}" --bin=code + + cp "target/${VSCODE_CLI_TARGET}/release/code.exe" "../../VSCode-win32-${VSCODE_ARCH}/bin/${TUNNEL_APPLICATION_NAME}.exe" +else + if [[ "${VSCODE_ARCH}" == "arm64" ]]; then + VSCODE_CLI_TARGET="aarch64-unknown-linux-gnu" + elif [[ "${VSCODE_ARCH}" == "armhf" ]]; then + VSCODE_CLI_TARGET="armv7-unknown-linux-gnueabihf" + elif [[ "${VSCODE_ARCH}" == "x64" ]]; then + VSCODE_CLI_TARGET="x86_64-unknown-linux-gnu" + elif [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then + VSCODE_CLI_TARGET="powerpc64-unknown-linux-gnu" + elif [[ "${VSCODE_ARCH}" == "riscv64" ]]; then + VSCODE_CLI_TARGET="riscv64-unknown-linux-gnu" + elif [[ "${VSCODE_ARCH}" == "loong64" ]]; then + VSCODE_CLI_TARGET="loongarch64-unknown-linux-gnu" + fi + + if [[ -n "${VSCODE_CLI_TARGET}" ]]; then + cargo build --release --target "${VSCODE_CLI_TARGET}" --bin=code + + cp "target/${VSCODE_CLI_TARGET}/release/code" "../../VSCode-linux-${VSCODE_ARCH}/bin/${TUNNEL_APPLICATION_NAME}" + fi +fi + +cd .. diff --git a/dev/cli.sh b/dev/cli.sh new file mode 100755 index 0000000..7ac5b51 --- /dev/null +++ b/dev/cli.sh @@ -0,0 +1,12 @@ +export CARGO_NET_GIT_FETCH_WITH_CLI="true" +export VSCODE_CLI_APP_NAME="vscodium" +export VSCODE_CLI_BINARY_NAME="codium-server-insiders" +export VSCODE_CLI_DOWNLOAD_URL="https://github.com/VSCodium/vscodium-insiders/releases" +export VSCODE_CLI_QUALITY="insider" +export VSCODE_CLI_UPDATE_URL="https://raw.githubusercontent.com/VSCodium/versions/refs/heads/master" + +cargo build --release --target aarch64-apple-darwin --bin=code + +cp target/aarch64-apple-darwin/release/code "../../VSCode-darwin-arm64/VSCodium - Insiders.app/Contents/Resources/app/bin/codium-tunnel-insiders" + +"../../VSCode-darwin-arm64/VSCodium - Insiders.app/Contents/Resources/app/bin/codium-insiders" serve-web diff --git a/patches/cli.patch b/patches/cli.patch new file mode 100644 index 0000000..a73d7cb --- /dev/null +++ b/patches/cli.patch @@ -0,0 +1,300 @@ +diff --git a/cli/src/commands/serve_web.rs b/cli/src/commands/serve_web.rs +index 2ddefe1..ab9c658 100644 +--- a/cli/src/commands/serve_web.rs ++++ b/cli/src/commands/serve_web.rs +@@ -730,3 +730,3 @@ impl ConnectionManager { + let dir_fut = cache.create(&args.release.commit, |target_dir| async move { +- info!(log_for_fut, "Downloading server {}", release_for_fut.commit); ++ info!(log_for_fut, "Downloading server {}/{}", release_for_fut.commit, release_for_fut.name); + let tmpdir = tempfile::tempdir().unwrap(); +@@ -758,3 +758,3 @@ impl ConnectionManager { + .join("bin") +- .join(args.release.quality.server_entrypoint()); ++ .join(args.release.quality.server_entrypoint().unwrap()); + +diff --git a/cli/src/constants.rs b/cli/src/constants.rs +index 1e277a8..353aee7 100644 +--- a/cli/src/constants.rs ++++ b/cli/src/constants.rs +@@ -36,2 +36,5 @@ pub const VSCODE_CLI_COMMIT: Option<&'static str> = option_env!("VSCODE_CLI_COMM + pub const VSCODE_CLI_UPDATE_ENDPOINT: Option<&'static str> = option_env!("VSCODE_CLI_UPDATE_URL"); ++pub const VSCODE_CLI_DOWNLOAD_ENDPOINT: Option<&'static str> = option_env!("VSCODE_CLI_DOWNLOAD_URL"); ++pub const VSCODE_CLI_APP_NAME: Option<&'static str> = option_env!("VSCODE_CLI_APP_NAME"); ++pub const VSCODE_CLI_BINARY_NAME: Option<&'static str> = option_env!("VSCODE_CLI_BINARY_NAME"); + +diff --git a/cli/src/options.rs b/cli/src/options.rs +index 7d152c0..c0f2fb2 100644 +--- a/cli/src/options.rs ++++ b/cli/src/options.rs +@@ -9,3 +9,3 @@ use serde::{Deserialize, Serialize}; + +-use crate::constants::SERVER_NAME_MAP; ++use crate::{constants::VSCODE_CLI_BINARY_NAME, util::errors::CodeError}; + +@@ -21,2 +21,6 @@ pub enum Quality { + ++fn get_binary_name() -> Result<&'static str, CodeError> { ++ VSCODE_CLI_BINARY_NAME.ok_or_else(|| CodeError::UpdatesNotConfigured("no binary name")) ++} ++ + impl Quality { +@@ -41,9 +45,4 @@ impl Quality { + /// Server application name +- pub fn server_entrypoint(&self) -> String { +- let mut server_name = SERVER_NAME_MAP +- .as_ref() +- .and_then(|m| m.get(self)) +- .map(|s| s.server_application_name.as_str()) +- .unwrap_or("code-server-oss") +- .to_string(); ++ pub fn server_entrypoint(&self) -> Result { ++ let mut server_name = get_binary_name()?.to_string(); + +@@ -53,3 +52,3 @@ impl Quality { + +- server_name ++ Ok(server_name) + } +diff --git a/cli/src/tunnels/code_server.rs b/cli/src/tunnels/code_server.rs +index cf00bc4..b564330 100644 +--- a/cli/src/tunnels/code_server.rs ++++ b/cli/src/tunnels/code_server.rs +@@ -457,3 +457,3 @@ impl<'a> ServerBuilder<'a> { + .join("bin") +- .join(self.server_params.release.quality.server_entrypoint()), ++ .join(self.server_params.release.quality.server_entrypoint().unwrap()), + &["--version"], +diff --git a/cli/src/tunnels/paths.rs b/cli/src/tunnels/paths.rs +index 3d7d718..98529bc 100644 +--- a/cli/src/tunnels/paths.rs ++++ b/cli/src/tunnels/paths.rs +@@ -100,3 +100,3 @@ impl InstalledServer { + .join("bin") +- .join(self.quality.server_entrypoint()) ++ .join(self.quality.server_entrypoint().unwrap()) + }, +diff --git a/cli/src/update_service.rs b/cli/src/update_service.rs +index 9033914..a39bbf7 100644 +--- a/cli/src/update_service.rs ++++ b/cli/src/update_service.rs +@@ -10,3 +10,3 @@ use serde::{Deserialize, Serialize}; + use crate::{ +- constants::VSCODE_CLI_UPDATE_ENDPOINT, ++ constants::{VSCODE_CLI_APP_NAME, VSCODE_CLI_DOWNLOAD_ENDPOINT, VSCODE_CLI_UPDATE_ENDPOINT}, + debug, log, options, spanf, +@@ -18,3 +18,3 @@ use crate::{ + zipper, +- }, ++ } + }; +@@ -58,4 +58,12 @@ fn quality_download_segment(quality: options::Quality) -> &'static str { + ++fn get_app_name() -> Result<&'static str, CodeError> { ++ VSCODE_CLI_APP_NAME.ok_or_else(|| CodeError::UpdatesNotConfigured("no app name")) ++} ++ ++fn get_download_endpoint() -> Result<&'static str, CodeError> { ++ VSCODE_CLI_DOWNLOAD_ENDPOINT.ok_or_else(|| CodeError::UpdatesNotConfigured("no download url")) ++} ++ + fn get_update_endpoint() -> Result<&'static str, CodeError> { +- VSCODE_CLI_UPDATE_ENDPOINT.ok_or_else(|| CodeError::UpdatesNotConfigured("no service url")) ++ VSCODE_CLI_UPDATE_ENDPOINT.ok_or_else(|| CodeError::UpdatesNotConfigured("no update url")) + } +@@ -67,3 +75,4 @@ impl UpdateService { + +- pub async fn get_release_by_semver_version( ++ /// Gets the latest commit for the target of the given quality. ++ pub async fn get_latest_commit( + &self, +@@ -72,14 +81,10 @@ impl UpdateService { + quality: options::Quality, +- version: &str, + ) -> Result { + let update_endpoint = get_update_endpoint()?; +- let download_segment = target +- .download_segment(platform) +- .ok_or_else(|| CodeError::UnsupportedPlatform(platform.to_string()))?; + let download_url = format!( +- "{}/api/versions/{}/{}/{}", ++ "{}/{}/{}/{}/latest.json", + update_endpoint, +- version, +- download_segment, + quality_download_segment(quality), ++ platform.os(), ++ platform.arch(), + ); +@@ -97,3 +102,3 @@ impl UpdateService { + let res = response.json::().await?; +- debug!(self.log, "Resolved version {} to {}", version, res.version); ++ debug!(self.log, "Resolved quality {} to {}", quality, res.version); + +@@ -108,40 +113,17 @@ impl UpdateService { + +- /// Gets the latest commit for the target of the given quality. +- pub async fn get_latest_commit( +- &self, +- platform: Platform, +- target: TargetKind, +- quality: options::Quality, +- ) -> Result { +- let update_endpoint = get_update_endpoint()?; +- let download_segment = target +- .download_segment(platform) +- .ok_or_else(|| CodeError::UnsupportedPlatform(platform.to_string()))?; ++ pub fn get_download_url(&self, release: &Release) -> Result { ++ let app_name = get_app_name()?; ++ let download_endpoint = get_download_endpoint()?; ++ + let download_url = format!( +- "{}/api/latest/{}/{}", +- update_endpoint, +- download_segment, +- quality_download_segment(quality), ++ "{}/download/{}/{}-reh-web-{}-{}-{}.tar.gz", ++ download_endpoint, ++ release.name, ++ app_name, ++ release.platform.os(), ++ release.platform.arch(), ++ release.name, + ); + +- let mut response = spanf!( +- self.log, +- self.log.span("server.version.resolve"), +- self.client.make_request("GET", download_url) +- )?; +- +- if !response.status_code.is_success() { +- return Err(response.into_err().await.into()); +- } +- +- let res = response.json::().await?; +- debug!(self.log, "Resolved quality {} to {}", quality, res.version); +- +- Ok(Release { +- target, +- platform, +- quality, +- name: res.name, +- commit: res.version, +- }) ++ Ok(download_url) + } +@@ -150,15 +132,3 @@ impl UpdateService { + pub async fn get_download_stream(&self, release: &Release) -> Result { +- let update_endpoint = get_update_endpoint()?; +- let download_segment = release +- .target +- .download_segment(release.platform) +- .ok_or_else(|| CodeError::UnsupportedPlatform(release.platform.to_string()))?; +- +- let download_url = format!( +- "{}/commit:{}/{}/{}", +- update_endpoint, +- release.commit, +- download_segment, +- quality_download_segment(release.quality), +- ); ++ let download_url = self.get_download_url(release)?; + +@@ -196,13 +166,2 @@ pub enum TargetKind { + +-impl TargetKind { +- fn download_segment(&self, platform: Platform) -> Option { +- match *self { +- TargetKind::Server => Some(platform.headless()), +- TargetKind::Archive => platform.archive(), +- TargetKind::Web => Some(platform.web()), +- TargetKind::Cli => Some(platform.cli()), +- } +- } +-} +- + #[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize)] +@@ -225,30 +184,17 @@ pub enum Platform { + impl Platform { +- pub fn archive(&self) -> Option { +- match self { +- Platform::LinuxX64 => Some("linux-x64".to_owned()), +- Platform::LinuxARM64 => Some("linux-arm64".to_owned()), +- Platform::LinuxARM32 => Some("linux-armhf".to_owned()), +- Platform::DarwinX64 => Some("darwin".to_owned()), +- Platform::DarwinARM64 => Some("darwin-arm64".to_owned()), +- Platform::WindowsX64 => Some("win32-x64-archive".to_owned()), +- Platform::WindowsX86 => Some("win32-archive".to_owned()), +- Platform::WindowsARM64 => Some("win32-arm64-archive".to_owned()), +- _ => None, +- } +- } +- pub fn headless(&self) -> String { ++ pub fn arch(&self) -> String { + match self { +- Platform::LinuxAlpineARM64 => "server-alpine-arm64", +- Platform::LinuxAlpineX64 => "server-linux-alpine", +- Platform::LinuxX64 => "server-linux-x64", +- Platform::LinuxX64Legacy => "server-linux-legacy-x64", +- Platform::LinuxARM64 => "server-linux-arm64", +- Platform::LinuxARM64Legacy => "server-linux-legacy-arm64", +- Platform::LinuxARM32 => "server-linux-armhf", +- Platform::LinuxARM32Legacy => "server-linux-legacy-armhf", +- Platform::DarwinX64 => "server-darwin", +- Platform::DarwinARM64 => "server-darwin-arm64", +- Platform::WindowsX64 => "server-win32-x64", +- Platform::WindowsX86 => "server-win32", +- Platform::WindowsARM64 => "server-win32-arm64", ++ Platform::LinuxAlpineARM64 => "arm64", ++ Platform::LinuxAlpineX64 => "x64", ++ Platform::LinuxX64 => "x64", ++ Platform::LinuxX64Legacy => "x64", ++ Platform::LinuxARM64 => "arm64", ++ Platform::LinuxARM64Legacy => "arm64", ++ Platform::LinuxARM32 => "armhf", ++ Platform::LinuxARM32Legacy => "armhf", ++ Platform::DarwinX64 => "x64", ++ Platform::DarwinARM64 => "arm64", ++ Platform::WindowsX64 => "x64", ++ Platform::WindowsX86 => "ia42", ++ Platform::WindowsARM64 => "arm64", + } +@@ -257,17 +203,17 @@ impl Platform { + +- pub fn cli(&self) -> String { ++ pub fn os(&self) -> String { + match self { +- Platform::LinuxAlpineARM64 => "cli-alpine-arm64", +- Platform::LinuxAlpineX64 => "cli-alpine-x64", +- Platform::LinuxX64 => "cli-linux-x64", +- Platform::LinuxX64Legacy => "cli-linux-x64", +- Platform::LinuxARM64 => "cli-linux-arm64", +- Platform::LinuxARM64Legacy => "cli-linux-arm64", +- Platform::LinuxARM32 => "cli-linux-armhf", +- Platform::LinuxARM32Legacy => "cli-linux-armhf", +- Platform::DarwinX64 => "cli-darwin-x64", +- Platform::DarwinARM64 => "cli-darwin-arm64", +- Platform::WindowsARM64 => "cli-win32-arm64", +- Platform::WindowsX64 => "cli-win32-x64", +- Platform::WindowsX86 => "cli-win32", ++ Platform::LinuxAlpineARM64 => "alpine", ++ Platform::LinuxAlpineX64 => "alpine", ++ Platform::LinuxX64 => "linux", ++ Platform::LinuxX64Legacy => "linux", ++ Platform::LinuxARM64 => "linux", ++ Platform::LinuxARM64Legacy => "linux", ++ Platform::LinuxARM32 => "linux", ++ Platform::LinuxARM32Legacy => "linux", ++ Platform::DarwinX64 => "darwin", ++ Platform::DarwinARM64 => "darwin", ++ Platform::WindowsX64 => "win32", ++ Platform::WindowsX86 => "win32", ++ Platform::WindowsARM64 => "win32", + } +@@ -276,6 +222,2 @@ impl Platform { + +- pub fn web(&self) -> String { +- format!("{}-web", self.headless()) +- } +- + pub fn env_default() -> Option { diff --git a/patches/linux/arch-1-ppc64le.patch b/patches/linux/arch-1-ppc64le.patch index 23a85a8..34396e4 100644 --- a/patches/linux/arch-1-ppc64le.patch +++ b/patches/linux/arch-1-ppc64le.patch @@ -42,7 +42,7 @@ index 5ac9f95..cd04bdf 100644 + { platform: 'linux', arch: 'ppc64le' }, { platform: 'alpine', arch: 'arm64' }, diff --git a/build/gulpfile.scan.js b/build/gulpfile.scan.js -index cbcdddb..274d889 100644 +index aafc64e..484d5f4 100644 --- a/build/gulpfile.scan.js +++ b/build/gulpfile.scan.js @@ -26,2 +26,3 @@ const BUILD_TARGETS = [ @@ -471,45 +471,37 @@ index c6a01da..3f3c3f5 100644 + return ['x86_64', 'armv7hl', 'aarch64', 'ppc64le'].includes(s); } diff --git a/cli/src/update_service.rs b/cli/src/update_service.rs -index 9033914..bcab676 100644 +index a39bbf7..84d3efe 100644 --- a/cli/src/update_service.rs +++ b/cli/src/update_service.rs -@@ -217,2 +217,4 @@ pub enum Platform { +@@ -176,2 +176,3 @@ pub enum Platform { LinuxARM32Legacy, + LinuxPPC64LE, -+ LinuxPPC64LELegacy, DarwinX64, -@@ -230,2 +232,3 @@ impl Platform { - Platform::LinuxARM32 => Some("linux-armhf".to_owned()), -+ Platform::LinuxPPC64LE => Some("linux-ppc64le".to_owned()), - Platform::DarwinX64 => Some("darwin".to_owned()), -@@ -248,2 +251,4 @@ impl Platform { - Platform::LinuxARM32Legacy => "server-linux-legacy-armhf", -+ Platform::LinuxPPC64LE => "server-linux-ppc64le", -+ Platform::LinuxPPC64LELegacy => "server-linux-legacy-ppc64le", - Platform::DarwinX64 => "server-darwin", -@@ -267,2 +272,4 @@ impl Platform { - Platform::LinuxARM32Legacy => "cli-linux-armhf", -+ Platform::LinuxPPC64LE => "cli-linux-ppc64le", -+ Platform::LinuxPPC64LELegacy => "cli-linux-ppc64le", - Platform::DarwinX64 => "cli-darwin-x64", -@@ -299,2 +306,4 @@ impl Platform { +@@ -194,2 +195,3 @@ impl Platform { + Platform::LinuxARM32Legacy => "armhf", ++ Platform::LinuxPPC64LE => "ppc64le", + Platform::DarwinX64 => "x64", +@@ -213,2 +215,3 @@ impl Platform { + Platform::LinuxARM32Legacy => "linux", ++ Platform::LinuxPPC64LE => "linux", + Platform::DarwinX64 => "darwin", +@@ -241,2 +244,4 @@ impl Platform { Some(Platform::LinuxARM64) -+ } else if cfg!(all(target_os = "linux", target_arch = "ppc64le")) { ++ } else if cfg!(all(target_os = "linux", target_arch = "powerpc64")) { + Some(Platform::LinuxPPC64LE) } else if cfg!(all(target_os = "macos", target_arch = "x86_64")) { -@@ -326,2 +335,4 @@ impl fmt::Display for Platform { +@@ -268,2 +273,3 @@ impl fmt::Display for Platform { Platform::LinuxARM32Legacy => "LinuxARM32Legacy", + Platform::LinuxPPC64LE => "LinuxPPC64LE", -+ Platform::LinuxPPC64LELegacy => "LinuxPPC64LELegacy", Platform::DarwinX64 => "DarwinX64", diff --git a/cli/src/util/prereqs.rs b/cli/src/util/prereqs.rs -index 44c8597..d89b384 100644 +index 44c8597..679aacb 100644 --- a/cli/src/util/prereqs.rs +++ b/cli/src/util/prereqs.rs @@ -82,2 +82,4 @@ impl PreReqChecker { Platform::LinuxARM32 -+ } else if cfg!(target_arch = "ppc64le") { ++ } else if cfg!(target_arch = "powerpc64") { + Platform::LinuxPPC64LE } else { diff --git a/resources/server/bin/helpers/check-requirements-linux.sh b/resources/server/bin/helpers/check-requirements-linux.sh @@ -521,7 +513,7 @@ index 8ea4c0b..b9d3b47 100644 + ppc64el) LDCONFIG_ARCH="64bit";; esac diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts -index 72de79b..3614b7f 100644 +index b7f8325..5400065 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagement.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts @@ -44,2 +44,3 @@ export function TargetPlatformToString(targetPlatform: TargetPlatform) { @@ -539,10 +531,10 @@ index 72de79b..3614b7f 100644 + } return TargetPlatform.UNKNOWN; diff --git a/src/vs/platform/extensions/common/extensions.ts b/src/vs/platform/extensions/common/extensions.ts -index b38ba82..2faea35 100644 +index 8e68cbe..23f1bea 100644 --- a/src/vs/platform/extensions/common/extensions.ts +++ b/src/vs/platform/extensions/common/extensions.ts -@@ -318,2 +318,3 @@ export const enum TargetPlatform { +@@ -319,2 +319,3 @@ export const enum TargetPlatform { LINUX_ARMHF = 'linux-armhf', + LINUX_PPC64LE = 'linux-ppc64le', diff --git a/patches/linux/arch-2-riscv64.patch b/patches/linux/arch-2-riscv64.patch index 3642c37..b063ccd 100644 --- a/patches/linux/arch-2-riscv64.patch +++ b/patches/linux/arch-2-riscv64.patch @@ -1,5 +1,5 @@ diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js -index 8c83c13..b996472 100644 +index cd04bdf..e284026 100644 --- a/build/gulpfile.reh.js +++ b/build/gulpfile.reh.js @@ -51,2 +51,3 @@ const BUILD_TARGETS = [ @@ -7,7 +7,7 @@ index 8c83c13..b996472 100644 + { platform: 'linux', arch: 'riscv64' }, { platform: 'alpine', arch: 'arm64' }, diff --git a/build/gulpfile.scan.js b/build/gulpfile.scan.js -index 274d889..0eafadc 100644 +index 484d5f4..66c8e1f 100644 --- a/build/gulpfile.scan.js +++ b/build/gulpfile.scan.js @@ -27,2 +27,3 @@ const BUILD_TARGETS = [ @@ -15,15 +15,15 @@ index 274d889..0eafadc 100644 + { platform: 'linux', arch: 'riscv64' }, ]; diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js -index 7395ba4..66bf180 100644 +index 3ed2182..f0614d0 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js -@@ -495,2 +495,3 @@ const BUILD_TARGETS = [ +@@ -492,2 +492,3 @@ const BUILD_TARGETS = [ { platform: 'linux', arch: 'ppc64le' }, + { platform: 'linux', arch: 'riscv64' }, ]; diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js -index 264cec1..37575e1 100644 +index 707581d..298181d 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -33,3 +33,3 @@ const linuxPackageRevision = Math.floor(new Date().getTime() / 1000); @@ -31,27 +31,27 @@ index 264cec1..37575e1 100644 - return { x64: 'amd64', armhf: 'armhf', arm64: 'arm64', ppc64le: 'ppc64el' }[arch]; + return { x64: 'amd64', armhf: 'armhf', arm64: 'arm64', ppc64le: 'ppc64el', riscv64: 'riscv64' }[arch]; } -@@ -145,3 +145,3 @@ function getRpmBuildPath(rpmArch) { +@@ -146,3 +146,3 @@ function getRpmBuildPath(rpmArch) { function getRpmPackageArch(arch) { - return { x64: 'x86_64', armhf: 'armv7hl', arm64: 'aarch64', ppc64le: 'ppc64le' }[arch]; + return { x64: 'x86_64', armhf: 'armv7hl', arm64: 'aarch64', ppc64le: 'ppc64le', riscv64: 'riscv64' }[arch]; } -@@ -308,2 +308,3 @@ const BUILD_TARGETS = [ +@@ -305,2 +305,3 @@ const BUILD_TARGETS = [ { arch: 'ppc64le' }, + { arch: 'riscv64' }, ]; diff --git a/build/linux/debian/calculate-deps.js b/build/linux/debian/calculate-deps.js -index b97d275..37a5835 100644 +index fdae163..a08ebda 100644 --- a/build/linux/debian/calculate-deps.js +++ b/build/linux/debian/calculate-deps.js -@@ -54,2 +54,5 @@ function calculatePackageDeps(binaryPath, arch, chromiumSysroot, vscodeSysroot) +@@ -57,2 +57,5 @@ function calculatePackageDeps(binaryPath, arch, chromiumSysroot, vscodeSysroot) break; + case 'riscv64': + cmd.push(`-l${chromiumSysroot}/usr/lib/riscv64-linux-gnu`, `-l${chromiumSysroot}/lib/riscv64-linux-gnu`, `-l${vscodeSysroot}/usr/lib/riscv64-linux-gnu`, `-l${vscodeSysroot}/lib/riscv64-linux-gnu`); + break; } diff --git a/build/linux/debian/calculate-deps.ts b/build/linux/debian/calculate-deps.ts -index 5a6e9b4..903375f 100644 +index 423c415..88ee2f0 100644 --- a/build/linux/debian/calculate-deps.ts +++ b/build/linux/debian/calculate-deps.ts @@ -67,2 +67,8 @@ function calculatePackageDeps(binaryPath: string, arch: DebianArchString, chromi @@ -64,7 +64,7 @@ index 5a6e9b4..903375f 100644 + break; } diff --git a/build/linux/debian/dep-lists.js b/build/linux/debian/dep-lists.js -index 64377e3..5fb20f8 100644 +index a85352e..4ccdcd9 100644 --- a/build/linux/debian/dep-lists.js +++ b/build/linux/debian/dep-lists.js @@ -178,2 +178,42 @@ exports.referenceGeneratedDepsByArch = { @@ -111,7 +111,7 @@ index 64377e3..5fb20f8 100644 + ], }; diff --git a/build/linux/debian/dep-lists.ts b/build/linux/debian/dep-lists.ts -index aa769ad..5534874 100644 +index 0d0f11b..b765492 100644 --- a/build/linux/debian/dep-lists.ts +++ b/build/linux/debian/dep-lists.ts @@ -178,2 +178,42 @@ export const referenceGeneratedDepsByArch = { @@ -158,10 +158,10 @@ index aa769ad..5534874 100644 + ], }; diff --git a/build/linux/debian/install-sysroot.js b/build/linux/debian/install-sysroot.js -index 3dcd5c1..b4e3542 100644 +index ab6b826..fc2817a 100644 --- a/build/linux/debian/install-sysroot.js +++ b/build/linux/debian/install-sysroot.js -@@ -141,2 +141,6 @@ async function getVSCodeSysroot(arch) { +@@ -144,2 +144,6 @@ async function getVSCodeSysroot(arch) { break; + case 'riscv64': + expectedName = `riscv64-linux-gnu${prefix}.tar.gz`; @@ -169,7 +169,7 @@ index 3dcd5c1..b4e3542 100644 + break; } diff --git a/build/linux/debian/install-sysroot.ts b/build/linux/debian/install-sysroot.ts -index 52b3422..11d54b1 100644 +index c23db0f..50c28b2 100644 --- a/build/linux/debian/install-sysroot.ts +++ b/build/linux/debian/install-sysroot.ts @@ -158,2 +158,6 @@ export async function getVSCodeSysroot(arch: DebianArchString): Promise @@ -224,74 +224,70 @@ index 3f3c3f5..d94537e 100644 + return ['x86_64', 'armv7hl', 'aarch64', 'ppc64le', 'riscv64'].includes(s); } diff --git a/cli/src/update_service.rs b/cli/src/update_service.rs -index bcab676..29228cb 100644 +index 84d3efe..4f2c8c2 100644 --- a/cli/src/update_service.rs +++ b/cli/src/update_service.rs -@@ -219,2 +219,3 @@ pub enum Platform { - LinuxPPC64LELegacy, +@@ -177,2 +177,3 @@ pub enum Platform { + LinuxPPC64LE, + LinuxRISCV64, DarwinX64, -@@ -233,2 +234,3 @@ impl Platform { - Platform::LinuxPPC64LE => Some("linux-ppc64le".to_owned()), -+ Platform::LinuxRISCV64 => Some("linux-riscv64".to_owned()), - Platform::DarwinX64 => Some("darwin".to_owned()), -@@ -253,2 +255,3 @@ impl Platform { - Platform::LinuxPPC64LELegacy => "server-linux-legacy-ppc64le", -+ Platform::LinuxRISCV64 => "server-linux-riscv64", - Platform::DarwinX64 => "server-darwin", -@@ -274,2 +277,3 @@ impl Platform { - Platform::LinuxPPC64LELegacy => "cli-linux-ppc64le", -+ Platform::LinuxRISCV64 => "cli-linux-riscv64", - Platform::DarwinX64 => "cli-darwin-x64", -@@ -308,2 +312,4 @@ impl Platform { +@@ -196,2 +197,3 @@ impl Platform { + Platform::LinuxPPC64LE => "ppc64le", ++ Platform::LinuxRISCV64 => "riscv64", + Platform::DarwinX64 => "x64", +@@ -216,2 +218,3 @@ impl Platform { + Platform::LinuxPPC64LE => "linux", ++ Platform::LinuxRISCV64 => "linux", + Platform::DarwinX64 => "darwin", +@@ -246,2 +249,4 @@ impl Platform { Some(Platform::LinuxPPC64LE) + } else if cfg!(all(target_os = "linux", target_arch = "riscv64")) { + Some(Platform::LinuxRISCV64) } else if cfg!(all(target_os = "macos", target_arch = "x86_64")) { -@@ -337,2 +343,3 @@ impl fmt::Display for Platform { - Platform::LinuxPPC64LELegacy => "LinuxPPC64LELegacy", +@@ -274,2 +279,3 @@ impl fmt::Display for Platform { + Platform::LinuxPPC64LE => "LinuxPPC64LE", + Platform::LinuxRISCV64 => "LinuxRISCV64", Platform::DarwinX64 => "DarwinX64", diff --git a/cli/src/util/prereqs.rs b/cli/src/util/prereqs.rs -index 4827a47..137a257 100644 +index 679aacb..1a37552 100644 --- a/cli/src/util/prereqs.rs +++ b/cli/src/util/prereqs.rs -@@ -88,2 +88,4 @@ impl PreReqChecker { +@@ -84,2 +84,4 @@ impl PreReqChecker { Platform::LinuxPPC64LE + } else if cfg!(target_arch = "riscv64") { + Platform::LinuxRISCV64 } else { diff --git a/resources/server/bin/helpers/check-requirements-linux.sh b/resources/server/bin/helpers/check-requirements-linux.sh -index 00dd3e2..91c9d20 100644 +index b9d3b47..b18e402 100644 --- a/resources/server/bin/helpers/check-requirements-linux.sh +++ b/resources/server/bin/helpers/check-requirements-linux.sh -@@ -57,2 +57,3 @@ case $ARCH in +@@ -56,2 +56,3 @@ case $ARCH in ppc64el) LDCONFIG_ARCH="64bit";; + riscv64) LDCONFIG_ARCH="RISC-V";; esac diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts -index 004df84..fb2acc7 100644 +index 5400065..be95b04 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagement.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts -@@ -42,2 +42,3 @@ export function TargetPlatformToString(targetPlatform: TargetPlatform) { +@@ -45,2 +45,3 @@ export function TargetPlatformToString(targetPlatform: TargetPlatform) { case TargetPlatform.LINUX_PPC64LE: return 'Linux PowerPC64'; + case TargetPlatform.LINUX_RISCV64: return 'Linux RISC-V 64'; -@@ -66,2 +67,3 @@ export function toTargetPlatform(targetPlatform: string): TargetPlatform { +@@ -69,2 +70,3 @@ export function toTargetPlatform(targetPlatform: string): TargetPlatform { case TargetPlatform.LINUX_PPC64LE: return TargetPlatform.LINUX_PPC64LE; + case TargetPlatform.LINUX_RISCV64: return TargetPlatform.LINUX_RISCV64; -@@ -104,2 +106,5 @@ export function getTargetPlatform(platform: Platform | 'alpine', arch: string | +@@ -107,2 +109,5 @@ export function getTargetPlatform(platform: Platform | 'alpine', arch: string | } + if (arch === 'riscv64') { + return TargetPlatform.LINUX_RISCV64; + } return TargetPlatform.UNKNOWN; diff --git a/src/vs/platform/extensions/common/extensions.ts b/src/vs/platform/extensions/common/extensions.ts -index a7d6298..a7aa2bb 100644 +index 23f1bea..10152de 100644 --- a/src/vs/platform/extensions/common/extensions.ts +++ b/src/vs/platform/extensions/common/extensions.ts -@@ -295,2 +295,3 @@ export const enum TargetPlatform { +@@ -320,2 +320,3 @@ export const enum TargetPlatform { LINUX_PPC64LE = 'linux-ppc64le', + LINUX_RISCV64 = 'linux-riscv64', diff --git a/patches/linux/arch-3-loong64.patch b/patches/linux/arch-3-loong64.patch index 2c113a5..a4c60fb 100644 --- a/patches/linux/arch-3-loong64.patch +++ b/patches/linux/arch-3-loong64.patch @@ -1,5 +1,5 @@ diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js -index df4fda0c898..ce8f21bbc0e 100644 +index e284026..52f9a12 100644 --- a/build/gulpfile.reh.js +++ b/build/gulpfile.reh.js @@ -52,2 +52,3 @@ const BUILD_TARGETS = [ @@ -7,7 +7,7 @@ index df4fda0c898..ce8f21bbc0e 100644 + { platform: 'linux', arch: 'loong64' }, { platform: 'alpine', arch: 'arm64' }, diff --git a/build/gulpfile.scan.js b/build/gulpfile.scan.js -index 0eafadc1fff..3c1d6fb5bfc 100644 +index 66c8e1f..8a8c1eb 100644 --- a/build/gulpfile.scan.js +++ b/build/gulpfile.scan.js @@ -28,2 +28,3 @@ const BUILD_TARGETS = [ @@ -15,82 +15,78 @@ index 0eafadc1fff..3c1d6fb5bfc 100644 + { platform: 'linux', arch: 'loong64' }, ]; diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js -index b208d700f2c..4be8f93f704 100644 +index f0614d0..1438867 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js -@@ -489,2 +489,3 @@ const BUILD_TARGETS = [ +@@ -493,2 +493,3 @@ const BUILD_TARGETS = [ { platform: 'linux', arch: 'riscv64' }, + { platform: 'linux', arch: 'loong64' }, ]; diff --git a/cli/src/update_service.rs b/cli/src/update_service.rs -index 29228cb4235..c1163029377 100644 +index 4f2c8c2..4ea1bd2 100644 --- a/cli/src/update_service.rs +++ b/cli/src/update_service.rs -@@ -220,2 +220,3 @@ pub enum Platform { +@@ -178,2 +178,3 @@ pub enum Platform { LinuxRISCV64, + LinuxLoong64, DarwinX64, -@@ -235,2 +236,3 @@ impl Platform { - Platform::LinuxRISCV64 => Some("linux-riscv64".to_owned()), -+ Platform::LinuxLoong64 => Some("linux-loong64".to_owned()), - Platform::DarwinX64 => Some("darwin".to_owned()), -@@ -256,2 +258,3 @@ impl Platform { - Platform::LinuxRISCV64 => "server-linux-riscv64", -+ Platform::LinuxLoong64 => "server-linux-loong64", - Platform::DarwinX64 => "server-darwin", -@@ -278,2 +281,3 @@ impl Platform { - Platform::LinuxRISCV64 => "cli-linux-riscv64", -+ Platform::LinuxLoong64 => "cli-linux-loong64", - Platform::DarwinX64 => "cli-darwin-x64", -@@ -314,2 +318,4 @@ impl Platform { +@@ -198,2 +199,3 @@ impl Platform { + Platform::LinuxRISCV64 => "riscv64", ++ Platform::LinuxLoong64 => "loong64", + Platform::DarwinX64 => "x64", +@@ -219,2 +221,3 @@ impl Platform { + Platform::LinuxRISCV64 => "linux", ++ Platform::LinuxLoong64 => "linux", + Platform::DarwinX64 => "darwin", +@@ -251,2 +254,4 @@ impl Platform { Some(Platform::LinuxRISCV64) + } else if cfg!(all(target_os = "linux", target_arch = "loongarch64")) { + Some(Platform::LinuxLoong64) } else if cfg!(all(target_os = "macos", target_arch = "x86_64")) { -@@ -344,2 +350,3 @@ impl fmt::Display for Platform { +@@ -280,2 +285,3 @@ impl fmt::Display for Platform { Platform::LinuxRISCV64 => "LinuxRISCV64", + Platform::LinuxLoong64 => "LinuxLoong64", Platform::DarwinX64 => "DarwinX64", diff --git a/cli/src/util/prereqs.rs b/cli/src/util/prereqs.rs -index 137a2570130..8f1e20c2aa9 100644 +index 1a37552..ff191a1 100644 --- a/cli/src/util/prereqs.rs +++ b/cli/src/util/prereqs.rs -@@ -90,2 +90,4 @@ impl PreReqChecker { +@@ -86,2 +86,4 @@ impl PreReqChecker { Platform::LinuxRISCV64 + } else if cfg!(target_arch = "loongarch64") { + Platform::LinuxLoong64 } else { diff --git a/resources/server/bin/helpers/check-requirements-linux.sh b/resources/server/bin/helpers/check-requirements-linux.sh -index 91c9d203387..7776dbcbc24 100644 +index b18e402..0b7aa4e 100644 --- a/resources/server/bin/helpers/check-requirements-linux.sh +++ b/resources/server/bin/helpers/check-requirements-linux.sh -@@ -58,2 +58,3 @@ case $ARCH in +@@ -57,2 +57,3 @@ case $ARCH in riscv64) LDCONFIG_ARCH="RISC-V";; + loongarch64) LDCONFIG_ARCH="double-float";; esac diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts -index 03e78ca3116..8e59218d7ad 100644 +index be95b04..1a0decd 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagement.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts -@@ -44,2 +44,3 @@ export function TargetPlatformToString(targetPlatform: TargetPlatform) { +@@ -46,2 +46,3 @@ export function TargetPlatformToString(targetPlatform: TargetPlatform) { case TargetPlatform.LINUX_RISCV64: return 'Linux RISC-V 64'; + case TargetPlatform.LINUX_LOONG64: return 'Linux Loong64'; -@@ -69,2 +70,3 @@ export function toTargetPlatform(targetPlatform: string): TargetPlatform { +@@ -71,2 +72,3 @@ export function toTargetPlatform(targetPlatform: string): TargetPlatform { case TargetPlatform.LINUX_RISCV64: return TargetPlatform.LINUX_RISCV64; + case TargetPlatform.LINUX_LOONG64: return TargetPlatform.LINUX_LOONG64; -@@ -113,2 +115,5 @@ export function getTargetPlatform(platform: Platform | 'alpine', arch: string | +@@ -112,2 +114,5 @@ export function getTargetPlatform(platform: Platform | 'alpine', arch: string | } + if (arch === 'loong64') { + return TargetPlatform.LINUX_LOONG64; + } return TargetPlatform.UNKNOWN; diff --git a/src/vs/platform/extensions/common/extensions.ts b/src/vs/platform/extensions/common/extensions.ts -index a7aa2bb23bf..a4d076ce596 100644 +index 10152de..3eb0412 100644 --- a/src/vs/platform/extensions/common/extensions.ts +++ b/src/vs/platform/extensions/common/extensions.ts -@@ -296,2 +296,3 @@ export const enum TargetPlatform { +@@ -321,2 +321,3 @@ export const enum TargetPlatform { LINUX_RISCV64 = 'linux-riscv64', + LINUX_LOONG64 = 'linux-loong64', diff --git a/patches/linux/arch-4-s390x.patch b/patches/linux/arch-4-s390x.patch index 3695be7..cc209df 100644 --- a/patches/linux/arch-4-s390x.patch +++ b/patches/linux/arch-4-s390x.patch @@ -1,8 +1,8 @@ diff --git a/build/azure-pipelines/linux/setup-env.sh b/build/azure-pipelines/linux/setup-env.sh -index fbe67b0..5b2f5d8 100755 +index 2da5cf9..700e199 100755 --- a/build/azure-pipelines/linux/setup-env.sh +++ b/build/azure-pipelines/linux/setup-env.sh -@@ -86,2 +86,14 @@ elif [ "$npm_config_arch" == "arm" ]; then +@@ -80,2 +80,14 @@ elif [ "$npm_config_arch" == "ppc64" ]; then export VSCODE_REMOTE_LDFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/powerpc64le-linux-gnu/powerpc64le-linux-gnu/sysroot -L$VSCODE_SYSROOT_DIR/powerpc64le-linux-gnu/powerpc64le-linux-gnu/sysroot/usr/lib/powerpc64le-linux-gnu -L$VSCODE_SYSROOT_DIR/powerpc64le-linux-gnu/powerpc64le-linux-gnu/sysroot/lib/powerpc64le-linux-gnu" +elif [ "$npm_config_arch" == "s390x" ]; then + # Set compiler toolchain for client native modules @@ -18,14 +18,14 @@ index fbe67b0..5b2f5d8 100755 + export VSCODE_REMOTE_LDFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/s390x-linux-gnu/s390x-linux-gnu/sysroot -L$VSCODE_SYSROOT_DIR/s390x-linux-gnu/s390x-linux-gnu/sysroot/usr/lib/s390x-linux-gnu -L$VSCODE_SYSROOT_DIR/s390x-linux-gnu/s390x-linux-gnu/sysroot/lib/s390x-linux-gnu" fi diff --git a/build/checksums/vscode-sysroot.txt b/build/checksums/vscode-sysroot.txt -index 0b5f38c..9f3b02b 100644 +index db63d02..bbfa533 100644 --- a/build/checksums/vscode-sysroot.txt +++ b/build/checksums/vscode-sysroot.txt -@@ -7 +7,2 @@ +@@ -4 +4,2 @@ dbb927408393041664a020661f2641c9785741be3d29b050b9dac58980967784 x86_64-linux-g fa8176d27be18bb0eeb7f55b0fa22255050b430ef68c29136599f02976eb0b1b powerpc64le-linux-gnu-glibc-2.28.tar.gz +7055f3d40e7195fb1e13f0fbaf5ffadf781bddaca5fd5e0d9972f4157a203fb5 s390x-linux-gnu-glibc-2.28.tar.gz diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js -index d0770d6..8c83c13 100644 +index 52f9a12..4b890f4 100644 --- a/build/gulpfile.reh.js +++ b/build/gulpfile.reh.js @@ -53,2 +53,3 @@ const BUILD_TARGETS = [ @@ -33,7 +33,7 @@ index d0770d6..8c83c13 100644 + { platform: 'linux', arch: 's390x' }, { platform: 'alpine', arch: 'arm64' }, diff --git a/build/gulpfile.scan.js b/build/gulpfile.scan.js -index cbcdddb..274d889 100644 +index 8a8c1eb..1ef390b 100644 --- a/build/gulpfile.scan.js +++ b/build/gulpfile.scan.js @@ -29,2 +29,3 @@ const BUILD_TARGETS = [ @@ -41,43 +41,43 @@ index cbcdddb..274d889 100644 + { platform: 'linux', arch: 's390x' }, ]; diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js -index 95f2cf0..7395ba4 100644 +index 1438867..8593b88 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js -@@ -498,2 +498,3 @@ const BUILD_TARGETS = [ +@@ -494,2 +494,3 @@ const BUILD_TARGETS = [ { platform: 'linux', arch: 'loong64' }, + { platform: 'linux', arch: 's390x' }, ]; diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js -index fb0e5a4..264cec1 100644 +index 298181d..dcc42a8 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js -@@ -31,3 +31,3 @@ const linuxPackageRevision = Math.floor(new Date().getTime() / 1000); +@@ -33,3 +33,3 @@ const linuxPackageRevision = Math.floor(new Date().getTime() / 1000); function getDebPackageArch(arch) { - return { x64: 'amd64', armhf: 'armhf', arm64: 'arm64', ppc64le: 'ppc64el', riscv64: 'riscv64' }[arch]; + return { x64: 'amd64', armhf: 'armhf', arm64: 'arm64', ppc64le: 'ppc64el', riscv64: 'riscv64', s390x: 's390x' }[arch]; } -@@ -143,3 +143,3 @@ function getRpmBuildPath(rpmArch) { +@@ -146,3 +146,3 @@ function getRpmBuildPath(rpmArch) { function getRpmPackageArch(arch) { - return { x64: 'x86_64', armhf: 'armv7hl', arm64: 'aarch64', ppc64le: 'ppc64le', riscv64: 'riscv64' }[arch]; + return { x64: 'x86_64', armhf: 'armv7hl', arm64: 'aarch64', ppc64le: 'ppc64le', riscv64: 'riscv64', s390x: 's390x' }[arch]; } -@@ -307,2 +307,3 @@ const BUILD_TARGETS = [ +@@ -306,2 +306,3 @@ const BUILD_TARGETS = [ { arch: 'riscv64' }, + { arch: 's390x' }, ]; diff --git a/build/linux/debian/calculate-deps.js b/build/linux/debian/calculate-deps.js -index 57934e6..b97d275 100644 +index a08ebda..9527119 100644 --- a/build/linux/debian/calculate-deps.js +++ b/build/linux/debian/calculate-deps.js -@@ -57,2 +57,5 @@ function calculatePackageDeps(binaryPath, arch, chromiumSysroot, vscodeSysroot) +@@ -60,2 +60,5 @@ function calculatePackageDeps(binaryPath, arch, chromiumSysroot, vscodeSysroot) break; + case 's390x': + cmd.push(`-l${chromiumSysroot}/usr/lib/s390x-linux-gnu`, `-l${chromiumSysroot}/lib/s390x-linux-gnu`, `-l${vscodeSysroot}/usr/lib/s390x-linux-gnu`, `-l${vscodeSysroot}/lib/s390x-linux-gnu`); + break; } diff --git a/build/linux/debian/calculate-deps.ts b/build/linux/debian/calculate-deps.ts -index c44e241..5a6e9b4 100644 +index 88ee2f0..8037cf2 100644 --- a/build/linux/debian/calculate-deps.ts +++ b/build/linux/debian/calculate-deps.ts @@ -73,2 +73,8 @@ function calculatePackageDeps(binaryPath: string, arch: DebianArchString, chromi @@ -90,7 +90,7 @@ index c44e241..5a6e9b4 100644 + break; } diff --git a/build/linux/debian/dep-lists.js b/build/linux/debian/dep-lists.js -index 306d91e..64377e3 100644 +index 4ccdcd9..ad00020 100644 --- a/build/linux/debian/dep-lists.js +++ b/build/linux/debian/dep-lists.js @@ -218,2 +218,42 @@ exports.referenceGeneratedDepsByArch = { @@ -137,7 +137,7 @@ index 306d91e..64377e3 100644 + ], }; diff --git a/build/linux/debian/dep-lists.ts b/build/linux/debian/dep-lists.ts -index 9f29943..aa769ad 100644 +index b765492..f7edfda 100644 --- a/build/linux/debian/dep-lists.ts +++ b/build/linux/debian/dep-lists.ts @@ -218,2 +218,42 @@ export const referenceGeneratedDepsByArch = { @@ -184,10 +184,10 @@ index 9f29943..aa769ad 100644 + ], }; diff --git a/build/linux/debian/install-sysroot.js b/build/linux/debian/install-sysroot.js -index 2cd8f2d..aef739c 100644 +index fc2817a..735e42d 100644 --- a/build/linux/debian/install-sysroot.js +++ b/build/linux/debian/install-sysroot.js -@@ -145,2 +145,6 @@ async function getVSCodeSysroot(arch) { +@@ -148,2 +148,6 @@ async function getVSCodeSysroot(arch) { break; + case 's390x': + expectedName = `s390x-linux-gnu${prefix}.tar.gz`; @@ -195,7 +195,7 @@ index 2cd8f2d..aef739c 100644 + break; } diff --git a/build/linux/debian/install-sysroot.ts b/build/linux/debian/install-sysroot.ts -index d8de38e..53b4866 100644 +index 50c28b2..aa30cee 100644 --- a/build/linux/debian/install-sysroot.ts +++ b/build/linux/debian/install-sysroot.ts @@ -162,2 +162,6 @@ export async function getVSCodeSysroot(arch: DebianArchString): Promise @@ -206,7 +206,7 @@ index d8de38e..53b4866 100644 + break; } diff --git a/build/linux/debian/types.js b/build/linux/debian/types.js -index ce21d50..2c56b9c 100644 +index cadefc2..8132812 100644 --- a/build/linux/debian/types.js +++ b/build/linux/debian/types.js @@ -8,3 +8,3 @@ exports.isDebianArchString = isDebianArchString; @@ -215,7 +215,7 @@ index ce21d50..2c56b9c 100644 + return ['amd64', 'armhf', 'arm64', 'ppc64el', 'riscv64', 's390x'].includes(s); } diff --git a/build/linux/debian/types.ts b/build/linux/debian/types.ts -index e97485e..43f2434 100644 +index 24fe452..9efba5b 100644 --- a/build/linux/debian/types.ts +++ b/build/linux/debian/types.ts @@ -5,6 +5,6 @@ @@ -228,10 +228,10 @@ index e97485e..43f2434 100644 + return ['amd64', 'armhf', 'arm64', 'ppc64el', 'riscv64', 's390x'].includes(s); } diff --git a/build/linux/rpm/dep-lists.ts b/build/linux/rpm/dep-lists.ts -index 8761e40..1885210 100644 +index c6d7761..74c58e0 100644 --- a/build/linux/rpm/dep-lists.ts +++ b/build/linux/rpm/dep-lists.ts -@@ -409,2 +409,102 @@ export const referenceGeneratedDepsByArch = { +@@ -413,2 +413,102 @@ export const referenceGeneratedDepsByArch = { 'xdg-utils' + ], + "s390x": [ @@ -335,7 +335,7 @@ index 8761e40..1885210 100644 + 'xdg-utils' ] diff --git a/build/linux/rpm/types.js b/build/linux/rpm/types.js -index a20b9c2..7b58961 100644 +index 99a8cff..e2f3548 100644 --- a/build/linux/rpm/types.js +++ b/build/linux/rpm/types.js @@ -8,3 +8,3 @@ exports.isRpmArchString = isRpmArchString; @@ -344,7 +344,7 @@ index a20b9c2..7b58961 100644 + return ['x86_64', 'armv7hl', 'aarch64', 'ppc64le', 'riscv64', 's390x'].includes(s); } diff --git a/build/linux/rpm/types.ts b/build/linux/rpm/types.ts -index c6a01da..3f3c3f5 100644 +index d94537e..3834b94 100644 --- a/build/linux/rpm/types.ts +++ b/build/linux/rpm/types.ts @@ -5,6 +5,6 @@ @@ -356,75 +356,37 @@ index c6a01da..3f3c3f5 100644 - return ['x86_64', 'armv7hl', 'aarch64', 'ppc64le', 'riscv64'].includes(s); + return ['x86_64', 'armv7hl', 'aarch64', 'ppc64le', 'riscv64', 's390x'].includes(s); } -diff --git a/cli/src/update_service.rs b/cli/src/update_service.rs -index 9033914..bcab676 100644 ---- a/cli/src/update_service.rs -+++ b/cli/src/update_service.rs -@@ -221,2 +221,3 @@ pub enum Platform { - LinuxLoong64, -+ LinuxS390X, - DarwinX64, -@@ -237,2 +238,3 @@ impl Platform { - Platform::LinuxLoong64 => Some("linux-loong64".to_owned()), -+ Platform::LinuxS390X => Some("linux-s390x".to_owned()), - Platform::DarwinX64 => Some("darwin".to_owned()), -@@ -259,2 +261,3 @@ impl Platform { - Platform::LinuxLoong64 => "server-linux-loong64", -+ Platform::LinuxS390X => "server-linux-s390x", - Platform::DarwinX64 => "server-darwin", -@@ -282,2 +285,3 @@ impl Platform { - Platform::LinuxLoong64 => "cli-linux-loong64", -+ Platform::LinuxS390X => "cli-linux-s390x", - Platform::DarwinX64 => "cli-darwin-x64", -@@ -320,2 +324,4 @@ impl Platform { - Some(Platform::LinuxLoong64) -+ } else if cfg!(all(target_os = "linux", target_arch = "s390x")) { -+ Some(Platform::LinuxS390X) - } else if cfg!(all(target_os = "macos", target_arch = "x86_64")) { -@@ -351,2 +357,3 @@ impl fmt::Display for Platform { - Platform::LinuxLoong64 => "LinuxLoong64", -+ Platform::LinuxS390X => "LinuxRISCV64", - Platform::DarwinX64 => "DarwinX64", -diff --git a/cli/src/util/prereqs.rs b/cli/src/util/prereqs.rs -index e0fba27..4827a47 100644 ---- a/cli/src/util/prereqs.rs -+++ b/cli/src/util/prereqs.rs -@@ -92,2 +92,4 @@ impl PreReqChecker { - Platform::LinuxLoong64 -+ } else if cfg!(target_arch = "s390x") { -+ Platform::LinuxS390X - } else { diff --git a/resources/server/bin/helpers/check-requirements-linux.sh b/resources/server/bin/helpers/check-requirements-linux.sh -index 8ef07a2..00dd3e2 100644 +index 0b7aa4e..e8b7ce0 100644 --- a/resources/server/bin/helpers/check-requirements-linux.sh +++ b/resources/server/bin/helpers/check-requirements-linux.sh -@@ -59,2 +59,3 @@ case $ARCH in +@@ -58,2 +58,3 @@ case $ARCH in loongarch64) LDCONFIG_ARCH="double-float";; + s390x) LDCONFIG_ARCH="64bit";; esac diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts -index ea7b30d..004df84 100644 +index 1a0decd..e657203 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagement.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts -@@ -44,2 +44,3 @@ export function TargetPlatformToString(targetPlatform: TargetPlatform) { +@@ -47,2 +47,3 @@ export function TargetPlatformToString(targetPlatform: TargetPlatform) { case TargetPlatform.LINUX_LOONG64: return 'Linux Loong64'; + case TargetPlatform.LINUX_S390X: return 'Linux S390X'; -@@ -70,2 +71,3 @@ export function toTargetPlatform(targetPlatform: string): TargetPlatform { +@@ -73,2 +74,3 @@ export function toTargetPlatform(targetPlatform: string): TargetPlatform { case TargetPlatform.LINUX_LOONG64: return TargetPlatform.LINUX_LOONG64; + case TargetPlatform.LINUX_S390X: return TargetPlatform.LINUX_S390X; -@@ -114,2 +116,5 @@ export function getTargetPlatform(platform: Platform | 'alpine', arch: string | +@@ -117,2 +119,5 @@ export function getTargetPlatform(platform: Platform | 'alpine', arch: string | } + if (arch === 's390x') { + return TargetPlatform.LINUX_S390X; + } return TargetPlatform.UNKNOWN; diff --git a/src/vs/platform/extensions/common/extensions.ts b/src/vs/platform/extensions/common/extensions.ts -index 5973d4d..a7d6298 100644 +index 3eb0412..4b5b29b 100644 --- a/src/vs/platform/extensions/common/extensions.ts +++ b/src/vs/platform/extensions/common/extensions.ts -@@ -297,2 +297,3 @@ export const enum TargetPlatform { +@@ -322,2 +322,3 @@ export const enum TargetPlatform { LINUX_LOONG64 = 'linux-loong64', + LINUX_S390X = 'linux-s390x', diff --git a/prepare_vscode.sh b/prepare_vscode.sh index 2747414..4a9027b 100755 --- a/prepare_vscode.sh +++ b/prepare_vscode.sh @@ -133,7 +133,12 @@ setpath "product" "twitterUrl" "https://go.microsoft.com/fwlink/?LinkID=533687" if [[ "${DISABLE_UPDATE}" != "yes" ]]; then setpath "product" "updateUrl" "https://raw.githubusercontent.com/VSCodium/versions/refs/heads/master" - setpath "product" "downloadUrl" "https://github.com/VSCodium/vscodium/releases" + + if [[ "${VSCODE_QUALITY}" == "insider" ]]; then + setpath "product" "downloadUrl" "https://github.com/VSCodium/vscodium-insiders/releases" + else + setpath "product" "downloadUrl" "https://github.com/VSCodium/vscodium/releases" + fi fi if [[ "${VSCODE_QUALITY}" == "insider" ]]; then @@ -159,6 +164,9 @@ if [[ "${VSCODE_QUALITY}" == "insider" ]]; then setpath "product" "win32UserAppId" "{{ED2E5618-3E7E-4888-BF3C-A6CCC84F586F}" setpath "product" "win32x64UserAppId" "{{20F79D0D-A9AC-4220-9A81-CE675FFB6B41}" setpath "product" "win32arm64UserAppId" "{{2E362F92-14EA-455A-9ABD-3E656BBBFE71}" + setpath "product" "tunnelApplicationName" "codium-tunnel-insiders" + setpath "product" "win32TunnelServiceMutex" "vscodiuminsiders-tunnelservice" + setpath "product" "win32TunnelMutex" "vscodiuminsiders-tunnel" else setpath "product" "nameShort" "VSCodium" setpath "product" "nameLong" "VSCodium" @@ -181,6 +189,9 @@ else setpath "product" "win32UserAppId" "{{0FD05EB4-651E-4E78-A062-515204B47A3A}" setpath "product" "win32x64UserAppId" "{{2E1F05D1-C245-4562-81EE-28188DB6FD17}" setpath "product" "win32arm64UserAppId" "{{57FD70A5-1B8D-4875-9F40-C5553F094828}" + setpath "product" "tunnelApplicationName" "codium-tunnel" + setpath "product" "win32TunnelServiceMutex" "vscodium-tunnelservice" + setpath "product" "win32TunnelMutex" "vscodium-tunnel" fi jsonTmp=$( jq -s '.[0] * .[1]' product.json ../product.json )