Is there a good way to ask rustc for the default target?
the best I got is
rustc --print target-spec-json -Z unstable-options | jq '.["llvm-target"]' -r
it would be interesting to me as well :)
argh, and of course mac's won't have
jq. and "grep" can't show capture groups. wow this is awful.
rustc --print target-spec-json -Z unstable-options | grep llvm-target | cut -d '"' -f 4
technology is amazing...
rustc --print cfg doesn't provide the same information in a grep friendly way?
it is all split and reassembling isn't the nicest thing I guess
also, is it always
It is not always
$ARCH-$VENDOR-$OS-$ENV. You can get the target triple from
rustc --version --verbose as well.
hm, interesting. that looks slightly easier to grep for.
that would be
rustc --version --verbose | grep "^host:" | cut -d ' ' -f 2