rust-analyzer
rust-analyzer copied to clipboard
Bootstrap error
rust-analyzer version: 2b472f668 2022-07-31
rustc version: 1.62.1
below are details:
INFO [8/12/2022, 11:37:55 AM]: Extension version: 0.4.1157
INFO [8/12/2022, 11:37:55 AM]: Using configuration {
cargoRunner: null,
runnableEnv: null,
server: { path: null, extraEnv: null },
trace: { server: 'off', extension: false },
debug: {
engine: 'auto',
sourceFileMap: {
'/rustc/<id>': '${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust'
},
openDebugPane: false,
engineSettings: {}
},
restartServerOnConfigChange: false,
typing: {
continueCommentsOnNewline: true,
autoClosingAngleBrackets: { enable: false }
},
assist: { expressionFillDefault: 'todo' },
cachePriming: { enable: true, numThreads: 0 },
cargo: {
autoreload: true,
buildScripts: { enable: true, overrideCommand: null, useRustcWrapper: true },
features: [],
noDefaultFeatures: false,
noSysroot: false,
target: null,
unsetTest: [ 'core' ]
},
checkOnSave: {
allTargets: true,
command: 'check',
enable: true,
extraArgs: [],
features: null,
noDefaultFeatures: null,
overrideCommand: null,
target: null
},
completion: {
autoimport: { enable: true },
autoself: { enable: true },
callable: { snippets: 'fill_arguments' },
postfix: { enable: true },
privateEditable: { enable: false },
snippets: {
custom: {
'Arc::new': {
postfix: 'arc',
body: 'Arc::new(${receiver})',
requires: 'std::sync::Arc',
description: 'Put the expression into an `Arc`',
scope: 'expr'
},
'Rc::new': {
postfix: 'rc',
body: 'Rc::new(${receiver})',
requires: 'std::rc::Rc',
description: 'Put the expression into an `Rc`',
scope: 'expr'
},
'Box::pin': {
postfix: 'pinbox',
body: 'Box::pin(${receiver})',
requires: 'std::boxed::Box',
description: 'Put the expression into a pinned `Box`',
scope: 'expr'
},
Ok: {
postfix: 'ok',
body: 'Ok(${receiver})',
description: 'Wrap the expression in a `Result::Ok`',
scope: 'expr'
},
Err: {
postfix: 'err',
body: 'Err(${receiver})',
description: 'Wrap the expression in a `Result::Err`',
scope: 'expr'
},
Some: {
postfix: 'some',
body: 'Some(${receiver})',
description: 'Wrap the expression in an `Option::Some`',
scope: 'expr'
}
}
}
},
diagnostics: {
disabled: [],
enable: true,
experimental: { enable: false },
remapPrefix: {},
warningsAsHint: [],
warningsAsInfo: []
},
files: { excludeDirs: [], watcher: 'server' },
highlightRelated: {
breakPoints: { enable: true },
exitPoints: { enable: true },
references: { enable: true },
yieldPoints: { enable: true }
},
hover: {
actions: {
debug: { enable: true },
enable: true,
gotoTypeDef: { enable: true },
implementations: { enable: true },
references: { enable: false },
run: { enable: true }
},
documentation: { enable: true },
links: { enable: true }
},
imports: {
granularity: { enforce: false, group: 'crate' },
group: { enable: true },
merge: { glob: true },
prefix: 'plain'
},
inlayHints: {
bindingModeHints: { enable: false },
chainingHints: { enable: true },
closingBraceHints: { enable: true, minLines: 25 },
closureReturnTypeHints: { enable: 'never' },
lifetimeElisionHints: { enable: 'never', useParameterNames: false },
maxLength: 25,
parameterHints: { enable: true },
reborrowHints: { enable: 'never' },
renderColons: true,
typeHints: {
enable: true,
hideClosureInitialization: false,
hideNamedConstructor: false
}
},
joinLines: {
joinAssignments: true,
joinElseIf: true,
removeTrailingComma: true,
unwrapTrivialBlock: true
},
lens: {
debug: { enable: true },
enable: true,
forceCustomCommands: true,
implementations: { enable: true },
references: {
adt: { enable: false },
enumVariant: { enable: false },
method: { enable: false },
trait: { enable: false }
},
run: { enable: true }
},
linkedProjects: [],
lru: { capacity: null },
notifications: { cargoTomlNotFound: true },
procMacro: {
attributes: { enable: true },
enable: true,
ignored: {},
server: null
},
runnables: { command: null, extraArgs: [] },
rustc: { source: null },
rustfmt: {
extraArgs: [],
overrideCommand: null,
rangeFormatting: { enable: false }
},
semanticHighlighting: { strings: { enable: true } },
signatureInfo: { detail: 'full', documentation: { enable: true } },
workspace: {
symbol: { search: { kind: 'only_types', limit: 128, scope: 'workspace' } }
}
}
INFO [8/12/2022, 11:37:55 AM]: PersistentState: { serverVersion: '0.3.1162' }
INFO [8/12/2022, 11:37:55 AM]: Using server binary at ~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/server/rust-analyzer
WARN [8/12/2022, 11:37:55 AM]: ~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/server/rust-analyzer --version: {
error: [Error: spawnSync ~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/server/rust-analyzer Unknown system error -8
at Object.spawnSync (node:internal/child_process:1083:20)
at spawnSync (node:child_process:832:24)
at rm (~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/out/main.js:39:60071)
at OS (~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/out/main.js:85:2047)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async xS (~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/out/main.js:84:1060)
at async dv (~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/out/main.js:84:891)
at async b._activate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:8180)
at async b._waitForDepsThenActivate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:8122)
at async b._initialize (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:7486)] {
errno: -8,
code: 'Unknown system error -8',
syscall: 'spawnSync ~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/server/rust-analyzer',
path: '~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/server/rust-analyzer',
spawnargs: [ '--version' ]
},
status: null,
signal: null,
output: null,
pid: 0,
stdout: null,
stderr: null
}
ERROR [8/12/2022, 11:37:55 AM]: Bootstrap error [Error: Failed to execute ~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/server/rust-analyzer --version
at OS (~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/out/main.js:85:2289)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async xS (~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/out/main.js:84:1060)
at async dv (~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/out/main.js:84:891)
at async b._activate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:8180)
at async b._waitForDepsThenActivate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:8122)
at async b._initialize (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:7486)]
INFO [8/12/2022, 11:38:32 AM]: Extension version: 0.4.1157
INFO [8/12/2022, 11:38:32 AM]: Using configuration {
cargoRunner: null,
runnableEnv: null,
server: { path: null, extraEnv: null },
trace: { server: 'off', extension: false },
debug: {
engine: 'auto',
sourceFileMap: {
'/rustc/<id>': '${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust'
},
openDebugPane: false,
engineSettings: {}
},
restartServerOnConfigChange: false,
typing: {
continueCommentsOnNewline: true,
autoClosingAngleBrackets: { enable: false }
},
assist: { expressionFillDefault: 'todo' },
cachePriming: { enable: true, numThreads: 0 },
cargo: {
autoreload: true,
buildScripts: { enable: true, overrideCommand: null, useRustcWrapper: true },
features: [],
noDefaultFeatures: false,
noSysroot: false,
target: null,
unsetTest: [ 'core' ]
},
checkOnSave: {
allTargets: true,
command: 'check',
enable: true,
extraArgs: [],
features: null,
noDefaultFeatures: null,
overrideCommand: null,
target: null
},
completion: {
autoimport: { enable: true },
autoself: { enable: true },
callable: { snippets: 'fill_arguments' },
postfix: { enable: true },
privateEditable: { enable: false },
snippets: {
custom: {
'Arc::new': {
postfix: 'arc',
body: 'Arc::new(${receiver})',
requires: 'std::sync::Arc',
description: 'Put the expression into an `Arc`',
scope: 'expr'
},
'Rc::new': {
postfix: 'rc',
body: 'Rc::new(${receiver})',
requires: 'std::rc::Rc',
description: 'Put the expression into an `Rc`',
scope: 'expr'
},
'Box::pin': {
postfix: 'pinbox',
body: 'Box::pin(${receiver})',
requires: 'std::boxed::Box',
description: 'Put the expression into a pinned `Box`',
scope: 'expr'
},
Ok: {
postfix: 'ok',
body: 'Ok(${receiver})',
description: 'Wrap the expression in a `Result::Ok`',
scope: 'expr'
},
Err: {
postfix: 'err',
body: 'Err(${receiver})',
description: 'Wrap the expression in a `Result::Err`',
scope: 'expr'
},
Some: {
postfix: 'some',
body: 'Some(${receiver})',
description: 'Wrap the expression in an `Option::Some`',
scope: 'expr'
}
}
}
},
diagnostics: {
disabled: [],
enable: true,
experimental: { enable: false },
remapPrefix: {},
warningsAsHint: [],
warningsAsInfo: []
},
files: { excludeDirs: [], watcher: 'server' },
highlightRelated: {
breakPoints: { enable: true },
exitPoints: { enable: true },
references: { enable: true },
yieldPoints: { enable: true }
},
hover: {
actions: {
debug: { enable: true },
enable: true,
gotoTypeDef: { enable: true },
implementations: { enable: true },
references: { enable: false },
run: { enable: true }
},
documentation: { enable: true },
links: { enable: true }
},
imports: {
granularity: { enforce: false, group: 'crate' },
group: { enable: true },
merge: { glob: true },
prefix: 'plain'
},
inlayHints: {
bindingModeHints: { enable: false },
chainingHints: { enable: true },
closingBraceHints: { enable: true, minLines: 25 },
closureReturnTypeHints: { enable: 'never' },
lifetimeElisionHints: { enable: 'never', useParameterNames: false },
maxLength: 25,
parameterHints: { enable: true },
reborrowHints: { enable: 'never' },
renderColons: true,
typeHints: {
enable: true,
hideClosureInitialization: false,
hideNamedConstructor: false
}
},
joinLines: {
joinAssignments: true,
joinElseIf: true,
removeTrailingComma: true,
unwrapTrivialBlock: true
},
lens: {
debug: { enable: true },
enable: true,
forceCustomCommands: true,
implementations: { enable: true },
references: {
adt: { enable: false },
enumVariant: { enable: false },
method: { enable: false },
trait: { enable: false }
},
run: { enable: true }
},
linkedProjects: [],
lru: { capacity: null },
notifications: { cargoTomlNotFound: true },
procMacro: {
attributes: { enable: true },
enable: true,
ignored: {},
server: null
},
runnables: { command: null, extraArgs: [] },
rustc: { source: null },
rustfmt: {
extraArgs: [],
overrideCommand: null,
rangeFormatting: { enable: false }
},
semanticHighlighting: { strings: { enable: true } },
signatureInfo: { detail: 'full', documentation: { enable: true } },
workspace: {
symbol: { search: { kind: 'only_types', limit: 128, scope: 'workspace' } }
}
}
What platform are you on? Does running ~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/server/rust-analyzer work, and can you provide a hash (sha256sum or whatever) for that file?
8 is ENOEXEC (Exec format error).
What platform are you on? Does running
~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/server/rust-analyzerwork, and can you provide a hash (sha256sumor whatever) for that file?
8isENOEXEC (Exec format error).
Thank you for your reply, and my computer processor is m1 pro. After reinstalling the rust-analyzer, I can use it normally, but after reopening the project several times, the same error occurs again.
shasum -a 256 rust-analyzer
2641af3bd0d9a7d7f12169ef01a307d360d85e8cd01ac00a63377f77146281d3 rust-analyzer
Extension version: 0.3.1162
Extension version: 0.3.1162
Yeah, that's a bit weird. The logs say 0.4.1157, but that's a pre-release version. The latest release is 0.3.1162. So it's as if it you switched from release to pre-release without reloading the Code Window. What do you see here and do you have a "Reload window" button?

Anyway, I downloaded https://marketplace.visualstudio.com/_apis/public/gallery/publishers/rust-lang/vsextensions/rust-analyzer/0.4.1157/vspackage?targetPlatform=darwin-arm64, https://marketplace.visualstudio.com/_apis/public/gallery/publishers/rust-lang/vsextensions/rust-analyzer/0.4.1157/vspackage?targetPlatform=darwin-x64 and the other two, and I get the following hashes:
# 0.4.1157
0fa5b94a09daf30ac2cd8161218348427817a42ac07e1e95c98c4d68477089b6 darwin-arm64
4e08f756eb72d7fc052c3d2efbf2fed20ddc03823a69b5df10b787831c9ca11d darwin-x64
# 0.3.1162
2641af3bd0d9a7d7f12169ef01a307d360d85e8cd01ac00a63377f77146281d3 darwin-arm64
f12c9eff3f92d86e46b0e4e066910e291f95fc98b3b7a8ab46ee243ed35071e2 darwin-x64
So you are indeed running the correct version (darwin-arm64 0.3.1162).
But I don't know why Code would switch to the pre-release version, why ~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1157/server/rust-analyzer is a 0.3.1162 binary (according to the hash), or why is would pick a version that doesn't run (I suppose the hash changes at that point).
Maybe try uninstalling the extension, then removing anything related to it from ~/.vscode/extensions.
Also, what version of Code are you running? (you can post a screenshot of Help / About)
Closing as this doesn't seem actionable (and no acitvity from OP)