Commit e4d8aa3
committed
check nightlies/pr features with etag avalibility
Users in China often don't have a stable connection to AWS S3, so mirror
sites like https://mirrors.tuna.tsinghua.edu.cn exist; they are
typically simple static-file HTTP servers and don't have advanced
S3-like features such as etags.
Previously, we have provided the JULIAUP_SERVER feature to change the
download baseurl, but at that time, I didn't realize that the server
mirror should support ETag.
This commit introduces a server feature check operation for custom
JULIAUP_SERVER:
* if JULIAUP_SERVER equals the default official ones, it works as usual
* Otherwise, send a HEAD check request and set the
NIGHTLY_SERVER_SUPPORTS_ETAG feature flag
If this feature flag is false, then the PR/nightlies download will be
disabled. This doesn't affect the mirror sites because they don't
support mirroring Julia nightlies deliberately; too few people use it,
and it consumes too much unnecessary sync bandwidth.
Known JuliaUp mirror sites in China that can be used to test:
https://mirrors.ustc.edu.cn/juliaup-releases
https://mirrors.tuna.tsinghua.edu.cn/juliaup-releases
https://mirrors.bfsu.edu.cn/juliaup-releases
This commit makes it work for the above mirror sites and thus fixes
Disclaimer: This commit is primarily generated by AI (cursor + claude
4.5 opus). I've tested it manually on both Windows and Linux, and it
works as expected.
Example: PR/nightlies features are disabled with a proper error message:
```
❯ target/debug/juliaup add nightly
Error: The configured nightly server does not support etag headers, which are required for nightly and PR channels.
Nightly and PR channels cannot be installed from this server.
❯ target/debug/julia +nightly
Question: The Juliaup channel 'nightly' is not installed. Would you like to install it?: Yes (install this time only)
Installing Julia nightly as requested
Error: The configured nightly server does not support etag headers, which are required for nightly and PR channels.
Nightly and PR channels cannot be installed from this server.
Error: The Julia launcher failed to determine the command for the `nightly` channel.
Caused by:
Failed to install channel 'nightly'. juliaup add command failed with exit code: Some(1)
```
Example: normal release download just works
```
❯ target/debug/juliaup add 1.10
Checking for new Julia versions
Installing Julia 1.10.10+0.x64.linux.gnu
DEBUG: Starting download from URL: https://mirrors.ustc.edu.cn/julia-releases/bin/linux/x64/1.10/julia-1.10.10-linux-x86_64.tar.gz
Downloading ━━━━━━━━━━━━━━━━━━━━━━━━╸ 165.61 MiB/165.79 MiB eta: 0s
Add Installed Julia channel '1.10'
```
closes #9171 parent 5944e00 commit e4d8aa3
3 files changed
+152
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
176 | 179 | | |
177 | 180 | | |
178 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
171 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
172 | 175 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
229 | | - | |
230 | | - | |
| 230 | + | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
232 | 234 | | |
233 | 235 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| |||
653 | 655 | | |
654 | 656 | | |
655 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
656 | 669 | | |
657 | 670 | | |
658 | 671 | | |
| |||
692 | 705 | | |
693 | 706 | | |
694 | 707 | | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
695 | 716 | | |
696 | 717 | | |
697 | 718 | | |
| |||
1639 | 1660 | | |
1640 | 1661 | | |
1641 | 1662 | | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
1642 | 1666 | | |
1643 | 1667 | | |
1644 | 1668 | | |
| |||
1652 | 1676 | | |
1653 | 1677 | | |
1654 | 1678 | | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
1655 | 1686 | | |
1656 | 1687 | | |
1657 | 1688 | | |
| |||
1678 | 1709 | | |
1679 | 1710 | | |
1680 | 1711 | | |
1681 | | - | |
| 1712 | + | |
| 1713 | + | |
1682 | 1714 | | |
1683 | | - | |
1684 | | - | |
1685 | | - | |
1686 | | - | |
1687 | | - | |
1688 | | - | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
1689 | 1718 | | |
1690 | | - | |
| 1719 | + | |
1691 | 1720 | | |
1692 | 1721 | | |
1693 | 1722 | | |
| |||
1710 | 1739 | | |
1711 | 1740 | | |
1712 | 1741 | | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
1713 | 1745 | | |
1714 | 1746 | | |
1715 | 1747 | | |
| |||
1723 | 1755 | | |
1724 | 1756 | | |
1725 | 1757 | | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
1726 | 1765 | | |
1727 | 1766 | | |
1728 | 1767 | | |
| |||
1740 | 1779 | | |
1741 | 1780 | | |
1742 | 1781 | | |
| 1782 | + | |
1743 | 1783 | | |
1744 | 1784 | | |
1745 | 1785 | | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
1754 | 1790 | | |
1755 | 1791 | | |
1756 | 1792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
7 | 92 | | |
8 | 93 | | |
9 | 94 | | |
| |||
0 commit comments