Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

--message-format option missing from cargo install #10104

Closed
Zingam opened this issue Nov 20, 2021 · 3 comments · Fixed by #10107
Closed

--message-format option missing from cargo install #10104

Zingam opened this issue Nov 20, 2021 · 3 comments · Fixed by #10107
Assignees
Labels
A-cli Area: Command-line interface, option parsing, etc. A-json-output Area: JSON message output Command-install E-easy Experience: Easy

Comments

@Zingam
Copy link

Zingam commented Nov 20, 2021

I want to build, install and launch debugging from the install directory in VSCode.
I have created the following launch configuration:

        "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "name": "Install & Debug 'HelloWorld'",
            "cargo": {
                "args": [
                    "install",
                    "--path",
                    ".",
                    "--bin=HelloWorld",
                    "--root",
                    "./install"
                ],
                "filter": {
                    "name": "HelloWorld",
                    "kind": "bin"
                }
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        },

which causes the following error:

Running cargo install --path . --bin=HelloWorld --root ./install --message-format=json...
error: Found argument '--message-format' which wasn't expected, or isn't valid in this context

Am I holding it wrong or is this a limitation of the system?

Well it looks like I'm holding it wrong. Could we have this --message-format=json option in the install context to enable install&debug workflow?

@Zingam Zingam changed the title Build, Install and Launch Debug with rust_analizer in VSCode in one step [cargo] FR Build, Install and Launch Debug with rust_analizer in VSCode in one step Nov 20, 2021
@ehuss ehuss changed the title [cargo] FR Build, Install and Launch Debug with rust_analizer in VSCode in one step --message-format option missing from cargo install Nov 20, 2021
@ehuss ehuss transferred this issue from rust-lang/rust Nov 20, 2021
@ehuss ehuss added A-cli Area: Command-line interface, option parsing, etc. A-json-output Area: JSON message output Command-install E-easy Experience: Easy labels Nov 20, 2021
@ehuss
Copy link
Contributor

ehuss commented Nov 20, 2021

I have transferred this to the cargo repo since it looks like a cargo issue.

Indeed, --message-format seems to be missing from cargo install. It should be a relatively easy thing to add.

@Rustin170506
Copy link
Member

@rustbot claim

I will add it.

@Zingam
Copy link
Author

Zingam commented Nov 21, 2021

That was FTL fast! Thanx!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-cli Area: Command-line interface, option parsing, etc. A-json-output Area: JSON message output Command-install E-easy Experience: Easy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants