rust-lang / rust-lang/rust

Support non-UTF-8 in environment variable dependency tracking

Open
#133,699 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-discussion T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

ParseSess::env_depinfo stores Symbol instead of OsStr.

While we're at it, might make sense to actually not store the environment variable value at all, and instead fetch it inside write_out_deps? (which assumes that the variable won't change during execution of the compiler, but it probably won't).

See also https://github.com/rust-lang/rust/pull/130883#discussion_r1864384740.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with compiler/rustc_session/src/parse.rs, especially ParseSess::env_depinfo, and trace how write_out_deps consumes the recorded environment dependencies. Review the linked pull-request discussion before choosing the storage approach. Done means dependency tracking accepts non-UTF-8 environment variables and the resulting dependency output remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.