From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.bugs Subject: bug#16314: Macro dependency tracking issue in guile auto compiler Date: Wed, 1 Jan 2014 14:19:53 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1388582462 13230 80.91.229.3 (1 Jan 2014 13:21:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jan 2014 13:21:02 +0000 (UTC) To: 16314@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Jan 01 14:21:07 2014 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VyLjP-0006S4-6O for guile-bugs@m.gmane.org; Wed, 01 Jan 2014 14:21:07 +0100 Original-Received: from localhost ([::1]:41363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyLjO-0007fL-O7 for guile-bugs@m.gmane.org; Wed, 01 Jan 2014 08:21:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyLjL-0007fG-UD for bug-guile@gnu.org; Wed, 01 Jan 2014 08:21:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VyLjK-00067n-VX for bug-guile@gnu.org; Wed, 01 Jan 2014 08:21:03 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyLjK-00067j-R5 for bug-guile@gnu.org; Wed, 01 Jan 2014 08:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VyLjJ-0003lZ-Tc for bug-guile@gnu.org; Wed, 01 Jan 2014 08:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Panicz Maciej Godek Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 01 Jan 2014 13:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16314 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138858240214380 (code B ref -1); Wed, 01 Jan 2014 13:21:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Jan 2014 13:20:02 +0000 Original-Received: from localhost ([127.0.0.1]:55847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VyLiL-0003jW-17 for submit@debbugs.gnu.org; Wed, 01 Jan 2014 08:20:02 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:32769) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VyLiH-0003jM-K9 for submit@debbugs.gnu.org; Wed, 01 Jan 2014 08:19:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VyLiG-0005dn-G4 for submit@debbugs.gnu.org; Wed, 01 Jan 2014 08:19:57 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:37555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyLiG-0005de-D6 for submit@debbugs.gnu.org; Wed, 01 Jan 2014 08:19:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyLiF-0007O6-9U for bug-guile@gnu.org; Wed, 01 Jan 2014 08:19:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VyLiE-0005dL-6C for bug-guile@gnu.org; Wed, 01 Jan 2014 08:19:55 -0500 Original-Received: from mail-we0-x235.google.com ([2a00:1450:400c:c03::235]:56901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyLiD-0005dG-VD for bug-guile@gnu.org; Wed, 01 Jan 2014 08:19:54 -0500 Original-Received: by mail-we0-f181.google.com with SMTP id x55so11834092wes.12 for ; 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== X-Received: by 10.194.2.108 with SMTP id 12mr1355297wjt.64.1388582393159; Wed, 01 Jan 2014 05:19:53 -0800 (PST) Original-Received: by 10.194.178.134 with HTTP; Wed, 1 Jan 2014 05:19:53 -0800 (PST) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7366 Archived-At: 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 ;;; ;;; ;;; 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 ;;; 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.