Renaming Cargo "target"

So you're saying there are actually three different concepts here, right?

  1. A "platform" target: a triple you can compile for (--target)
  2. An "artifact" target: the output of a build (/target)
  3. A "unit" target: a compilation unit (lib, bins, examples, etc; --all-targets)

I seem to remember that Cargo also uses the "unit" wording in some of its internals. Would it maybe make sense to rename (3) to unit while renaming (2) to artifact? I guess at the rustc level there might be overlap with codegen units, but --all-units seems like a potentially better alternative then --all-artifacts especially when used with cargo check (which doesn't actually produce artifacts).

2 Likes

Maybe its my bias for how Cargo already uses "unit" but its ingrained in me that "unit" is the same as "node" or "crate" which can represent anything in the build graph, not just the root (or leaves, depending on your perspective).

1 Like