Re: [PATCH] git-svn: Destroy the cache when we fail to read it
- From
- Eric Wong <normalperson@yhbt.net>
- Date
- Aug 23, 2011, 19:58 UTC
- Message-ID
- <20110823195837.GA10935@dcvr.yhbt.net>
- In-Reply-To
- <7vobzgrrbg.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
> Eric Wong <normalperson@yhbt.net> writes:
> > Jason Gross <jgross@MIT.EDU> wrote:
> >> my $cache_path = "$ENV{GIT_DIR}/svn/.caches/";
> >
> > Can we make the caches sharable by encoding variables like
> > $Config{use64bitint} and $Storable::VERSION into $cache_path?
> >
> > Something like this (untested):
> >
> > use Config;
> >
> > my $cache_path = "$ENV{GIT_DIR}/svn/.caches/";
> > $cache_path .= "$Config{use64bitint}.$Storable::VERSION/";
> >
> > We'll blow everybody's cache away once during the git-svn upgrade, but
> > in the future people will be able to share the same working tree between
> > different versions of perl/Storable/whatnot without needing extra code
> > to detect croaks, different build options, and nuking each other's
> > caches.
>
> Meaning multiple directories and people share with those with systems with
> similar characteristics?Yes.
Show 6 quoted lines
> It certainly is better than silently getting confused or barfing when > reading 32LE data on 64BE box, and presumably it would be easy to > implement, but is that the best we can do with memoize? > > I am wondering if memoize can be told to use a platform independent > serializer backend that is reasonably efficient.
Storable nstore only guarantees endian-neutrality. JSON/YAML/XML are all platform-neutral options but (AFAIK) none are standard parts of all Perl versions we support. There's Data::Dumper + eval which should work, but a Memoize::* interface needs to be implemented/imported.
-- Eric Wong