Opened 11 months ago

Last modified 11 months ago

#67592 new enhancement

Prevent creation of CoreSimulator caches

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by:
Priority: Normal Milestone: MacPorts Future
Component: base Version: 2.8.1
Keywords: Cc: mascguy (Christopher Nielsen)
Port:

Description

With Xcode 12.2 or later (or possibly 12 or later, but definitely not with 11.x or earlier versions), something (presumably at least some instances of running xcodebuild) causes CoreSimulator caches to be created in Library/Developer/CoreSimulator/Caches (where this may be the Library folder in the user's home directory or the root user's home directory or the MacPorts home directory). These caches enable the simulator to run non-macOS (iOS, iPadOS, tvOS, watchOS) software. As such, we have no use for them in MacPorts. These caches are specific to the versions of the non-macOS operating systems supported by the installed version of Xcode. Upgrading Xcode causes new versions of the caches to eventually be created while the previous ones are not automatically removed. These caches are several GiB in size and multiple copies of the caches can get created, in each of several Library folders. The presence of these large unneeded files has been responsible for numerous instances of buildbot builds failing due to lack of disk space. MacPorts base should prevent the creation of these useless cache files.

I reported this problem to Apple in FB9072613 and they advised that the creation of the cache files can be prevented by using:

defaults write com.apple.CoreSimulator DisableDyldSharedCache 1

I've done this on the buildbot workers and copied $HOME/Library/Preferences/com.apple.CoreSimulator.plist to /opt/local/var/macports/home/Library/Preferences and /opt/bblocal/var/macports/home/Library/Preferences and will see if this prevents the caches from being recreated during the use of MacPorts. If not, MacPorts base may need to copy it to ${workpath}/.home/Library/Preferences like it already does for com.apple.dt.Xcode.plist.

Change History (2)

comment:1 Changed 11 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:2 in reply to:  description Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

will see if this prevents the caches from being recreated

It does not.

Note: See TracTickets for help on using tickets.