Conversation
dc4dfa5 to
4e9e6ca
Compare
|
@mcandre does this work for you? I can add more data to the array |
| .iter() | ||
| .filter_map(|i| { | ||
| Some(Target { | ||
| triplet: Some(i.name).filter(|i| *i != "zig")?.to_owned(), |
There was a problem hiding this comment.
this is a nice usage of try trait :D
There was a problem hiding this comment.
| triplet: Some(i.name).filter(|i| *i != "zig")?.to_owned(), | |
| triplet: if *i.name != "zig" { i.name.to_owned() } else { return None }, |
| .collect::<Vec<_>>() | ||
| }) | ||
| .filter(|v| !v.is_empty()) | ||
| .unwrap_or_else(|| vec![docker::ImagePlatform::DEFAULT.to_string()]), |
There was a problem hiding this comment.
this is meant to replicate what happens when we do https://github.com/Emilgardis/cross/blob/list-supported-targets/src/docker/image.rs#L30
| #[derive(Args, Debug)] | ||
| pub struct ListTargets { | ||
| /// Format version | ||
| #[clap(long)] | ||
| format_version: Option<FormatVersion>, | ||
| /// Coloring: auto, always, never | ||
| #[clap(long)] | ||
| pub color: Option<String>, | ||
| } |
There was a problem hiding this comment.
should there be a way to only output targets in toml config? Maybe that could be data included in the output?
| /// Format version | ||
| #[clap(long)] | ||
| format_version: Option<FormatVersion>, |
There was a problem hiding this comment.
do we really need this kind of stability?
For my purposes, I would like to see the support tier number included in the output. Perhaps a field like If possible, I would prefer a flatter array design, that doesn't restate some of the triple and platform information. I just want to be able to associate triple with support tier number. If we go with JSON, then I would like to see all cross data models exported as a stable Rust library. The current policy treats only the CLI as stable. Until the data models and schemas (e.g., the entire Cross.toml schema) enter a stable library, I would actually prefer to see non-JSON in cross CLI tool output. That is, |
The tier is not relevant to cross, all targets emitted are the targets that actually has been setup for the project. i.e not every tier 1 and tier 2 target are emitted, only targets in any tier, including custom targets when specified in a projects config, are emitted iff they are supported by cross or have been setup to work with cross in the project which i.e # Cross.toml
[target."my-custom-target.json"]
image = "my-image:latest"
build-std = false
[target.aarch64-apple-ios]
image = "aarch64-apple-ios-cross:local"would output with
That's the entire reason behind |
Uh oh!
There was an error while loading. Please reload this page.