aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/toolchain.ts
diff options
context:
space:
mode:
authorvsrs <[email protected]>2021-04-22 16:30:44 +0100
committervsrs <[email protected]>2021-04-22 16:59:03 +0100
commit1b4197cb3520e4a71f118aac61a83bab1a6f5931 (patch)
tree15e7b0a8d56b2796b1b3c1d70ad920acd2ad77e9 /editors/code/src/toolchain.ts
parent1ebfe11730191e914dcf20297cdfdac5b7c297fc (diff)
Use explicit rustc commit-hash
Required for lldb on mac
Diffstat (limited to 'editors/code/src/toolchain.ts')
-rw-r--r--editors/code/src/toolchain.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/editors/code/src/toolchain.ts b/editors/code/src/toolchain.ts
index 5725bcafe..68826c478 100644
--- a/editors/code/src/toolchain.ts
+++ b/editors/code/src/toolchain.ts
@@ -129,6 +129,16 @@ export function getSysroot(dir: string): Promise<string> {
129 return execute(`${rustcPath} --print sysroot`, { cwd: dir }); 129 return execute(`${rustcPath} --print sysroot`, { cwd: dir });
130} 130}
131 131
132export async function getRustcId(dir: string): Promise<string> {
133 const rustcPath = getPathForExecutable("rustc");
134
135 // do not memoize the result because the toolchain may change between runs
136 const data = await execute(`${rustcPath} -V -v`, { cwd: dir });
137 const rx = /commit-hash:\s(.*)$/m.compile();
138
139 return rx.exec(data)![1];
140}
141
132/** Mirrors `toolchain::cargo()` implementation */ 142/** Mirrors `toolchain::cargo()` implementation */
133export function cargoPath(): string { 143export function cargoPath(): string {
134 return getPathForExecutable("cargo"); 144 return getPathForExecutable("cargo");