-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CocoaPods/CocoaPods#11827, Fix Concurrent building occasionally clean…
…s the Pods cache directory
- Loading branch information
chengcong
committed
Apr 10, 2023
1 parent
5cb2450
commit 5df4576
Showing
7 changed files
with
28 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
require 'cocoapods-fix-cache/gem_version' | ||
module CocoapodsFixCache | ||
VERSION = "0.1.0" | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module Pod | ||
module Downloader | ||
class Cache | ||
alias_method :old_ensure_matching_version, :ensure_matching_version | ||
def ensure_matching_version | ||
# Fix Concurrent building occasionally cleans the Pods cache directory #11826 #11827 | ||
# https://github.com/CocoaPods/CocoaPods/pull/11827 | ||
if Cache.respond_to?(:read_lock) && Cache.respond_to?(:write_lock) | ||
version_file = root + "VERSION" | ||
version = nil | ||
Cache.read_lock(version_file) { version = version_file.read.strip if version_file.file? } | ||
|
||
root.rmtree if version != Pod::VERSION && root.exist? | ||
root.mkpath | ||
|
||
Cache.write_lock(version_file) { version_file.open("w") { |f| f << Pod::VERSION } } | ||
else | ||
old_ensure_matching_version | ||
end | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
require 'cocoapods-fix-cache/command' | ||
require "cocoapods-fix-cache/fix-cache" |