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

Enhancement - ability to clean user-level pod cache #42

Closed
mikehardy opened this issue Mar 18, 2020 · 10 comments · Fixed by #51
Closed

Enhancement - ability to clean user-level pod cache #42

mikehardy opened this issue Mar 18, 2020 · 10 comments · Fixed by #51

Comments

@mikehardy
Copy link
Contributor

We just ran into an issue on react-native-firebase that was resolved by deleting the local cocoapods cache in the user's directory like so:

rm -fr ~/.cocoapods/repos/trunk

invertase/react-native-firebase#3305 (comment)

Might be nice to have an option to '--wipe-pods-user-cache' or similar?

@mikehardy
Copy link
Contributor Author

Here's the basis for the fix: CocoaPods/CocoaPods#9260 (comment)

@pmadruga
Copy link
Owner

Wouldn't it make more sense to just wipe the entire ~/.cocoapods folder?

@mikehardy
Copy link
Contributor Author

I just wasted a fair bit of time yesterday with cocoapods cache corruption in ~/Library/Cache/CocoaPods (delete possible via pod cache clean --all) as well. Lost hours really, quite painful.

I think purging ~/.cocoapods and pod cache clean --all would be good additions, and I'd do a PR if you'd accept it @pmadruga ?

Deleting these will result in a great deal of network traffic to rebuild state so I would have them default to off in the "auto" scheme and only available via toggles or interactive response, personally, but open to suggestion on that.

@pmadruga
Copy link
Owner

pmadruga commented Dec 9, 2020

A PR is more than welcome, thanks.

I believe the "auto" mode should induce the cleanest state, and the toggles to make it less clean. But I'm flexible on that one 👍🏼

@mikehardy
Copy link
Contributor Author

I will defer to your taste in your module (and I am sympathetic to that anyway - clean should be clean :-) ). Okay I'll post up a PR for a truly clean cocoapods situation. If there is a convenient place to mention to the user that it implies a large network transfer cost in the future to rebuild the cache (like, in docs or if there is already CLI messaging) I'll do that so it's not a shock, or at least not an unknown one :)

@pmadruga
Copy link
Owner

Sounds like a great idea @mikehardy . Happy to review that PR.

@mikehardy
Copy link
Contributor Author

I am still planning on doing this, just collecting ideas here from user reports of what worked for them as they fixed pod errors,

here's another possibly-needed command: pod repo remove trunk, c.f. invertase/react-native-firebase#4710 (comment)

@mikehardy
Copy link
Contributor Author

mikehardy commented Mar 9, 2021

Just noting that @gilbertl confirmed pod cache clean --all is a valid command to clean the directory that bit me, thanks Gilbert

mikehardy added a commit to mikehardy/react-native-clean-project that referenced this issue Mar 26, 2021
@mikehardy
Copy link
Contributor Author

Out of the 3 ideas, I researched and learned that if we purge ~/.cocoapods it means pod repo remove trunk is unnecessary, as that would just be affecting state within ~/.cocoapods - it is a subset.

So I posted a PR that just did rm -rf ~/.cocoapods and pod cache clean --all

@pmadruga
Copy link
Owner

pmadruga commented Mar 29, 2021

Thanks @mikehardy - PR approved with one comment.

mikehardy added a commit to mikehardy/react-native-clean-project that referenced this issue Mar 29, 2021
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 a pull request may close this issue.

2 participants