[cfarm-users] gcc104: rosetta and disk space concerns

Jacob Bachmeyer jcb62281 at gmail.com
Mon Oct 31 21:35:33 CET 2022


Zach van Rijn wrote:
> On Sun, 2022-10-30 at 21:43 -0500, Jacob Bachmeyer wrote:
> [...]
>   
>> and could we thereby link the cached artifacts back to their
>> original binaries and then quickly remove artifacts that derive
>> from binaries that are no longer on the system?  (An hourly
>> cron job ought to serve nicely here.)  Purging pre-translated
>> "shadow" copies of erased binaries also sounds like something
>> Rosetta should do on its own;
>>     
>
> Are you suggesting scanning the disk for x86_64 binaries, then
> matching them to translated .aot files, and then removing .aot
> files which do not have a corresponding parent binary?
>
> That would, in my opinion, be unnecessarily expensive/invasive.
>   

That would indeed be somewhat expensive, since the scan would need to 
compute SHA256 hashes of ??? for every executable, but there is an 
easier way focused on the cache implied in 
<URL:https://ffri.github.io/ProjectChampollion/part2/#feature-of-rosetta-2-runtime-parsing-aot-files-a-new-command-lc_aot_metadata>:  
each cache file apparently contains the full filename of its parent 
executable referenced from a Mach-O header entry, so all you would need 
to do is extract that filename and check if that file still exists and 
has an mtime older than the cache entry.  If not, delete the cache entry.

I was hoping there would be something like this that would make the job 
easy.  It looks like there is, but you will need to parse Mach-O headers 
to get it.

> [...]
>   
>> have you tried complaining to Apple about this?
>>     
>
> No, but I will reach out to a few contacts there to see if there
> is a known workaround since this issue is sure to affect more
> than a few people. With Rosetta and SIP enabled, won't your disk
> fill up if you don't do this type of maintenance? By design???
>   

I suspect that the intended use is only for running published binaries, 
so the set of Rosetta translation artifacts would be bounded.


-- Jacob


More information about the cfarm-users mailing list