From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Sergei Trofimovich Newsgroups: gmane.lisp.guile.bugs Subject: bug#38112: guile's recompilation does not play well with release builds Date: Thu, 7 Nov 2019 23:34:17 +0000 Message-ID: <20191107233417.5be99aab@sf> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="174354"; mail-complaints-to="usenet@blaine.gmane.org" To: 38112@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Nov 08 00:35:34 2019 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iSrJN-000jCa-UD for guile-bugs@m.gmane.org; Fri, 08 Nov 2019 00:35:34 +0100 Original-Received: from localhost ([::1]:48790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSrJM-0005bU-Ob for guile-bugs@m.gmane.org; Thu, 07 Nov 2019 18:35:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52580) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSrIu-0005QO-OS for bug-guile@gnu.org; Thu, 07 Nov 2019 18:35:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSrIs-0003Ko-OZ for bug-guile@gnu.org; Thu, 07 Nov 2019 18:35:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35304) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSrIs-0003KI-FJ for bug-guile@gnu.org; Thu, 07 Nov 2019 18:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iSrIs-0006dB-8v for bug-guile@gnu.org; Thu, 07 Nov 2019 18:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sergei Trofimovich Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 07 Nov 2019 23:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38112 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.157316966925444 (code B ref -1); Thu, 07 Nov 2019 23:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Nov 2019 23:34:29 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9442 Archived-At: 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