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
Download all resources before installation #1666
Comments
I agree. I think we should at the very least retry |
@alexchandel def _fetch
url = @url
if ENV["HOMEBREW_ARTIFACT_DOMAIN"]
url = url.sub(%r{^((ht|f)tps?://)?}, ENV["HOMEBREW_ARTIFACT_DOMAIN"].chomp("/") + "/")
ohai "Downloading from #{url}"
end
urls = actual_urls(url)
unless urls.empty?
ohai "Downloading from #{urls.last}"
if !ENV["HOMEBREW_NO_INSECURE_REDIRECT"].nil? && url.start_with?("https://") &&
urls.any? { |u| !u.start_with? "https://" }
puts "HTTPS to HTTP redirect detected & HOMEBREW_NO_INSECURE_REDIRECT is set."
raise CurlDownloadStrategyError, url
end
url = urls.last
end
curl url, "-C", downloaded_size, "-o", temporary_path
end Second, retry once if _fetch failed, unless it's due to resume error (exit code 33). def fetch
ohai "Downloading #{@url}"
if cached_location.exist?
puts "Already downloaded: #{cached_location}"
else
had_incomplete_download = temporary_path.exist?
begin
_fetch
rescue ErrorDuringExecution
# 33 == range not supported
# try wiping the incomplete download and retrying once
unless $?.exitstatus == 33 && had_incomplete_download
raise CurlDownloadStrategyError, @url
end
ohai "Trying a full download"
temporary_path.unlink
had_incomplete_download = false
retry
end
ignore_interrupts { temporary_path.rename(cached_location) }
end
rescue CurlDownloadStrategyError
raise if mirrors.empty?
puts "Trying a mirror..."
@url = mirrors.shift
retry
end I think that's exactly what happened to you, curl tried to resume but couldn't because the Gecko server didn't support resume, and then, Homebrew decided not to retry because curl exited with 33. So the issue really is whether Homebrew should support retry on servers that don't support resume. |
There's been on activity on this for over a year so going to close this out. |
The Ideas:
In the
Hence a call to the
Thoughts? |
@arghyatiger The files are already stored in |
Just looked at -> Compute all dependencies for a package A. I'll try to make a PR next. |
@arghyatiger Yep, sounds right. Probably want to put the behaviour behind an option or |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
After spending 30 minutes building wine 2.0-rc1, my network connection fluctuated briefly and the
curl
of the gecko package failed. Homebrew then decided the entire build failed and threw it out. Now I need to spend another 30 minutes rebuilding what I just had.This shouldn't happen. Homebrew should be able to either: retry a broken curl; resume a build where it left off; or ignore the curl error and skip the resource.
The text was updated successfully, but these errors were encountered: