GNU bug report logs - #16314
Macro dependency tracking issue in guile auto compiler

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Severity: wishlist; Reported by: Panicz Maciej Godek <godek.maciek@HIDDEN>; dated Wed, 1 Jan 2014 13:21:01 UTC; Maintainer for guile is bug-guile@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Mark H Weaver <mhw@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 16314 <at> debbugs.gnu.org:


Received: (at 16314) by debbugs.gnu.org; 15 Jan 2014 20:21:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 15 15:21:04 2014
Received: from localhost ([127.0.0.1]:52405 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1W3WxU-0006Zr-As
	for submit <at> debbugs.gnu.org; Wed, 15 Jan 2014 15:21:04 -0500
Received: from world.peace.net ([96.39.62.75]:50095)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <mhw@HIDDEN>)
 id 1W3WxS-0006Ze-6w; Wed, 15 Jan 2014 15:21:02 -0500
Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com
 ([209.6.91.212] helo=yeeloong)
 by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from <mhw@HIDDEN>)
 id 1W3WxM-0004LZ-ER; Wed, 15 Jan 2014 15:20:56 -0500
From: Mark H Weaver <mhw@HIDDEN>
To: Panicz Maciej Godek <godek.maciek@HIDDEN>
Subject: Re: bug#16314: Macro dependency tracking issue in guile auto compiler
References: <CAMFYt2af172w+ORdO-2Piccy_fzhqreanrVdpqVYP2UhmPLw2g@HIDDEN>
Date: Wed, 15 Jan 2014 15:18:34 -0500
In-Reply-To: <CAMFYt2af172w+ORdO-2Piccy_fzhqreanrVdpqVYP2UhmPLw2g@HIDDEN>
 (Panicz Maciej Godek's message of "Wed, 1 Jan 2014 14:19:53 +0100")
Message-ID: <87ha95t2w5.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 16314
Cc: 16314 <at> debbugs.gnu.org, request <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

severity 16314 wishlist
thanks

Panicz Maciej Godek <godek.maciek@HIDDEN> writes:
> I've noticed that if macros are ever used in the process
> of auto-compilation, the dependency is forgotten, so
> even if a module that contains the definition of a macro
> gets recompiled, the module that uses the macro remains
> unchanged.

Yes, this is a known issue.  I agree that it would be nice to improve
this -- perhaps in 2.2 -- but I'm also worried that it might lead to
absurd amounts of needless recompiling, because one often makes minor
changes to modules that export macros, without the macros being changed
at all.

I'm marking this as a "wishlist" item.

     Thanks,
       Mark




Information forwarded to bug-guile@HIDDEN:
bug#16314; Package guile. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Jan 2014 13:20:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 01 08:20:02 2014
Received: from localhost ([127.0.0.1]:55847 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VyLiL-0003jW-17
	for submit <at> debbugs.gnu.org; Wed, 01 Jan 2014 08:20:02 -0500
Received: from eggs.gnu.org ([208.118.235.92]:32769)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <godek.maciek@HIDDEN>) id 1VyLiH-0003jM-K9
 for submit <at> debbugs.gnu.org; Wed, 01 Jan 2014 08:19:58 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <godek.maciek@HIDDEN>) id 1VyLiG-0005dn-G4
 for submit <at> debbugs.gnu.org; Wed, 01 Jan 2014 08:19:57 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:37555)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <godek.maciek@HIDDEN>) id 1VyLiG-0005de-D6
 for submit <at> debbugs.gnu.org; Wed, 01 Jan 2014 08:19:56 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34486)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <godek.maciek@HIDDEN>) id 1VyLiF-0007O6-9U
 for bug-guile@HIDDEN; Wed, 01 Jan 2014 08:19:56 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <godek.maciek@HIDDEN>) id 1VyLiE-0005dL-6C
 for bug-guile@HIDDEN; Wed, 01 Jan 2014 08:19:55 -0500
Received: from mail-we0-x235.google.com ([2a00:1450:400c:c03::235]:56901)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <godek.maciek@HIDDEN>) id 1VyLiD-0005dG-VD
 for bug-guile@HIDDEN; Wed, 01 Jan 2014 08:19:54 -0500
Received: by mail-we0-f181.google.com with SMTP id x55so11834092wes.12
 for <bug-guile@HIDDEN>; Wed, 01 Jan 2014 05:19:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=r7I6NN15vCeqdGG1qvwpCwvfqONu0EdlAKV8x2+7HeM=;
 b=smZHBWBooFNUVbQD0wi8HhzzhKfOUtXdmCzvDWWYsVjeSGXapClrGW0KIpfwoVWxvb
 WxVUkFrFIL5POQ+ROU34tBrUXDhHNzpZp1RUQgmDqTJZVGCqGcii7soSJ+PGJjCd8+13
 dH0G2FaAbLEuYoZmx6m1N4fVFVzxxrL7oKooTLUGRF4Q6GAN+pZ+FRz2vILlGoOZr+aL
 +G3ypoVekrXhdo6U6WDmcMTem28l0wlCcfgMqWKTPt5zWngZJq/HOUSMI0cu2dqtobH9
 fZhEdU29bXZnexofTuo5vjCRkSbhZ7IiSnNIm6hURZ8ZX/hVbZq8uebwUDW/LB6/MztW
 UOVQ==
MIME-Version: 1.0
X-Received: by 10.194.2.108 with SMTP id 12mr1355297wjt.64.1388582393159; Wed,
 01 Jan 2014 05:19:53 -0800 (PST)
Received: by 10.194.178.134 with HTTP; Wed, 1 Jan 2014 05:19:53 -0800 (PST)
Date: Wed, 1 Jan 2014 14:19:53 +0100
Message-ID: <CAMFYt2af172w+ORdO-2Piccy_fzhqreanrVdpqVYP2UhmPLw2g@HIDDEN>
Subject: Macro dependency tracking issue in guile auto compiler
From: Panicz Maciej Godek <godek.maciek@HIDDEN>
To: bug-guile@HIDDEN
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Hi,
I've noticed that if macros are ever used in the process
of auto-compilation, the dependency is forgotten, so
even if a module that contains the definition of a macro
gets recompiled, the module that uses the macro remains
unchanged.

For example, consider the following situation. I have
two modules and a program that uses one of them.
The directory tree looks like this:
.
|-- module
|    |-- master.scm
|    `-- slave.scm
`-- program.scm

The module/master.scm contains the following code:

--8<---------------cut here---------------start------------->8---
(define-module (module master)
  #:export (macro function))

(define-syntax-rule (macro)
  (display "macro expanded"))

(define (function)
  (display "function called"))
--8<---------------cut here---------------end--------------->8---
The module/slave.scm uses the master module:

--8<---------------cut here---------------start------------->8---
(define-module (module slave)
  #:use-module (module master)
  #:export (f))

(define (f)
  (macro))
--8<---------------cut here---------------end--------------->8---

But the program.scm uses only the slave module:

--8<---------------cut here---------------start------------->8---
(use-modules (module slave))

(f)
--8<---------------cut here---------------end--------------->8---

If I run the program, I get the following result:
user cwd $ GUILE_LOAD_PATH=. guile -s program.scm
;;; <auto-compilation of program.scm>
;;; <auto-compilation of module/slave.scm>
;;; <auto-compilation of module/master.scm>
macro expandeduser cwd $

Oops, I forgot to add a trailing newline. But that's no problem!
I edit the body of module/master.scm:
-  (display "macro expanded"))
+  (display "macro expanded!\n"))

and then run the program once again:
user cwd $ GUILE_LOAD_PATH=. guile -s program.scm
;;; <auto-compilation of module/master.scm>
macro expandeduser cwd $

Damn! That didn't work. See the problem? If I modify
a module that exports any syntax definition, it should
force all the modules that use it be recompiled -- otherwise
the auto-compilation feature is only a potential source
of confusion, and forcing recompilation of all user modules
if at least one of them has been modified seems to be
a less confusing default strategy, if a more fine-grained
dependency tracking is too difficult to implement.

I've tested that behaviour under guile 2.0.5, guile-2.0.9,
guile-2.0.9.98-36c40 from hydra and guile-2.1.0.545-61989
from git, and everywhere it worked the same.

Regards,
M.




Acknowledgement sent to Panicz Maciej Godek <godek.maciek@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#16314; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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