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

Redetermine curl and git paths where necessary #12191

Merged
merged 1 commit into from Oct 5, 2021

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Oct 5, 2021

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Discovered while testing an installation of Homebrew in a 10.10 VM.

We need to redetermine the curl and git paths in two places:

  • After OS conditionals where we may force HOMEBREW_FORCE_BREWED_CURL/GIT.
  • After installing curl and git in brew update, so the rest of the update script can use them.

@Bo98 Bo98 added the critical Critical change which should be shipped as soon as possible. label Oct 5, 2021
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks good, makes sense.

@BrewTestBot
Copy link
Member

Review period skipped due to critical label.

@Bo98 Bo98 merged commit 92749f9 into Homebrew:master Oct 5, 2021
@Bo98 Bo98 deleted the curl-git-path branch October 5, 2021 16:49
@carlocab
Copy link
Member

carlocab commented Oct 6, 2021

This now shows up in brew config:

Git: 2.33.0 => /opt/homebrew/opt/git/bin/git
Curl: 7.64.1 => /opt/homebrew/Library/Homebrew/shims/shared/curl

Should we be exposing the path to the shims like this? Interestingly, the path to git is determined correctly.

@MikeMcQuaid
Copy link
Member

Should we be exposing the path to the shims like this?

No, I don't think so.

Interestingly, the path to git is determined correctly.

That's likely because we're doing something smarter there.

@carlocab
Copy link
Member

carlocab commented Oct 6, 2021

Yep. This is where the path to curl is determined:

def describe_curl
out, = system_command(curl_executable, args: ["--version"], verbose: false)
if /^curl (?<curl_version>[\d.]+)/ =~ out
"#{curl_version} => #{curl_executable}"
else
"N/A"
end
end

and this is curl_executable:

def curl_executable(use_homebrew_curl: false)
return Formula["curl"].opt_bin/"curl" if use_homebrew_curl
@curl_executable ||= HOMEBREW_SHIMS_PATH/"shared/curl"
end

I'll have a look tomorrow.

carlocab added a commit to carlocab/brew that referenced this pull request Oct 6, 2021
@carlocab
Copy link
Member

carlocab commented Oct 6, 2021

#12198

@github-actions github-actions bot added the outdated PR was locked due to age label Nov 6, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants