Support cross install
Checklist
- [X] I've looked through the issues and pull requests for similar request
- [ ] This feature could be solved with a custom image (optional)
Describe your request
I would like to use tools like cargo-bloat with cross, but when I attempt to cross install, I see:
[cross] warning: specified cargo subcommand `install` is not supported by `cross`.
[cross] note: Falling back to `cargo` on the host.
So I assume this is not supported.
I have no idea what kind of lift it would be, but it would be helpful, because I don't know of any alternatives at the moment.
Describe why this would be a good inclusion for cross
Being able to use other cargo packages within cross feels like a natural extension of the current functionality.
Please see the discussion in https://github.com/cross-rs/cross/issues/1215
Closing this as a dupe!
Sorry, I may have been a bit to hasty in resolving this issue. This might be a slightly different ask.
You want this install to persist into the cross container? Then technically the work behind https://github.com/cross-rs/cross/issues/716 would solve a minor painpoint, but we already support this. There's no reason to use cross to install, just use cargo (assuming your host is x86_64-unknown-linux-gnu). We already mount $CARGO_HOME/bin into the container
Okay I didn't find that issue, because despite searching (with quotes) "cargo install", it was buried on page 3 for me. So apologies on that.
But basically, tools like cargo-bloat seem to require compiling of the underlying program to produce output, so yes, I think I'd like it to be in the container? So if I want to analyze the produced cross-compiled application, rather than what is produced on my host, I'd need it to be actually installed with the cargo target. I think.
if you want cross bloat to work then #716 is what is needed
for now though, you should be able to do
cross-util run --target <target> -it -- cargo bloat