Skip to content
The Chat Archive
o1-preview-2024-09-12· OpenAI WildChat-4.8M (AI2)

{ "version": "0.2.0", "configurations": [ { "type": "lldb", "request": "launch", "name":…

  1. User

    { "version": "0.2.0", "configurations": [ { "type": "lldb", "request": "launch", "name": "Dev-CompileRun", "cargo": { "args": ["--manifest-path=./src-tauri/Cargo.toml","build"] }, "preLaunchTask": "ui:dev" }, { "type": "lldb", "request": "launch", "name": "Release-CompileBinary", "cargo": { "args": ["build", "--manifest-path=./src-tauri/Cargo.toml", "--release"] }, "preLaunchTask": "ui:build" }, { "type": "lldb", "request": "launch", "name": "Linux-CrossCompileBinary", "cargo": { "args": [ "build", "--manifest-path=./src-tauri/Cargo.toml", "--target", "x86_64-pc-windows-msvc" ] }, "preLaunchTask": "ui:build-windows-arch" } ] }{ "version": "2.0.0", "tasks": [ { "label": "ui:dev", "type": "shell", "isBackground": true, "command": "cargo tauri", "args": ["dev"] }, { "label": "ui:build", "type": "shell", "command": "NO_STRIP=true cargo tauri", "args": ["build"] }, { "label": "ui:build-windows-arch", "type": "shell", "command": "cargo tauri", "args": [ "build", "--runner", "cargo-xwin", "--target", "x86_64-pc-windows-msvc" ] } ] }Running cargo --manifest-path=./src-tauri/Cargo.toml build --message-format=json... error: unexpected argument '--manifest-path' found

    tip: 'build --manifest-path' exists

    Usage: cargo [+toolchain] [OPTIONS] [COMMAND] cargo [+toolchain] [OPTIONS] -Zscript <MANIFEST_RS> [ARGS]...

    For more information, try '--help'. Error: Cargo invocation failed. at t.Cargo.getCargoArtifacts (/home/caua/.vscode-insiders/extensions/vadimcn.vscode-lldb-1.10.0/extension.js:1:14943) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.open (/home/caua/.vscode-insiders/extensions/vadimcn.vscode-lldb-1.10.0/extension.js:1:13253) Caused by: Error: exit code: 1. at ChildProcess. (/home/caua/.vscode-insiders/extensions/vadimcn.vscode-lldb-1.10.0/extension.js:1:16610) at ChildProcess.emit (node:events:519:28) at maybeClose (node:internal/child_process:1105:16) at ChildProcess._handle.onexit (node:internal/child_process:305:5)

    • The terminal process failed to launch (exit code: 1).
    • Terminal will be reused by tasks, press any key to close it.
  2. Assistant

    The error you're encountering is due to the incorrect placement of the --manifest-path argument in your cargo commands. In Cargo, the --manifest-path option should come after the command (build, run, etc.), not before it. When you place --manifest-path before the command, Cargo doesn't understand it, hence the error:

    error: unexpected argument '--manifest-path' found
    
    tip: 'build --manifest-path' exists
    

    To fix this issue, you need to rearrange the arguments in your launch.json configurations so that build comes before --manifest-path. Here's how you can modify your configurations:

    Updated launch.json:

    {
        "version": "0.2.0",
        "configurations": [
            {
                "type": "lldb",
                "request": "launch",
                "name": "Dev-CompileRun",
                "cargo": {
                    "args": ["build", "--manifest-path=./src-tauri/Cargo.toml"]
                },
                "preLaunchTask": "ui:dev"
            },
            {
                "type": "lldb",
                "request": "launch",
                "name": "Release-CompileBinary",
                "cargo": {
                    "args": ["build", "--manifest-path=./src-tauri/Cargo.toml", "--release"]
                },
                "preLaunchTask": "ui:build"
            },
            {
                "type": "lldb",
                "request": "launch",
                "name": "Linux-CrossCompileBinary",
                "cargo": {
                    "args": [
                        "build",
                        "--manifest-path=./src-tauri/Cargo.toml",
                        "--target",
                        "x86_64-pc-windows-msvc"
                    ]
                },
                "preLaunchTask": "ui:build-windows-arch"
            }
        ]
    }
    

    Explanation:

    • In each configuration, move "build" to be the first argument in the "args" array.
    • --manifest-path and other options are now correctly positioned after the command (build).

    Why This Works:

    In Cargo command syntax, the command (like build, run, etc.) comes immediately after cargo, followed by any options or flags. For example:

    cargo build --manifest-path=./src-tauri/Cargo.toml
    

    By rearranging your arguments, you're aligning with Cargo's expected command structure.

    Additional Notes:

    • Ensure that your tasks.json configurations are correctly set up, but since the error pertains specifically to the Cargo command in launch.json, focusing on rearranging the arguments there should resolve your issue.
    • If you have any custom tasks or dependencies, make sure they don't rely on the old argument order.

    Reference:

    • Cargo Command-Line Reference
    • The error message suggests the correct usage and provides a tip, indicating that the command should be restructured.