Failed to install rust-analyzer on codium

I am trying to install rust-analyzer on codium (ubuntu 20.04)
When I go to the extension store and click on install, the extension install then throw an error :
Cannot activate rust-analyzer: bootstrap error. See the logs in "OUTPUT > Rust Analyzer Client" (should open automatically). To enable verbose logs use { "rust-analyzer.trace.extension": true }

Here is the log with verbose output;

INFO [12/26/2021, 10:24:14 AM]: Extension version: 0.2.867
INFO [12/26/2021, 10:24:14 AM]: Using configuration {
  cargoRunner: null,
  runnableEnv: null,
  inlayHints: {
    enable: true,
    smallerHints: true,
    chainingHints: true,
    maxLength: 25,
    parameterHints: true,
    typeHints: true,
    hideNamedConstructorHints: false
  updates: { channel: 'stable', askBeforeDownload: false },
  server: { path: null, extraEnv: null },
  trace: { server: 'off', extension: true },
  debug: {
    engine: 'auto',
    sourceFileMap: {
      '/rustc/<id>': '${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust'
    openDebugPane: false,
    engineSettings: {}
  assist: {
    importGranularity: 'crate',
    importEnforceGranularity: false,
    importPrefix: 'plain',
    importGroup: true,
    allowMergingIntoGlobImports: true
  cache: { warmup: true },
  callInfo: { full: true },
  cargo: {
    autoreload: true,
    allFeatures: false,
    unsetTest: [ 'core' ],
    features: [],
    runBuildScripts: true,
    useRustcWrapperForBuildScripts: true,
    noDefaultFeatures: false,
    target: null,
    noSysroot: false
  checkOnSave: {
    enable: true,
    allFeatures: null,
    allTargets: true,
    command: 'check',
    noDefaultFeatures: null,
    target: null,
    extraArgs: [],
    features: null,
    overrideCommand: null
  completion: {
    addCallArgumentSnippets: true,
    addCallParenthesis: true,
    snippets: {
      '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'
    postfix: { enable: true },
    autoimport: { enable: true },
    autoself: { enable: true }
  diagnostics: {
    enable: true,
    enableExperimental: true,
    disabled: [],
    remapPrefix: {},
    warningsAsHint: [],
    warningsAsInfo: []
  experimental: { procAttrMacros: true },
  files: { watcher: 'client', excludeDirs: [] },
  highlightRelated: {
    references: true,
    exitPoints: true,
    breakPoints: true,
    yieldPoints: true
  highlighting: { strings: true },
  hover: { documentation: true, linksInHover: true },
  hoverActions: {
    debug: true,
    enable: true,
    gotoTypeDef: true,
    implementations: true,
    references: false,
    run: true
  joinLines: {
    joinElseIf: true,
    removeTrailingComma: true,
    unwrapTrivialBlock: true,
    joinAssignments: true
  lens: {
    debug: true,
    enable: true,
    implementations: true,
    run: true,
    methodReferences: false,
    references: false,
    enumVariantReferences: false,
    forceCustomCommands: true
  linkedProjects: [],
  lruCapacity: null,
  notifications: { cargoTomlNotFound: true },
  procMacro: { enable: true, server: null },
  runnables: { overrideCargo: null, cargoExtraArgs: [] },
  rustcSource: null,
  rustfmt: {
    extraArgs: [],
    overrideCommand: null,
    enableRangeFormatting: false
  workspace: { symbol: { search: { scope: 'workspace', kind: 'only_types' } } }
INFO [12/26/2021, 10:24:14 AM]: PersistentState: {
  lastCheck: undefined,
  nightlyReleaseId: undefined,
  serverVersion: '0.2.867'
INFO [12/26/2021, 10:24:15 AM]: Using server binary at /home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer
DEBUG [12/26/2021, 10:24:15 AM]: Checking availability of a binary at /home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer
DEBUG [12/26/2021, 10:24:15 AM]: /home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer --version: {
  error: [Error: spawnSync /home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer ENOENT
  	at Object.spawnSync (internal/child_process.js:1067:20)
  	at spawnSync (child_process.js:611:24)
  	at Yy (/home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:61:4063)
  	at j0 (/home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:109:3790)
  	at processTicksAndRejections (internal/process/task_queues.js:93:5)
  	at async N0 (/home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:109:1881)
  	at async I0 (/home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:108:3977)
  	at async lC (/home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:108:3808)] {
    errno: -2,
    code: 'ENOENT',
    syscall: 'spawnSync /home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer',
    path: '/home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer',
    spawnargs: [ '--version' ]
  status: null,
  signal: null,
  output: null,
  pid: 25839,
  stdout: null,
  stderr: null
ERROR [12/26/2021, 10:24:15 AM]: Bootstrap error [Error: Failed to execute /home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer --version
	at j0 (/home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:109:4032)
	at processTicksAndRejections (internal/process/task_queues.js:93:5)
	at async N0 (/home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:109:1881)
	at async I0 (/home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:108:3977)
	at async lC (/home/rokonio/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:108:3808)]

Rust analyzer recently switched to packaging the language server with the extension itself. For this to work it publishes an extension for each supported platform. Open VSX (which is used by codium in the place of the vscode marketplace) currently doesn't support platform specific extensions. As such you will likely get an extension for the wrong platform. See `Bootstrap error` in VSCodium (Open VSX platform mismatch) · Issue #11080 · rust-analyzer/rust-analyzer · GitHub and Add support for specific platforms · Issue #336 · eclipse/openvsx · GitHub. Until this is fixed you can either download the right version of the extension from Releases · rust-analyzer/rust-analyzer · GitHub or build the language server yourself and set rust-analyzer.serverPath to the right path.

It's my first time using codium (or vscode) so I'm not sure how to download an extension from a file.

I tried to downgrade to version 0.2.853 and it seems to works !

Thanks for the fast response !

You can download the .vsix file for your platform from Releases · rust-analyzer/rust-analyzer · GitHub (ignore the pre-release at the top) The right file is rust-analyzer-linux-x64.vsix. You can then click on the three dots at the top right of the extension sidebar and then use "Install from VSIX...".

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.