Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to download LLVM from llvm.org #295

Closed
bjosv opened this issue Sep 18, 2024 · 4 comments · Fixed by #296
Closed

Fail to download LLVM from llvm.org #295

bjosv opened this issue Sep 18, 2024 · 4 comments · Fixed by #296
Labels
bug Something isn't working
Milestone

Comments

@bjosv
Copy link

bjosv commented Sep 18, 2024

When setup-cpp v0.41.0 attempts to download a release from llvm.org it fails due to URL redirections.

  Installing llvm 5 x64 via direct downloading
  Downloading LLVM from https://llvm.org/releases/5.0.2/clang+llvm-5.0.2-x86_64-linux-gnu-ubuntu-16.04.tar.xz
  Download llvm 5
  Trying https://llvm.org/releases/5.0.2/clang+llvm-5.0.2-x86_64-linux-gnu-ubuntu-16.04.tar.xz #1 at 3:12:25 PM
  Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.
  Waiting 16 seconds before trying again
  Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.
  Waiting 18 seconds before trying again
  Error: Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.

The address: https://llvm.org/releases/5.0.2/clang+llvm-5.0.2-x86_64-linux-gnu-ubuntu-16.04.tar.xz
gives a (problematic) location: http://releases.llvm.org/5.0.2/clang+llvm-5.0.2-x86_64-linux-gnu-ubuntu-16.04.tar.xz
which gives the final location: https://releases.llvm.org/5.0.2/clang+llvm-5.0.2-x86_64-linux-gnu-ubuntu-16.04.tar.xz

Should we use https://releases.llvm.org/${websiteAsset.tag}/${websiteAsset.name} in llvm_url.ts until the root cause is fixed? I don't know if this is a temporary or a lasting issue with llvm.org.

Upvote & Fund

@aminya is using Polar.sh so you can upvote and help fund this issue. The funding is received once the issue is completed & confirmed by you.

Thank you in advance for helping prioritize & fund our backlog!


Fund with Polar
@aminya
Copy link
Owner

aminya commented Sep 18, 2024

The solution is to pass allowRedirectDowngrade to HttpClient, so that it downgrades HTTPS to HTTP
https://github.com/actions/toolkit/blob/6dd369c0e648ed58d0ead326cf2426906ea86401/packages/http-client/src/index.ts#L164

However, that option is not exposed in downloadTool, which is what we're using for downloading binaries.

return downloadTool(url, downloadedFilePath)

So, I might have to patch @actions/tool-cache like this
https://github.com/aminya/setup-cpp/tree/master/patches

@aminya aminya added the bug Something isn't working label Sep 18, 2024
@aminya
Copy link
Owner

aminya commented Sep 18, 2024

Also, it seems all URLs are redirected to release.llvm.org anyways, so it might be just easier to change the URL.
Do you want to try a pull request? @bjosv

@bjosv
Copy link
Author

bjosv commented Sep 19, 2024

Thanks! I wasn’t quick enough, but next time 😀

@aminya
Copy link
Owner

aminya commented Sep 19, 2024

You're welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants