chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Minimize the risks of corruption of chicken-install's cache


From: felix . winkelmann
Subject: Re: [PATCH] Minimize the risks of corruption of chicken-install's cache
Date: Sun, 12 Nov 2023 13:33:57 +0100

> Hi,
> 
> The attached patches minimize the risk of reusing object files in the
> chicken-install cache by different, possibly incompatible, CHICKEN
> versions/builds.
> 
> The first patch ("chicken-install: Reset egg cache when status file does
> not exist") deals with renaming of the so-called status file, which
> happened in 2f6a7221.  chicken-install uses the status file to determine
> when to invalidate the cache.  One problem with the renaming is: if
> chicken-install doesn't find the status file, it will reuse the object
> files in the cache.  This might be problematic in case the object files
> are used by incompatible CHICKENs (e.g., incompatible CHICKEN versions,
> CHICKENs compiled with different C compilers).
> 
> That patch solves the problem of CHICKENs newer than 2f6a7221 reusing
> possibly incompatible cached object files produced by CHICKENs older
> than 2f6a7221.  It doesn't solve the problem of older CHICKENs (i.e.,
> the ones compiled with the submitted patch) reusing possibly
> incompatible cached object files produced by CHICKENs newer than
> 2f6a7221.  In those cases, the older CHICKEN will NOT recognize the new
> status file name (_STATUS) and will proceed to reuse the possibly
> incompatible object files.

Thanks, Mario. I'll push it in a few moments.

> 
> To address _that_ problem, a second patch is attached ("egg-environment:
> Add chicken version to the path to chicken-install's cache").  It simply
> adds the CHICKEN version to the path to the chicken-install cache, so
> that older CHICKENs won't look for cached objects in the cache produced
> by newer CHICKENs.
> 

I would suggest to use the binary version instead of the full CHICKEN version. 
It is specifically meant to handle such issues and reduces the amount
of wasted space that will be the result when one frequently updates ones
CHICKEN installation. 

On the other hand, the whole cache validation logic was implemented to 
specifically 
address this problem. The renaming of the status file was probably a mistake
(or at least short sighted) and results in the headaches that you are now
kindly trying to fix, but apart from that, we already try very hard to keep
the cache's contents only when really needed. Just duplicating the cache
somehow appears like a crude measure. It's just a cache, we can, after all,
just purge it.


felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]