Crate rustc

source ·
Expand description

Shim which is passed to Cargo as “rustc” when running the bootstrap.

This shim will take care of some various tasks that our build process requires that Cargo can’t quite do through normal configuration:

  1. When compiling build scripts and build dependencies, we need a guaranteed full standard library available. The only compiler which actually has this is the snapshot, so we detect this situation and always compile with the snapshot compiler.
  2. We pass a bunch of --cfg and other flags based on what we’re compiling (and this slightly differs based on a whether we’re using a snapshot or not), so we do that all here.

This may one day be replaced by RUSTFLAGS, but the dynamic nature of switching compilers for the bootstrap and for build scripts will probably never get replaced.

Functions

  • Parses the dylib_path_var() environment variable, returning a list of paths that are members of this lookup path.
  • Returns the environment variable which the dynamic library lookup path resides in for this platform.
  • Tries to build a string with human readable data for several of the rusage fields. Note that we are focusing mainly on data that we believe to be supplied on Linux (the rusage struct has other fields in it but they are currently unsupported by Linux).
  • main 🔒