-
Notifications
You must be signed in to change notification settings - Fork 388
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
Support (or not) multi-target invocation #1062
Comments
We should definitely only support it if the Rust version is >= 1.64.0, and I think for feature compatibility we probably need to support this. The only issue is we can't run it in parallel (not sure if TARGETS=(...)
for target in "${TARGETS[@]}"; do
cross build --target "${target}"
done It wouldn't be that tricky either, if we process the CLI arguments and change: diff --git a/src/cli.rs b/src/cli.rs
index a2b90a2..5cb3ff7 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -13,7 +13,7 @@ pub struct Args {
pub all: Vec<String>,
pub subcommand: Option<Subcommand>,
pub channel: Option<String>,
- pub target: Option<Target>,
+ pub target: Option<Vec<Target>>,
pub features: Vec<String>,
pub target_dir: Option<PathBuf>,
pub manifest_path: Option<PathBuf>, And then we can do the steps such as adding the toolchains for each target, as well as run the interior logic sequentially. |
Itd be nice to be able to do it in parallel. Wonder how much it would take to support. we would probably have to dig in to how the synchronization of common deps between targets is done and probably more |
We can probably do the installation from rustup in a single step. But running Docker multiple times in parallel for each target sounds like a bad idea (no performance benefit, might have significant memory overhead), and supporting images with multiple toolchains also sounds like a disaster logistically. Supporting an omni-image as well sounds like a nightmare for paths. |
It seems like The rest isn't too difficult:
Major downsides? We have a much higher risk of causing #724 to trigger. Also, we've got another issue: how should we handle cases where one target needs docker, and the other doesn't? |
Checklist
Describe your request
Should cross support
cross build --target xxx --target yyy
https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#cargo-improvements-workspace-inheritance-and-multi-target-builds
Describe why this would be a good inclusion for
cross
No response
The text was updated successfully, but these errors were encountered: