spotify / XCRemoteCache

Other
825 stars 50 forks source link

Cannot remove DerivedData folder once marked a build #200

Closed OliverKoo closed 1 year ago

OliverKoo commented 1 year ago

My integration setup

[X] Automatic integration using xcprepare integrate ...

Expected/desired behavior Able to rm -rf ~/Library/Developer/Xcode/DerivedData. Even if removed it seems to repopulate itself.

Context: I am considering bringing in XCRemoteCache into our organization, so I am doing some benchmarking locally, therefore I need to clear DerviedData locally after built with producer mode and build again with consumer mode without DerivedData present.

Minimal reproduction of the problem with instructions

  1. follow the auto integrated steps
  2. be in producer mode
  3. do a successful build with xcodebuild
  4. mark xcremotecache/xcprepare mark --configuration Debug --platform iphonesimulator
  5. rm -rf ~/Library/Developer/Xcode/DerivedData
➜  /Users/okoo/Code/ios git:(master) ✗ rm -rf ~/Library/Developer/Xcode/DerivedData
rm: /Users/okoo/Library/Developer/Xcode/DerivedData/MyProj-exwneyqxzopphodwxkfkatpczygl/Index.noindex/DataStore/v5/records: Permission denied
rm: /Users/okoo/Library/Developer/Xcode/DerivedData/MyProj-exwneyqxzopphodwxkfkatpczygl/Index.noindex/DataStore/v5/units: Permission denied
rm: /Users/okoo/Library/Developer/Xcode/DerivedData/MyProj-exwneyqxzopphodwxkfkatpczygl/Index.noindex/DataStore/v5: Permission denied
rm: /Users/okoo/Library/Developer/Xcode/DerivedData/MyProj-exwneyqxzopphodwxkfkatpczygl/Index.noindex/DataStore: Permission denied
rm: /Users/okoo/Library/Developer/Xcode/DerivedData/MyProj-exwneyqxzopphodwxkfkatpczygl/Index.noindex: Permission denied
rm: /Users/okoo/Library/Developer/Xcode/DerivedData/MyProj-exwneyqxzopphodwxkfkatpczygl: Permission denied
rm: /Users/okoo/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/YH4HN3D4DJSP: Permission denied
rm: /Users/okoo/Library/Developer/Xcode/DerivedData/ModuleCache.noindex: Permission denied
rm: /Users/okoo/Library/Developer/Xcode/DerivedData: Permission denied

Environment

polac24 commented 1 year ago

Hi! Why do you think it is related to XCRemoteCache? Do files have unexpected owner, permissions? Xcode extensively writes to that directory and XCRemoteCache doesn't run any daemons that might write to these locations.

I would double-check that you don't have any Xcode instances running, as that looks like some indexing process (owned by Xcode) is writing to that directory.

OliverKoo commented 1 year ago

Hi! you were right, it was not related to XCRemoteCache it was due to Xcode running indexing when I switch branch! Closing this issue