Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio code - lldb debugging rust, change the project directory

Hi I have the following state:

The cargo rust project: /Users/daniel1302/www/aws-alarm/ The workspace dir: `/Users/daniel1302/www

I have the following debugging configuration:

{
            "type": "lldb",
            "request": "launch",
            "name": "rust/aws-alarm",
            "cwd": "/Users/daniel1302/www/aws-alarm/",
            "cargo": {
                "args": [
                    "build",
                    "--lib"
                ],
            },
            "program": "${cargo:program}",
            "args": [],
            "env": {
                "AWS_PROFILE": "sf_MFA",
                "AWS_REGION": "us-east-1"
            },
        }

When I am starting the project debugging I can see:

Running `cargo build --lib --message-format=json`...
error: could not find `Cargo.toml` in `/Users/daniel1302/www/releases` or any parent directory

The issue is, that cwd directive does not change the project directory.

Do you know How can I change the cargo project directory?

like image 301
Daniel Hornik Avatar asked Jun 21 '26 16:06

Daniel Hornik


1 Answers

I have found workaround by setting cargo arg --manifest-path:

"configurations": [
{
...
    "cargo": {
        "args": [
           "build",
           "--bin=importer",
           "--package=cprices",
           "--manifest-path=${workspaceFolder}/cprices/Cargo.toml"
        ],
...
like image 193
Airenas Avatar answered Jun 23 '26 06:06

Airenas