check nightlies/pr features with etag availability#1387
Merged
IanButterworth merged 5 commits intomainfrom Jan 18, 2026
Merged
Conversation
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 #917
Fixes critical issues in PR #1347 for better mirror server compatibility: Critical fixes: - Add early etag support check in install_from_url BEFORE downloading to avoid wasting bandwidth (~165MB) when server doesn't support etags - Remove redundant etag check after download Robustness improvements: - Use proper URL parsing for default server detection instead of string comparison - Handle URL variations (http/https, trailing slashes) correctly - Remove unwrap() from Windows HEAD request that could panic - Add debug logging for all error paths in server capability checks These changes prevent users from downloading large tarballs only to get an error, and make the server capability detection more reliable across different mirror configurations.
- Add .context() to check_server_supports_nightlies() calls in install_from_url and install_non_db_version for clearer error messages - Improves error diagnostics when etag support check fails - Update functions continue to use unwrap_or(false) for graceful degradation during non-critical update checks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Suggested changes (c36a95e 53f292e) ontop of #1347 plus an update from main.
@johnnychen94 thanks for the original PR #1347 I just wanted to help this along, so will merge this with these tweaks and update.
Closes #1347
Closes #917
Description by @johnnychen94 from #1347
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 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 #917.
Disclaimer: This commit is primarily generated by AI (cursor + claude 4.5 opus). I've tested it locally on Windows and Linux, and it works as expected. MacOS is not tested.
Example: PR/nightlies features are disabled with a proper error message:
Example: normal release download just works