Commit c72c7bc
authored
feat: Support specifying multiple download URLs in tool_versions. (#1145)
The interface of `repository_ctx.download` and
`repository_ctx.download_and_extract` supports string lists as well as
strings as the value of the `url` argument. This is the ultimate
destination of the `url` attribute in the `tool_versions` dictionary, so
it makes sense for it to support lists as well.
It is often useful to provide multiple download URLs, e.g. when
vendoring deps through a mirror (to guard against issues like [git
archive checksums
changing](https://github.blog/changelog/2023-01-30-git-archive-checksums-may-change/)
while still keeping the canonical download URL) or in an airgapped
setting (to support internal URLs alongside external URLs). This is also
pretty common around Bazel repository rules that download things, e.g.
[http_archive](https://bazel.build/rules/lib/repo/http#http_archive-urls),
so it can be expected to work with `tool_versions` too.1 parent ebe81b7 commit c72c7bc
2 files changed
+33
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
107 | | - | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
428 | 430 | | |
429 | 431 | | |
430 | 432 | | |
431 | | - | |
432 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
433 | 437 | | |
434 | 438 | | |
435 | 439 | | |
| |||
506 | 510 | | |
507 | 511 | | |
508 | 512 | | |
509 | | - | |
| 513 | + | |
510 | 514 | | |
511 | 515 | | |
512 | 516 | | |
| |||
536 | 540 | | |
537 | 541 | | |
538 | 542 | | |
539 | | - | |
| 543 | + | |
540 | 544 | | |
541 | 545 | | |
542 | 546 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
284 | 289 | | |
285 | 290 | | |
286 | 291 | | |
287 | 292 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
297 | 308 | | |
298 | 309 | | |
299 | 310 | | |
| |||
302 | 313 | | |
303 | 314 | | |
304 | 315 | | |
305 | | - | |
| 316 | + | |
306 | 317 | | |
307 | 318 | | |
308 | 319 | | |
| |||
333 | 344 | | |
334 | 345 | | |
335 | 346 | | |
336 | | - | |
337 | | - | |
| 347 | + | |
| 348 | + | |
338 | 349 | | |
339 | 350 | | |
| 351 | + | |
340 | 352 | | |
341 | 353 | | |
342 | 354 | | |
| |||
0 commit comments