[Top][All Lists]

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

bug#38112: guile's recompilation does not play well with release builds

From: Sergei Trofimovich
Subject: bug#38112: 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:

  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

  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():

   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:

  It is unfortunate and would require changing every package.

  The build failure is easily reproducible. I can try to craft artificial 
  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!



reply via email to

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