Is it possible to specify different target architectures when building different Cargo workspace members? This would allow for use-cases where some binaries are meant for local execution and others are meant for embedded targets, wasm, or other cross-compiled targets, without splitting them into separate repositories or workspaces.
As far as I can see, the only place I can specify a default target is in .cargo/config.toml, which is sensitive to the directory that I stand in. So having a single .cargo/config.toml at the workspace root, I would have one default target for all workspace members. I might be able to have multiple of these in a single workspace (I haven't tried), but they would be sensitive to what directory I'm in, which is less ideal as a trigger.
I might be able to pull this off using Nix, since I can have multiple Nix derivations in a single project directory, but it would be adaptive for nix ...
commands and not for cargo ...
commands, which is less ideal for a low-complexity, Cargo-centric workflow.
I could also simply have a justfile that provides just ...
commands that specify the target for building different crates. That might be the simplest, low-tech solution.
What are people's experience combining embedded crates with non-embedded crates in the same workspace?