docs: Add troubleshooting section warning about RUSTFLAGS env var (#23354)

According to #23223, manually setting `RUSTFLAGS` env var overrides
settings in `.cargo/config.toml`. Since users possibly may set their own
`RUSTFLAGS` when building, this creates an avenue where builds may fail
for really strange reasons that are difficult to debug.

This PR adds notes to the troubleshooting section to avoid setting
`RUSTFLAGS`, and offers alternatives which do not conflict.

This problem most recently affected nightly CI builders since we had
been setting `RUSTFLAGS` in our workflows to enable custom things like
gles or compiling with a specific target cpu. PR #23117 caused builds to
fail unless they were compiled with `-C target-feature=+crt-static`,
which due to this issue the `RUSTFLAGS` env var we set overrode the
`config.toml` compile flags, causing our builds to fail.

Release Notes:

- N/A
This commit is contained in:
Cherry 2025-01-20 12:43:14 -08:00 committed by GitHub
parent 36c7b3eb91
commit 3c0acdea5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 46 additions and 6 deletions

View file

@ -126,10 +126,6 @@ When this zed instance is exited, terminal output will include a command to run
## Troubleshooting
### Can't compile Zed
Before reporting the issue, make sure that you have the latest rustc version with `rustup update`.
### Cargo errors claiming that a dependency is using unstable features
Try `cargo clean` and `cargo build`.