#1148581 cargo install wrapper fails for virtual manifest files

Package:
cargo
Source:
cargo
Description:
Rust package manager
Submitter:
Reuben Roessler
Date:
2026-10-16 08:03:01 UTC
Severity:
normal
Tags:
#1148581#5
Date:
2026-09-21 07:21:32 UTC
From:
To:
Dear Maintainer,

The wrapper for cargo install forces the --path option for "cargo install" to the current working directory. This fails for projects which use a virtual manifest file (eg: declares a [workspace] instead of a [package]).

I am submitting a patch that will allow developers to override the installation path option so that they can install a selected crate.

Thanks,

Reuben

#1148581#10
Date:
2026-10-16 07:17:53 UTC
From:
To:
It seems Ubuntu is carrying more delta for the cargo wrapper which makes
this patch unappliable. Could you either send a cleaned up version
matching Debian's copy of the script, or upstream the other changes
first if they would benefit us on the Debian side?

I am not sure whether overriding the install path has any benefits over
just calling `cargo build -p <foo>`, but it should be possible to
support it. We could also make the injection of `--path ..` by the
wrapper conditional on no path being passed already, which would support
calling the wrapper with a path override? We already have similar logic
for dropping `--quiet` if the arguments include `--verbose`.

I am happy to take MRs on salsa as well, if you prefer that.

Fabian

#1148581#15
Date:
2026-10-16 08:00:04 UTC
From:
To:
Thanks for the response!

I have submitted a MR on salsa:
https://salsa.debian.org/rust-team/cargo/-/merge_requests/22

That could be a good idea. From memory I implemented it as an environment
variable instead of overriding through the `--path ..` option was because
we need to keep the logic for "DEB_CARGO_CRATE_IN_REGISTRY". Let me know
what you think of the MR and we can tweak it from there.

On Fri, 16 Oct 2026 at 18:18, Fabian Grünbichler <f.gruenbichler@proxmox.com> wrote: