Commit 04106b5
authored
Don't read the config file twice when $CARGO_HOME is a symlink (#16325)
### What does this PR try to resolve?
Cargo should not load configuration twice if the config is symlinked
resolves #16206
### How to test and review this PR?
> ### Steps
>
> on unix:
>
> 1. `mkdir -p a/b`
>
> 2. `ln -s a c`
>
> 3. `mkdir a/.cargo`
>
> 4. `echo "[build]\nrustdocflags = [\"--default-theme=dark\"]" >
a/.cargo/config.toml`
>
> 5. `cd a/b`
>
> 6. `CARGO_HOME=../../c/.cargo cargo doc`
>
> 7. notice (with `strace` or by having a project at `a/b`) that the
config file is read twice and the build fails2 files changed
+66
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
1681 | | - | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
1682 | 1684 | | |
1683 | 1685 | | |
| 1686 | + | |
| 1687 | + | |
1684 | 1688 | | |
1685 | 1689 | | |
1686 | 1690 | | |
1687 | | - | |
| 1691 | + | |
1688 | 1692 | | |
1689 | 1693 | | |
1690 | 1694 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2589 | 2589 | | |
2590 | 2590 | | |
2591 | 2591 | | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
0 commit comments