Skip to content

Commit 94f661c

Browse files
bors[bot]lnicola
andauthored
Merge #7001
7001: Add support for downloading aarch64-apple-darwin binaries r=matklad a=lnicola There's also a slight behavior change here: we no longer download our 64-binaries on 32-bit Darwin and Linux. We still do that on Windows, as I don't know how to detect 32-bit Node on 64 Windows. But some people install the 32-bit Code by mistake, I doubt 32-bit Windows is that popular in the Rust crowd. Co-authored-by: Laurențiu Nicola <[email protected]>
2 parents b28322e + 5ff576f commit 94f661c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

editors/code/src/main.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,14 @@ async function getServer(config: Config, state: PersistentState): Promise<string
287287
if (config.package.releaseTag === null) return "rust-analyzer";
288288

289289
let platform: string | undefined;
290-
if (process.arch === "x64" || process.arch === "ia32") {
291-
if (process.platform === "linux") platform = "linux";
292-
if (process.platform === "darwin") platform = "mac";
293-
if (process.platform === "win32") platform = "windows";
290+
if ((process.arch === "x64" || process.arch === "ia32") && process.platform === "win32") {
291+
platform = "x86_64-pc-windows-msvc";
292+
} else if (process.arch === "x64" && process.platform === "linux") {
293+
platform = "x86_64-unknown-linux-gnu";
294+
} else if (process.arch === "x64" && process.platform === "darwin") {
295+
platform = "x86_64-apple-darwin";
294296
} else if (process.arch === "arm64" && process.platform === "darwin") {
295-
platform = "mac";
297+
platform = "aarch64-apple-darwin";
296298
}
297299
if (platform === undefined) {
298300
vscode.window.showErrorMessage(
@@ -305,7 +307,7 @@ async function getServer(config: Config, state: PersistentState): Promise<string
305307
);
306308
return undefined;
307309
}
308-
const ext = platform === "windows" ? ".exe" : "";
310+
const ext = platform.indexOf("-windows-") !== -1 ? ".exe" : "";
309311
const dest = path.join(config.globalStoragePath, `rust-analyzer-${platform}${ext}`);
310312
const exists = await fs.stat(dest).then(() => true, () => false);
311313
if (!exists) {

0 commit comments

Comments
 (0)