+
Skip to content

Tags: gzmorell/cargo

Tags

homu-tmp

Toggle homu-tmp's commit message
Auto merge of rust-lang#3078 - jhbabon:fix/parse-home-config-once, r=…

…alexcrichton

Fix: Don't parse the home directory more than once

This PR tries to resolve this issue rust-lang#3070. The problem is that the `walk_tree` method in the `src/util/config.rs` module was parsing more than once the contents of the config file in the home directory (the file `~/.cargo/config`). The biggest problem with this is with options that can accept multiple values, like `build.rustflags`. If you parse the file twice, the same option can end with duplicated values (e.g: `rustflags=["-Z", "foo", "-Z", "foo"]`).

I made the fix following the comments in the issue. In the fix I keep track of all the parsed config files in a `HashSet` so I can know if a file has been parsed already. ~~I'm also using `std::fs::canonicalize`, as suggested in the issue, to prevent parsing files behind symbolic links more than once.~~

**UPDATE:** I removed the call to `fs::canonicalize` as suggested in the comments. Now the fix is way simpler, which means less code and less possibilities to add a new bug.

0.12.0

Toggle 0.12.0's commit message
Version 0.12.0

0.11.0

Toggle 0.11.0's commit message
0.11.0 release

0.10.0

Toggle 0.10.0's commit message
0.10.0 release

0.9.0

Toggle 0.9.0's commit message
0.9.0 release

0.8.0

Toggle 0.8.0's commit message
0.8.0 release

0.7.0

Toggle 0.7.0's commit message
0.7.0 release

0.6.1

Toggle 0.6.1's commit message
Update deps for 0.6.1

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载