(upstream_root: &Path)
| 129 | panic!("failed to {}: {}", description, status); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | fn reset_cmake_cache_if_source_changed( |
| 134 | build_root: &Path, |
| 135 | upstream_root: &Path, |
| 136 | ) -> std::io::Result<()> { |
| 137 | let cache_path = build_root.join("CMakeCache.txt"); |
| 138 | if !cache_path.exists() { |
| 139 | return Ok(()); |
| 140 | } |
| 141 | |
| 142 | let cache = fs::read_to_string(&cache_path)?; |
| 143 | let expected = upstream_root.display().to_string(); |
| 144 | let has_expected_source = cache |
| 145 | .lines() |