mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Use explicit rustc commit-hash
Required for lldb on mac
This commit is contained in:
parent
1ebfe11730
commit
1b4197cb35
3 changed files with 15 additions and 3 deletions
|
@ -129,6 +129,16 @@ export function getSysroot(dir: string): Promise<string> {
|
|||
return execute(`${rustcPath} --print sysroot`, { cwd: dir });
|
||||
}
|
||||
|
||||
export async function getRustcId(dir: string): Promise<string> {
|
||||
const rustcPath = getPathForExecutable("rustc");
|
||||
|
||||
// do not memoize the result because the toolchain may change between runs
|
||||
const data = await execute(`${rustcPath} -V -v`, { cwd: dir });
|
||||
const rx = /commit-hash:\s(.*)$/m.compile();
|
||||
|
||||
return rx.exec(data)![1];
|
||||
}
|
||||
|
||||
/** Mirrors `toolchain::cargo()` implementation */
|
||||
export function cargoPath(): string {
|
||||
return getPathForExecutable("cargo");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue