Commit 57b7597
committed
Auto merge of #9363 - ehuss:cargo-env-fingerprint, r=alexcrichton
Track "CARGO" in environment fingerprint.
There is an issue where if a package includes an `env!("CARGO")`, that value is not tracked in the fingerprint. If different cargos are used, it will not rebuild. This changes it so that the path to cargo will be tracked in the fingerprint if the CARGO env var is in the dep-info file.
This came up with rust's build system where it [tracks the env](https://github.com/rust-lang/rust/blob/60158f4a7cf3e3063df6127d3f0d206921d285b0/src/bootstrap/config.rs#L574). If you build rust once, and then change the `cargo` value in `config.toml` and try building again, it would not pick up the change which caused me some confusion.
In theory, cargo could fingerprint this every time, but I figure that could be disruptive and trigger needlessly in some situations.
This diff is a little bigger than I would like for such an obscure case. As an alternative, I think rustbuild could just print `cargo:rerun-if-env-changed=CARGO`, but I figure this could potentially be useful for other projects.File tree
2 files changed
+93
-4
lines changed- src/cargo/core/compiler
- tests/testsuite
2 files changed
+93
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
| |||
712 | 713 | | |
713 | 714 | | |
714 | 715 | | |
| 716 | + | |
715 | 717 | | |
716 | 718 | | |
717 | 719 | | |
| |||
727 | 729 | | |
728 | 730 | | |
729 | 731 | | |
730 | | - | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
731 | 747 | | |
732 | 748 | | |
733 | 749 | | |
| |||
980 | 996 | | |
981 | 997 | | |
982 | 998 | | |
| 999 | + | |
983 | 1000 | | |
984 | 1001 | | |
985 | 1002 | | |
| |||
1071 | 1088 | | |
1072 | 1089 | | |
1073 | 1090 | | |
1074 | | - | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1075 | 1094 | | |
1076 | 1095 | | |
1077 | 1096 | | |
| |||
1256 | 1275 | | |
1257 | 1276 | | |
1258 | 1277 | | |
1259 | | - | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
1260 | 1285 | | |
1261 | 1286 | | |
1262 | 1287 | | |
| |||
1850 | 1875 | | |
1851 | 1876 | | |
1852 | 1877 | | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
1853 | 1882 | | |
1854 | 1883 | | |
1855 | | - | |
| 1884 | + | |
1856 | 1885 | | |
1857 | 1886 | | |
1858 | 1887 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2581 | 2581 | | |
2582 | 2582 | | |
2583 | 2583 | | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 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 | + | |
0 commit comments