cross icon indicating copy to clipboard operation
cross copied to clipboard

Support cross install

Open dfego opened this issue 1 year ago • 5 comments

Checklist

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.

dfego avatar Dec 10 '24 19:12 dfego

Please see the discussion in https://github.com/cross-rs/cross/issues/1215

Closing this as a dupe!

Emilgardis avatar Dec 10 '24 19:12 Emilgardis

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

Emilgardis avatar Dec 10 '24 19:12 Emilgardis

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.

dfego avatar Dec 10 '24 20:12 dfego

if you want cross bloat to work then #716 is what is needed

Emilgardis avatar Dec 10 '24 20:12 Emilgardis

for now though, you should be able to do

cross-util run --target <target> -it -- cargo bloat

Emilgardis avatar Dec 10 '24 20:12 Emilgardis