Commit 9da34f2
authored
Spec.installed_upstream fix (spack#50938)
`Database.query_by_spec_hash` returns `upstream, record`, and
claims in its docstring that `upstream = True` if the spec is installed
upstream. However, the record only needs to be *present* upstream
for this to be true. `Spec.installed_upstream` was going by the docstring
(which meant it could be wrong in circumstances where the upstream
had a record, but the spec wasn't actually installed there).
I think it's useful for `query_by_spec_hash` to preserve its behavior, so I
* Updated the docstring
* Made `Spec.installed_upstream` check the record
I also added a test. More than just the behavior here, I didn't see an explicit
test for the case where a spec is added to the DB with no prefix - something
that can now happen fairly frequently with the compiler wrappers when installing
from a binary cache (which is also how a user found this problem).1 parent 89cf3da commit 9da34f2
3 files changed
+61
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
730 | | - | |
731 | | - | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
732 | 737 | | |
733 | 738 | | |
734 | 739 | | |
| |||
1175 | 1180 | | |
1176 | 1181 | | |
1177 | 1182 | | |
1178 | | - | |
| 1183 | + | |
1179 | 1184 | | |
1180 | 1185 | | |
1181 | 1186 | | |
| |||
1264 | 1269 | | |
1265 | 1270 | | |
1266 | 1271 | | |
1267 | | - | |
| 1272 | + | |
1268 | 1273 | | |
1269 | 1274 | | |
1270 | 1275 | | |
| |||
1275 | 1280 | | |
1276 | 1281 | | |
1277 | 1282 | | |
1278 | | - | |
| 1283 | + | |
1279 | 1284 | | |
1280 | 1285 | | |
1281 | 1286 | | |
| |||
1783 | 1788 | | |
1784 | 1789 | | |
1785 | 1790 | | |
1786 | | - | |
| 1791 | + | |
1787 | 1792 | | |
1788 | 1793 | | |
1789 | 1794 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2019 | 2019 | | |
2020 | 2020 | | |
2021 | 2021 | | |
2022 | | - | |
2023 | | - | |
| 2022 | + | |
| 2023 | + | |
2024 | 2024 | | |
2025 | 2025 | | |
2026 | 2026 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
189 | 237 | | |
190 | 238 | | |
191 | 239 | | |
| |||
0 commit comments