Skip to content

Tracking Issue for tracked access to environment variables from proc macros #74690

Closed
@petrochenkov

Description

@petrochenkov

#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-proc-macrosArea: Procedural macrosC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions