new
tests fail on Windows if you have ~/.cargo/config
#4601
Labels
A-cargo-api
Area: cargo-the-library API and internal code issues
A-testing-cargo-itself
Area: cargo's tests
C-bug
Category: bug
O-windows
OS: Windows
If you have a
%USERPROFILE%\.cargo\config
on Windows with name/email configured, this will be inadvertently picked up in thenew
test. The test assumes that TempDir is created in a "safe" location, but on Windows this is typically%USERPROFILE%\AppData\Local\Temp
. The recursive tree walk will end up picking up the config file.I don't have any ideas on how to fix this (other than avoiding using
~/.cargo/config
). I don't see a way to prevent cargo from walking up the tree, and I don't know of an alternate way to get a temp directory outside of the user's home directory. I'd be happy with just adding a note somewhere (CONTRIBUTING.md
?) to alert any potential Windows contributors.Reproducing
%USERPROFILE%\.cargo\config
with these contents:cargo test --test new
Current Behavior
The following tests fail:
The text was updated successfully, but these errors were encountered: