Closed
Description
#74653 introduces proc_macro::tracked_env::var
- a new function that is similar to regular env::var
called from a proc macro, except that it also adds the accessed variable to depinfo.
This way build system executing the compiler will know that the variable was accessed during compilation, and will be able to rerun the build when the value of that variable changes.
Besides the dependency tracking tracked_env::var
differs from env::var
from the standard library by requiring UTF-8 arguments.
See some discussion in #71858 for the motivation, non UTF-8 variables were considered unimportant corner cases by the stakeholders, and tracking for them can be introduced later with new depinfo directives like # env-dep-bytes
.