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

formula_installer: re-enable mirror usage when installing via API #18798

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

EricFromCanada
Copy link
Member

@EricFromCanada EricFromCanada commented Nov 21, 2024

  • 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?

Since #18562, installing from source via the API doesn't download from a mirror if the original is unreachable. Re-initializing downloadable_object seems to fix this. (🎩 @Bo98)

Note that this only works for brew install -s, and not for brew fetch -s.

Before:

$ tail -n 1 /etc/hosts
127.0.0.1   ftp.gnu.org
$ brew install -s libunistring
libunistring 1.2 is already installed but outdated (so it will be upgraded).
==> Fetching libunistring
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/bcf0b597f2caa3342586ca5e0d2379b2337b7a56/Formul
Already downloaded: /Users/eric/Library/Caches/Homebrew/downloads/027cce73171392f3c59ccae026aaad023c190d1dadcce6b9ee572f6a5eb2804e--libunistring.rb
==> Downloading https://ftp.gnu.org/gnu/libunistring/libunistring-1.3.tar.gz
curl: (7) Failed to connect to ftp.gnu.org port 443 after 1 ms: Couldn't connect to server

Error: libunistring: Failed to download resource "libunistring"
Download failed: https://ftp.gnu.org/gnu/libunistring/libunistring-1.3.tar.gz

After:

$ brew install -s libunistring
libunistring 1.2 is already installed but outdated (so it will be upgraded).
==> Fetching libunistring
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/bcf0b597f2caa3342586ca5e0d2379b2337b7a56/Formul
Already downloaded: /Users/eric/Library/Caches/Homebrew/downloads/027cce73171392f3c59ccae026aaad023c190d1dadcce6b9ee572f6a5eb2804e--libunistring.rb
==> Downloading https://ftp.gnu.org/gnu/libunistring/libunistring-1.3.tar.gz
curl: (7) Failed to connect to ftp.gnu.org port 443 after 1 ms: Couldn't connect to server

Trying a mirror...
==> Downloading https://ftpmirror.gnu.org/libunistring/libunistring-1.3.tar.gz
==> Downloading from https://mirror.its.dal.ca/gnu/libunistring/libunistring-1.3.tar.gz
###########                                                                                                         9.8%

Copy link
Member

@Bo98 Bo98 left a comment

Choose a reason for hiding this comment

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

Thanks!

@Bo98 Bo98 merged commit c329e72 into master Nov 22, 2024
28 checks passed
@Bo98 Bo98 deleted the mirror-with-api branch November 22, 2024 00:25
@MikeMcQuaid
Copy link
Member

Thanks @EricFromCanada!

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