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

install: fix HEAD installations with HOMEBREW_INSTALL_FROM_API #12087

Merged
merged 2 commits into from Sep 21, 2021

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Sep 18, 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?

This PR should fix the issues that HOMEBREW_INSTALL_FROM_API brought to HEAD formulae. Now, brew install --HEAD, brew outdated --fetch-HEAD, brew upgrade --fetch-HEAD should all work as expected.

CC @carlocab (if you could confirm that this fixes your issue I'd appreciate it, sorry I didn't get to fixing it earlier)

@BrewTestBot
Copy link
Member

Review period will end on 2021-09-21 at 00:00:00 UTC.

@BrewTestBot BrewTestBot added waiting for feedback Merging is blocked until sufficient time has passed for review and removed waiting for feedback Merging is blocked until sufficient time has passed for review labels Sep 18, 2021
Library/Homebrew/formula.rb Outdated Show resolved Hide resolved
Library/Homebrew/formula.rb Outdated Show resolved Hide resolved
Library/Homebrew/formula.rb Outdated Show resolved Hide resolved
Library/Homebrew/formula.rb Outdated Show resolved Hide resolved
@BrewTestBot
Copy link
Member

Review period ended.

@MikeMcQuaid MikeMcQuaid merged commit a3e652e into Homebrew:master Sep 21, 2021
@MikeMcQuaid
Copy link
Member

Looks good thanks @Rylan12!

@Rylan12 Rylan12 deleted the api-head-install-fixes branch September 21, 2021 14:07
Comment on lines +313 to +315
default_specified_path = alias_path || path

return default_specified_path if default_specified_path.presence&.exist?
Copy link
Member

Choose a reason for hiding this comment

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

alias_path is a String rather than a Pathname, so this can error in that scenario.

I'm tempted to make alias_path a Pathname but that would be an API change.

Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
default_specified_path = alias_path || path
return default_specified_path if default_specified_path.presence&.exist?
default_specified_path = Pathname(alias_path) || path
return default_specified_path if default_specified_path.presence&.exist?

This will remove the error possibility, right?

Copy link
Member

Choose a reason for hiding this comment

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

Pathname(nil) is an error unfortunately.

@github-actions github-actions bot added the outdated PR was locked due to age label Oct 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants