Stabilize PATH
option for --print KIND=PATH
by Urgau · Pull Request #114183 · rust-lang/rust (original) (raw)
This PR propose stabilizing the PATH
option for --print KIND=PATH
. This option was previously added in #113780 (as insta-stable before being un-stablized in #114139).
Description of the PATH
option:
A filepath may optionally be specified for each requested information kind, in the format
--print KIND=PATH
, just like for--emit
. When a path is specified, information will be written there instead of to stdout.
Description of the original PR [link]:
Support --print KIND=PATH command line syntax
As is already done for
--emit KIND=PATH
and-L KIND=PATH
.In the discussion of #110785, it was pointed out that
--print KIND=PATH
is nicer than trying to apply the single global-o path
to-o
would already be used for a different meaning in the case oflink-args
andnative-static-libs
.I am interested in using
--print cfg=PATH
in Buck2. Currently Buck2 works around the lack of support for--print KIND=PATH
by indirecting through a Python wrapper script to redirect rustc's stdout into the location dictated by the build system.From skimming Cargo's usages of
--print KIND=PATH
too. Currently it is working around the lack of this by inserting--crate-name=___ --print=crate-name
so that it can look for a line containing___
as a delimiter between the 2 other