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

Recognize curl as a downloading tool #335

Merged
merged 3 commits into from
Oct 15, 2021

Conversation

am11
Copy link
Member

@am11 am11 commented Aug 20, 2021

Chances of having curl on a fresh Linux / macOS install are actually higher than having wget, but even if there is a tie, using available tool in PATH which does the job right is good. This is the only script related to runtime that force the user to install wget.

.. was about to run brew install wget then thought I should do this first. 😄

@am11
Copy link
Member Author

am11 commented Oct 13, 2021

cc @BruceForstall, PTAL. dotnet-install.sh and other scripts in runtime and arcade provide curl or wget choice. This patch aligns bootstrap.sh with the similar fallback mechanism.

@BruceForstall
Copy link
Member

This LGTM. Can some @dotnet/jit-contrib Unix guru review?

Copy link
Contributor

@echesakov echesakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM. But I have one question that I asked inline

status="${response[1]}"
fi

if (( status >= 200 || status < 400 )); then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What statuses other than 200 and 301 can indicate that the url is valid?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2xx and 3xx classes indicate the success-like cases.

However, I just noticed that I am missing --location (or -L) below at curl invocations to indicate "follow redirect" in case of 301, 308 etc. (wget follows redirects by default, but curl requires -L).

bootstrap.sh Outdated Show resolved Hide resolved
bootstrap.sh Outdated Show resolved Hide resolved
@BruceForstall
Copy link
Member

@echesakovMSFT Any more feedback here?

Copy link
Contributor

@echesakov echesakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@echesakov echesakov merged commit 89c6aba into dotnet:main Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants