rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.62k stars 12.74k forks source link

`//@ {unset-,}{rustc,exec}-env` parsing is a footgun #132990

Open jieyouxu opened 4 days ago

jieyouxu commented 4 days ago

Apparently

//@ rustc-env: RUSTC_BOOTSTRAP=1

is not the same as

//@ rustc-env:RUSTC_BOOTSTRAP=1

compiletest will parse the former as an env var called ⌴RUSTC_BOOTSTRAP (incl. the whitespace).

Shunpoco commented 13 hours ago

Hi, I'd like to take this ticket, but what is the best solution?

  1. Accept such whitespace: I think we will modify Config::parse_env to remove such whitespaces,
  2. Fix all test codes which put a whitespace, or
  3. Panic when parse_env detects such a whitespace
jieyouxu commented 7 hours ago

I haven't quite determined what's the best solution to this yet.

jieyouxu commented 4 hours ago

Tagging as E-hard and E-needs-design because it needs to not be a footgun on its own but also it needs to be homogenous with other directive syntaxes.