Skip to content

[5.6] gracefully handle pre-existing binary artifact from failed downloads (#4021) #4025

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

Merged
merged 1 commit into from
Jan 14, 2022

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Jan 14, 2022

5.6 cherry-pick of #4021


Explanation:

When binary artifact download fails it may leave behind a partial or otherwise corrupt file, which fail subsequent attempts to resolve the dependency graph unless manually cleaned up (remove .build)

Scope of Issue:

This impacts the reliability of SwiftPM when resolving graphs with binary dependencies.

Reason for Nominating to 5.6 :

Important reliability fix for real-world use case.

Risk:

Low risk; No functional changes, this removes a file if exists before attempting to write it.

Reviewed By: @abertelrud

Automated Testing: Unit tests

Dependencies: None

Impact on CI: None

How to Verify: Resolve package dependencies on a binary dependency, cause it to fail mid way, try to resolve again.

…wiftlang#4021)

motivation: when binary artifact download fails it may leave behind a partial or otherwise corrupt file

changes:
* remove pre-existing archive file before attempting to download the same file again
* add test
@tomerd tomerd added 5.6 ready Author believes the PR is ready to be merged & any feedback has been addressed labels Jan 14, 2022
@tomerd
Copy link
Contributor Author

tomerd commented Jan 14, 2022

@swift-ci please test

@tomerd tomerd requested a review from airspeedswift January 14, 2022 17:41
@tomerd tomerd merged commit 289f53a into swiftlang:release/5.6 Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants