GNU bug report logs - #38112
guile's recompilation does not play well with release builds

Previous Next

Package: guile;

Reported by: Sergei Trofimovich <slyfox <at> gentoo.org>

Date: Thu, 7 Nov 2019 23:35:02 UTC

Severity: normal

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sergei Trofimovich <slyfox <at> gentoo.org>
To: bug-guile <at> gnu.org
Subject: guile's recompilation does not play well with release builds
Date: Thu, 7 Nov 2019 23:34:17 +0000
I'll start from a failure where I found it out.

What I observed:
  I had guix-0.13 installed systemwide. Then I attempted to install
  guix-0.14 by unpacking/building it Bbuild failed with obscure errors
  about missing required functions

Why I think it failed:
  When guix-0.13 was built and installed among other things my system
  got compiled file as:
    '/usr/lib64/guile/2.2/site-ccache/guix/modules.go'

  When I unpacked guix-0.14 it's source file timestamps were preserved
  by unpack process. Specifically 'guix/modules.scm' was older than system's
  '/usr/lib64/guile/2.2/site-ccache/guix/modules.go'

  As a result guix build attempted to pull in parts of 0.13 release into 0.14
  build process.

  It looks like the main problem is in libguile/load.c:compiled_is_fresh():
    https://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=libguile/load.c;h=e95c36db1d670f0c7091aba080e21deb53bbab4f;hb=HEAD#l558

   567   if (source_mtime.tv_sec < compiled_mtime.tv_sec
   568       || (source_mtime.tv_sec == compiled_mtime.tv_sec
   569           && source_mtime.tv_nsec <= compiled_mtime.tv_nsec))
   570     compiled_is_newer = 1;

  Here 'mtime(.scm) < mtime(.go)' is enough to avoid recompilation.

The workaround:
  Currently Gentoo just 'touch'es source tarball at unpacking time to guarantee
  the rebuild as:
    https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=651f557f9302d29aa0de5ea10ef4e575b686fb21

  It is unfortunate and would require changing every package.

  The build failure is easily reproducible. I can try to craft artificial example
  to ease debugging if needed.

Probable fix:
  I think guile should embed/check more data about source file to hit the cache.
  The examples would be:
  1. size of source file
  2. hash of source file contents
  3. hash of parsed source file
  4. use 'mtime(.scm) == mtime(.go)' as a cache hit hint (would require faking
    mtime on a .go file)

Thank you!

-- 

  Sergei




This bug report was last modified 5 years and 220 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.