How can a Rust program access metadata from its Cargo package?
Cargo passes some metadata to the compiler through environment variables, a list of which can be found in the Cargo documentation pages. The compiler environment is populated by fill_env in Cargo’s code. This code has become more complex since earlier versions, and the entire list of variables is no longer obvious from it because it … Read more