Cargo's environment variables are explained here.
RUSTC
- Instead of running rustc
, Cargo will execute this specified compiler instead.RUSTC_WRAPPER
- Instead of simply running rustc
, Cargo will execute this specified wrapper instead, passing as its commandline arguments the rustc
invocation, with the first argument being rustc
.RUSTC
and RUSTC_WRAPPER
variables look like they are doing the same thing. How are they different?
As the documentation states:
If RUSTC
is defined, Cargo will not execute this line:
rustc <parameters>
but this one:
$RUSTC <parameters>
That is like the variable CC
in Makefiles to set an alternative compiler.
If RUSTC_WRAPPER
is defined, Cargo will not call the compiler itself. It will instead call the following line:
$RUSTC_WRAPPER rustc <parameters>
You can add the options you want, or do whatever you want before the compilation, but you have to call the compiler yourself. Well, that's the purpose of a wrapper.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With