rust-lang / rust-lang/rust-analyzer

Rust launch profile fails to autogenerate correctly when vscode installed via snap

Open
#15,929 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Type: Bug

Context: Ubuntu 22.04

  1. Install VSCode via snap following the instructions on https://code.visualstudio.com/docs/setup/linux
  2. Install rust-analyzer and CodeLLDB extensions
  3. Create a new Rust project following https://code.visualstudio.com/docs/languages/rust#_hello-world
  4. Attempt to Follow steps under https://code.visualstudio.com/docs/languages/rust#_using-rust-analyzer-debug
    4.1 On debug, there is no launch config, you are prompted to create one via CodeLLDB
    4.2 The launch config fails with a cryptic error message (error code 101). On examination, the profile in launch.json seems incomplete.

Workaround steps:

  1. Uninstall VS Code snap (sudo snap remove code)
  2. Install VS Code via deb following the instructions on https://code.visualstudio.com/docs/setup/linux
  3. Open up launch.json, delete the broken launch config
  4. Follow steps under "Using Rust Analyzer: Debug"
  5. This time, a different dialog appears offering to autogenerate a launch config from Cargo.toml. A very different launch config is created; it works.

Extension version: 0.3.1730
VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:50:47.800Z)
OS version: Linux x64 5.15.0-88-generic
Modes:

System Info
Item Value
CPUs AMD Ryzen 5 3400G with Radeon Vega Graphics (8 x 3700)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 0, 1, 1
Memory (System) 29.31GB (25.90GB free)
Process Argv . --crash-reporter-id f523a7ce-b33f-4dac-be74-dc7611b22e53
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE wayland
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30880072
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
f6dab269:30613381
showlangstatbar:30737416
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
welcomedialog:30887143
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
synctok:30869157
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixt:30871694
pythonregdiag2:30871582
pyreplss2:30886141
pythonmypyd1:30879173
pythoncet0:30885854
2e7ec940:30885897
pythontbext0:30879054
accentitlementst:30887150
dsvsc016cf:30886111
dsvsc017:30886112
dsvsc018:30886114
aa_t_chat:30882232

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue on Ubuntu 22.04 with the VS Code snap, rust-analyzer, and CodeLLDB, then compare the generated launch.json with the working configuration from a deb installation. Done means the snap installation autogenerates a complete launch.json from Cargo.toml that debugs the Rust project successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.