report failed downloads quietly when a fallback candidate succeeds#2336
Open
kevinushey wants to merge 4 commits into
Open
report failed downloads quietly when a fallback candidate succeeds#2336kevinushey wants to merge 4 commits into
kevinushey wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1727. Alternative to #2332.
Problem
When a binary package fails to download but the source fallback succeeds, users see an alarming
ERRORline immediately followed by a successful download of the same package:Approach
No output capture is used at all (an earlier revision used
capture.output(), but sink + textConnection is slow). Instead, download status reporting is routed through a small status slot:download()'s status messages (OK [...],ERROR [...]) are reported via a newrenv_download_status()helper. By default it prints eagerly, preserving current behavior for all callers; whenthe$download_statusis active, the message is stashed there instead, and the download preamble is not printed.renv_retrieve_package()gains adeferargument. When set, it activates the status slot around the download, then assemblespreamble + statusafterward: emitted on success, or attached to the error condition otherwise. The slot is cleared before dependency recursion, so recursive retrievals stream their output live as usual; a deferred cleanup acts as a backstop for non-local exits (e.g. interrupts).deferis also disabled whenrenv.download.traceis enabled.renv.retrieve.errorare now tagged, fixing two pre-existing duplicate reports: the candidate loop re-collecting errors already collected by the condition handler, andrenv_retrieve_repos_archive()re-signaling errors already signaled byrenv_retrieve_package().Tests
ERRORline is suppressed and the successfulOKline is still emitted.devtools::test(filter = "retrieve"): 31 passed. Broader run over restore / install / download / repos / bioconductor / remotes: 345 passed.