I have a lot of executables that need to be build for a custom target. I know I can set the target via either the CLI through --target or I can put it in .cargo/config.toml. My problem now is that all these crates have a copy of the target json. This has the issue that they could get out of sync with each other and is a lot of maintenance to keep them in sync. Preferably I would like to keep one copy that every crate can access. I would like to prevent from forcing a specific hardcode path as that wouldn't be great across computers. Does anybody have some advise on how to make this workflow easier and nicer.
If all the binaries are all related or built as a group, I would suggest using cargo workspaces.
If you set up a new cargo project containing a virtual manifest, then you can put your target definition in there. Running
cargo build --target custom.json from that project would build everything for your target.
They aren't built as a group so sadly a virtual manifest is of the table.