-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Invoking Custom Subcommands with Cross #716
Comments
Just because of the lack of updates: I've added a very rough base design for this, found on my subcommands fork. The general idea is as follows:
Now, the specifics. Installed subcommands will be registered in a JSON file in a general data directory ( {
"aarch64-unknown-linux-gnu": [
"asm",
"deb"
]
} This allows us to quickly look up the subcommand and if it's registered easily. We can also have Thoughts? I've tested the general idea with |
this is what cargo does, it doesn't set any extra env, only invokes the binary with
I think the automatic installation should be replaced with a suggestion to install the tool with |
It would be handled by the same code as |
What i'm thinking is that we should probably preserve the same behaviour as cargo, cargo doesn't install automatically |
I assume there was no further progress made on this? Is there maybe a workaround at the moment which would allow running cargo-deb in cross without any direct cross support? Assuming using a custom docker image. |
There's a mostly working PR for this based off of #931 at https://github.com/Alexhuszagh/cross/tree/subcommands. I've still got notes on the implementation status, I'm just waiting for some dust to settle before rebasing (it touches too many things so I'll have to do it entirely manually), and it also requires cargo configs and aliases to be resolved (hence, #931). So there is a decent amount of progress, there's substantial effort right now in ensuring I have the time to ensure it is fully comprehensive and correct, that no more changes are made to the config settings in the meantime (which they currently are), and that another maintainer has time to review a massive PR. That branch should be almost entirely working IIRC. It only works if runners for the target are available, such as Qemu, which in this case it is, however, it requires a few tricks for pre-installing the commands. |
This is not entirely true - Cargo does set one environment variable, |
I would also like |
Not sure it's compatible with qemu, since apparently there's threading issues in some virtualization, maybe the story has changed. See the readme:
I remember some discussion in rust-lang/rust about it, I'll try to find it and update this comment |
nextest runs tests in parallel by spawning multiple processes, so its idea is sound and compatible with qemu. The only problem with nextest is that it uses tokio multi-thread rt internally, but this can be helped by setting TOKIO_WORKER_THREADS, which should work unless nextest manually override it. |
It's often useful to run custom subcommands for another target, such as
asm
,deb
, or others. Since we can't necessarily enumerate every subcommand, there's a few solutions I see:CROSS_FORCE_RUN_IN_IMAGE=1
. This name isn't ideal, so we'd probably modify it to something else.cross --list
if the subcommand isn't known, parse it, and if the subcommand is known, run it in the image.We need to support the following, at the very least:
Related to #207, #210, #715.
The text was updated successfully, but these errors were encountered: