Less error swallowing when installing gems#5475
Merged
deivid-rodriguez merged 2 commits intomasterfrom Apr 16, 2022
Merged
Conversation
We were trying to remove directories using `FileUtils.rm_f` which is unexpected and does not remove anything. Changing to `FileUtils.rm_rf` actually removes the directories properly. That itself showed other issues: * One test was actually removing the gem package it was about to install, since it was living in the cache folder. To fix that, avoid removing the cache folder, and only make sure the other directories are created automatically, which seems enough. * Another test was actually removing an incorrect directory. Change it to remove the right one (the one that's asserted later to have been created).
simi
approved these changes
Apr 16, 2022
Contributor
Author
|
Thanks @simi! |
deivid-rodriguez
added a commit
that referenced
this pull request
Apr 20, 2022
Less error swallowing when installing gems (cherry picked from commit 504272e)
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.
What was the end-user or developer problem that led to this PR?
I'm working on some changes to
fileutilsto not swallow meaningful errors fromFileUtils.rm_fandFileUtils.rm_rfat ruby/fileutils#58.Trying that PR against RubyGems tests made some errors (mostly likely typos where
FileUtils.rm_finstead ofFileUtils.rm_rfwas used).What is your fix for the problem, implemented in this PR?
Use the proper call so that the folders are actually removed, and fix the issues caused by that.
While debugging those errors, I also removed one
rescuethat felt unnecessary and helped me track down the original culprit of the error.Make sure the following tasks are checked