From unknown Sat Jun 14 00:06:07 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#38112 <38112@debbugs.gnu.org> To: bug#38112 <38112@debbugs.gnu.org> Subject: Status: guile's recompilation does not play well with release builds Reply-To: bug#38112 <38112@debbugs.gnu.org> Date: Sat, 14 Jun 2025 07:06:07 +0000 retitle 38112 guile's recompilation does not play well with release builds reassign 38112 guile submitter 38112 Sergei Trofimovich severity 38112 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 07 18:34:29 2019 Received: (at submit) by debbugs.gnu.org; 7 Nov 2019 23:34:29 +0000 Received: from localhost ([127.0.0.1]:44125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSrIL-0006cK-GQ for submit@debbugs.gnu.org; Thu, 07 Nov 2019 18:34:29 -0500 Received: from lists.gnu.org ([209.51.188.17]:35516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSrIJ-0006cC-F5 for submit@debbugs.gnu.org; Thu, 07 Nov 2019 18:34:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52205) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSrIG-00055Q-W7 for bug-guile@gnu.org; Thu, 07 Nov 2019 18:34:27 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSrIF-0002lD-Bb for bug-guile@gnu.org; Thu, 07 Nov 2019 18:34:24 -0500 Received: from smtp.gentoo.org ([140.211.166.183]:38114) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSrIF-0002jK-5o for bug-guile@gnu.org; Thu, 07 Nov 2019 18:34:23 -0500 Received: from sf (tunnel547699-pt.tunnel.tserv1.lon2.ipv6.he.net [IPv6:2001:470:1f1c:3e6::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: slyfox) by smtp.gentoo.org (Postfix) with ESMTPSA id 266C234CA3A for ; Thu, 7 Nov 2019 23:34:19 +0000 (UTC) Date: Thu, 7 Nov 2019 23:34:17 +0000 From: Sergei Trofimovich To: bug-guile@gnu.org Subject: guile's recompilation does not play well with release builds Message-ID: <20191107233417.5be99aab@sf> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 140.211.166.183 X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) 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