forked from VSCodium/vscodium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: loong64 support for reh server (VSCodium#2087)
- Loading branch information
Showing
10 changed files
with
179 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js | ||
index df4fda0c898..ce8f21bbc0e 100644 | ||
--- a/build/gulpfile.reh.js | ||
+++ b/build/gulpfile.reh.js | ||
@@ -52,2 +52,3 @@ const BUILD_TARGETS = [ | ||
{ platform: 'linux', arch: 'riscv64' }, | ||
+ { platform: 'linux', arch: 'loong64' }, | ||
{ platform: 'alpine', arch: 'arm64' }, | ||
diff --git a/build/gulpfile.scan.js b/build/gulpfile.scan.js | ||
index 0eafadc1fff..3c1d6fb5bfc 100644 | ||
--- a/build/gulpfile.scan.js | ||
+++ b/build/gulpfile.scan.js | ||
@@ -28,2 +28,3 @@ const BUILD_TARGETS = [ | ||
{ platform: 'linux', arch: 'riscv64' }, | ||
+ { platform: 'linux', arch: 'loong64' }, | ||
]; | ||
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js | ||
index b208d700f2c..4be8f93f704 100644 | ||
--- a/build/gulpfile.vscode.js | ||
+++ b/build/gulpfile.vscode.js | ||
@@ -489,2 +489,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 | ||
--- a/cli/src/update_service.rs | ||
+++ b/cli/src/update_service.rs | ||
@@ -220,2 +220,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 { | ||
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 { | ||
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 | ||
--- a/cli/src/util/prereqs.rs | ||
+++ b/cli/src/util/prereqs.rs | ||
@@ -90,2 +90,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 | ||
--- 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 | ||
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 | ||
--- 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) { | ||
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 { | ||
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 | | ||
} | ||
+ 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 | ||
--- a/src/vs/platform/extensions/common/extensions.ts | ||
+++ b/src/vs/platform/extensions/common/extensions.ts | ||
@@ -296,2 +296,3 @@ export const enum TargetPlatform { | ||
LINUX_RISCV64 = 'linux-riscv64', | ||
+ LINUX_LOONG64 = 'linux-loong64', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js | ||
index d45d5bc..81a6449 100644 | ||
index 88e3c9e..4cad4f1 100644 | ||
--- a/build/npm/postinstall.js | ||
+++ b/build/npm/postinstall.js | ||
@@ -56,3 +56,3 @@ function yarnInstall(dir, opts) { | ||
@@ -55,4 +55,6 @@ function npmInstall(dir, opts) { | ||
opts.cwd = root; | ||
- if (process.env['npm_config_arch'] === 'arm64') { | ||
+ if (process.env['npm_config_arch'] === 'arm64' || process.env['npm_config_arch'] === 'arm' || process.env['npm_config_arch'] === 'ppc64' || process.env['npm_config_arch'] === 'riscv64') { | ||
run('sudo', ['docker', 'run', '--rm', '--privileged', 'multiarch/qemu-user-static', '--reset', '-p', 'yes'], opts); | ||
+ } else if (process.env['npm_config_arch'] === 'loong64') { | ||
+ run('sudo', ['docker', 'run', '--rm', '--privileged', 'loongcr.lcpu.dev/multiarch/archlinux', '--reset', '-p', 'yes'], opts); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# When installing @vscode/ripgrep, it will try to download prebuilt ripgrep binary from https://github.com/microsoft/ripgrep-prebuilt, | ||
# however, loong64 is not a supported architecture and x86 will be picked as fallback, so we need to replace it with a native one. | ||
|
||
RG_PATH="node_modules/@vscode/ripgrep/bin/rg" | ||
RG_VERSION="14.1.1" | ||
|
||
echo "Replacing ripgrep binary with loong64 one" | ||
|
||
rm "${RG_PATH}" | ||
curl --silent --fail -L https://github.com/darkyzhou/ripgrep-loongarch64-musl/releases/download/${RG_VERSION}/rg -o "${RG_PATH}" | ||
chmod +x "${RG_PATH}" |