From 9ada976839791a76d345ea7e0d71503a33bf3a8f Mon Sep 17 00:00:00 2001 From: Justin Martin Date: Tue, 21 Nov 2023 15:36:34 -0800 Subject: [PATCH] Use rsync to exclude copying the fsmonitor--daemon.ipc This prevents a copy error where the system is unable to copy the ipc file due to being a socket. This would otherwise manifest as errors during pod install with the message "too long unix socket path" if git's `core.fsmonitor` feature is enabled. Resolves #11640 --- CHANGELOG.md | 5 +++-- lib/cocoapods/downloader/cache.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24e63d4be9..d3ba1722c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ##### Bug Fixes -* None. - +* Fix issue when git's `core.fsmonitor` feature is enabled + [Justin Martin](https://github.com/justinseanmartin) + [#11640](https://github.com/CocoaPods/CocoaPods/issues/11640) ## 1.14.3 (2023-11-19) diff --git a/lib/cocoapods/downloader/cache.rb b/lib/cocoapods/downloader/cache.rb index 5c9ff20fc7..ebb498df6a 100644 --- a/lib/cocoapods/downloader/cache.rb +++ b/lib/cocoapods/downloader/cache.rb @@ -308,7 +308,7 @@ def copy_source_and_clean(source, destination, spec) specs_by_platform = group_subspecs_by_platform([spec]) destination.parent.mkpath Cache.write_lock(destination) do - FileUtils.cp_r(source, destination, :remove_destination => true) + Pod::Executable.execute_command('rsync', ['-a', '--exclude=.git/fsmonitor--daemon.ipc', '--delete', "#{source}/", destination]) Pod::Installer::PodSourcePreparer.new(spec, destination).prepare! Sandbox::PodDirCleaner.new(destination, specs_by_platform).clean! end