unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: tcl: Avoid a circular dependency.
@ 2013-06-05 12:49 Nikita Karetnikov
  2013-06-05 21:36 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Nikita Karetnikov @ 2013-06-05 12:49 UTC (permalink / raw)
  To: bug-guix


[-- Attachment #1.1: Type: text/plain, Size: 1706 bytes --]

You'll get the following error if you run 'git pull && make clean &&
make'.  Feel free to push if the patch is OK.

Backtrace:
In ice-9/boot-9.scm:
3001: 19 [#<procedure a77a7f8 at ice-9/boot-9.scm:2982:17 ()>]
In unknown file:
   ?: 18 [primitive-load-path "gnu/packages/ghostscript" ...]
In gnu/packages/ghostscript.scm:
  19: 17 [#<procedure a665e50 ()>]
In ice-9/boot-9.scm:
2870: 16 [define-module* (gnu packages ghostscript) #:filename ...]
2845: 15 [resolve-imports ((#) (#) (#) (#) ...)]
2783: 14 [resolve-interface (gnu packages tcl) #:select ...]
2708: 13 [#<procedure a159ea0 at ice-9/boot-9.scm:2696:4 (name #:optional autoload version #:key ensure)> # ...]
2981: 12 [try-module-autoload (gnu packages tcl) #f]
2320: 11 [save-module-excursion #<procedure a787390 at ice-9/boot-9.scm:2982:17 ()>]
3001: 10 [#<procedure a787390 at ice-9/boot-9.scm:2982:17 ()>]
In unknown file:
   ?: 9 [primitive-load-path "gnu/packages/tcl" ...]
In ice-9/eval.scm:
 432: 8 [eval # ()]
 453: 7 [eval # ()]
 432: 6 [eval # #]
 436: 5 [eval # #]
 387: 4 [eval # #]
 387: 3 [eval # #]
 393: 2 [eval #<memoized libx11> (#<undefined> #<undefined> #<undefined> ...)]
In unknown file:
   ?: 1 [memoize-variable-access! #<memoized libx11> #<directory # a7eee10>]
In ice-9/boot-9.scm:
 106: 0 [#<procedure a28e360 at ice-9/boot-9.scm:97:6 (thrown-k . args)> unbound-variable ...]

ice-9/boot-9.scm:106:20: In procedure #<procedure a28e360 at ice-9/boot-9.scm:97:6 (thrown-k . args)>:
ice-9/boot-9.scm:106:20: Unbound variable: libx11
make[2]: *** [gnu/packages/cflow.go] Error 1
make[2]: Leaving directory `/home/guix'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/guix'
make: *** [all] Error 2


[-- Attachment #1.2: 0001-gnu-tcl-Avoid-a-circular-dependency.patch --]
[-- Type: text/x-diff, Size: 6157 bytes --]

From 5c55c8ec6951864b46f9436f87ae31ff16fe825d Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov <nikita@karetnikov.org>
Date: Wed, 5 Jun 2013 11:54:19 +0000
Subject: [PATCH] gnu: tcl: Avoid a circular dependency.

* gnu/packages/tcl.scm: Remove 'tk'.
* gnu/packages/tk.scm: Move 'tk' to this file.
* gnu/packages/wordnet.scm: Import (gnu packages tk).
* Makefile.am (MODULES): Add 'gnu/packages/tk.scm'.
---
 Makefile.am              |    1 +
 gnu/packages/tcl.scm     |   38 ---------------------------
 gnu/packages/tk.scm      |   63 ++++++++++++++++++++++++++++++++++++++++++++++
 gnu/packages/wordnet.scm |    3 +-
 4 files changed, 66 insertions(+), 39 deletions(-)
 create mode 100644 gnu/packages/tk.scm

diff --git a/Makefile.am b/Makefile.am
index 9f106a2..8da4c46 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -192,6 +192,7 @@ MODULES =					\
   gnu/packages/texinfo.scm			\
   gnu/packages/texlive.scm			\
   gnu/packages/time.scm				\
+  gnu/packages/tk.scm				\
   gnu/packages/tmux.scm				\
   gnu/packages/tor.scm				\
   gnu/packages/unrtf.scm			\
diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
index d025bff..3324d7b 100644
--- a/gnu/packages/tcl.scm
+++ b/gnu/packages/tcl.scm
@@ -20,7 +20,6 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
-  #:use-module (gnu packages xorg)
   #:use-module (guix licenses))
 
 (define-public tcl
@@ -117,40 +116,3 @@ applications. And by adding Tk, you can wrap interactive applications in
 X11 GUIs.")
     (license public-domain)))            ; as written in `license.terms'
 
-(define-public tk
-  (package
-    (name "tk")
-    (version "8.6.0")
-    (source (origin
-             (method url-fetch)
-             (uri (string-append "mirror://sourceforge/tcl/Tcl/"
-                                 version "/tk" version "-src.tar.gz"))
-             (sha256
-              (base32
-               "1rld0l7p1h31z488w44j170jpsm11xsjf2qrb7gid2b5dwmqnw2w"))))
-    (build-system gnu-build-system)
-    (arguments
-     '(#:phases (alist-cons-before
-                 'configure 'pre-configure
-                 (lambda _
-                   (chdir "unix"))
-                 %standard-phases)
-
-       #:configure-flags (list (string-append "--with-tcl="
-                                              (assoc-ref %build-inputs "tcl")
-                                              "/lib"))
-
-       ;; The tests require a running X server, so we just skip them.
-       #:tests? #f))
-    (inputs `(("tcl" ,tcl)))
-
-    ;; tk.h refers to X11 headers, hence the propagation.
-    (propagated-inputs `(("libx11" ,libx11)
-                         ("libxext" ,libxext)))
-
-    (home-page "http://www.tcl.tk/")
-    (synopsis "Graphical user interface toolkit for Tcl")
-    (description
-     "Tk is a graphical toolkit for building graphical user interfaces
-(GUIs) in the Tcl language.")
-    (license (package-license tcl))))
diff --git a/gnu/packages/tk.scm b/gnu/packages/tk.scm
new file mode 100644
index 0000000..446e2cb
--- /dev/null
+++ b/gnu/packages/tk.scm
@@ -0,0 +1,63 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages tk)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages tcl)
+  #:use-module (gnu packages xorg)
+  #:use-module (guix licenses))
+
+(define-public tk
+  (package
+    (name "tk")
+    (version "8.6.0")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append "mirror://sourceforge/tcl/Tcl/"
+                                 version "/tk" version "-src.tar.gz"))
+             (sha256
+              (base32
+               "1rld0l7p1h31z488w44j170jpsm11xsjf2qrb7gid2b5dwmqnw2w"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:phases (alist-cons-before
+                 'configure 'pre-configure
+                 (lambda _
+                   (chdir "unix"))
+                 %standard-phases)
+
+       #:configure-flags (list (string-append "--with-tcl="
+                                              (assoc-ref %build-inputs "tcl")
+                                              "/lib"))
+
+       ;; The tests require a running X server, so we just skip them.
+       #:tests? #f))
+    (inputs `(("tcl" ,tcl)))
+
+    ;; tk.h refers to X11 headers, hence the propagation.
+    (propagated-inputs `(("libx11" ,libx11)
+                         ("libxext" ,libxext)))
+
+    (home-page "http://www.tcl.tk/")
+    (synopsis "Graphical user interface toolkit for Tcl")
+    (description
+     "Tk is a graphical toolkit for building graphical user interfaces
+(GUIs) in the Tcl language.")
+    (license (package-license tcl))))
\ No newline at end of file
diff --git a/gnu/packages/wordnet.scm b/gnu/packages/wordnet.scm
index cb385d4..151ad67 100644
--- a/gnu/packages/wordnet.scm
+++ b/gnu/packages/wordnet.scm
@@ -21,7 +21,8 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix licenses)
   #:use-module (guix download)
-  #:use-module (gnu packages tcl))
+  #:use-module (gnu packages tcl)
+  #:use-module (gnu packages tk))
 
 (define-public wordnet
   (package
-- 
1.7.5.4


[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: tcl: Avoid a circular dependency.
  2013-06-05 12:49 [PATCH] gnu: tcl: Avoid a circular dependency Nikita Karetnikov
@ 2013-06-05 21:36 ` Ludovic Courtès
  2013-06-05 22:05   ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2013-06-05 21:36 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> skribis:

> You'll get the following error if you run 'git pull && make clean &&
> make'.  Feel free to push if the patch is OK.

Arrgh, good catch.

This is getting annoying.  I will instead push something along these
lines shortly:

--8<---------------cut here---------------start------------->8---
diff --git a/guix/packages.scm b/guix/packages.scm
index 4f8d87e..bb46131 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -147,7 +147,7 @@ corresponds to the arguments expected by `set-path-environment-variable'."
   (inputs package-inputs                  ; input packages or derivations
           (default '()) (thunked))
   (propagated-inputs package-propagated-inputs    ; same, but propagated
-                     (default '()))
+                     (default '()) (thunked))
   (native-inputs package-native-inputs    ; native input packages/derivations
                  (default '()) (thunked))
   (self-native-input? package-self-native-input?  ; whether to use itself as
--8<---------------cut here---------------end--------------->8---

That will allow us to have circular dependencies among modules.

This is because Guile supports this:

  (define-module (a) #:use-module (b) #:export (foo))
  (define (foo) (bar))

and

  (define-module (b) #:use-module (a) #:export (bar))
  (define (bar) (foo))

... but not if ‘foo’ or ‘bar’ were directly referring to each other at
the top level, as in (define foo bar).

Thanks,
Ludo’.

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: tcl: Avoid a circular dependency.
  2013-06-05 21:36 ` Ludovic Courtès
@ 2013-06-05 22:05   ` Ludovic Courtès
  2013-06-07  3:59     ` Nikita Karetnikov
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2013-06-05 22:05 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

ludo@gnu.org (Ludovic Courtès) skribis:

> This is getting annoying.  I will instead push something along these
> lines shortly:
>
> diff --git a/guix/packages.scm b/guix/packages.scm
> index 4f8d87e..bb46131 100644
> --- a/guix/packages.scm
> +++ b/guix/packages.scm
> @@ -147,7 +147,7 @@ corresponds to the arguments expected by `set-path-environment-variable'."
>    (inputs package-inputs                  ; input packages or derivations
>            (default '()) (thunked))
>    (propagated-inputs package-propagated-inputs    ; same, but propagated
> -                     (default '()))
> +                     (default '()) (thunked))
>    (native-inputs package-native-inputs    ; native input packages/derivations
>                   (default '()) (thunked))
>    (self-native-input? package-self-native-input?  ; whether to use itself as
>
> That will allow us to have circular dependencies among modules.

Pushed as 9d97a1b.  Since this changes the ABI, make sure to run
‘make clean && make’ after ‘git pull’.

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: tcl: Avoid a circular dependency.
  2013-06-05 22:05   ` Ludovic Courtès
@ 2013-06-07  3:59     ` Nikita Karetnikov
  2013-06-07 13:00       ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Nikita Karetnikov @ 2013-06-07  3:59 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guix

[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]

> Pushed as 9d97a1b.  Since this changes the ABI, make sure to run
> ‘make clean && make’ after ‘git pull’.

Here is the output:

Backtrace:
In ice-9/eval.scm:
 411: 19 [eval # ()]
In ice-9/boot-9.scm:
2870: 18 [define-module* (gnu packages tcl) #:filename ...]
2845: 17 [resolve-imports ((#) (#) (#) (#) ...)]
2783: 16 [resolve-interface (gnu packages xorg) #:select ...]
2708: 15 [#<procedure a062ea0 at ice-9/boot-9.scm:2696:4 (name #:optional autoload version #:key ensure)> # ...]
2981: 14 [try-module-autoload (gnu packages xorg) #f]
2320: 13 [save-module-excursion #<procedure a751f60 at ice-9/boot-9.scm:2982:17 ()>]
3001: 12 [#<procedure a751f60 at ice-9/boot-9.scm:2982:17 ()>]
In unknown file:
   ?: 11 [primitive-load-path "gnu/packages/xorg" ...]
In gnu/packages/xorg.scm:
  19: 10 [#<procedure a3c5470 ()>]
In ice-9/boot-9.scm:
2870: 9 [define-module* (gnu packages xorg) #:filename ...]
2845: 8 [resolve-imports (# # # # ...)]
2783: 7 [resolve-interface (gnu packages glib) #:select ...]
2708: 6 [#<procedure a062ea0 at ice-9/boot-9.scm:2696:4 (name #:optional autoload version #:key ensure)> # ...]
2981: 5 [try-module-autoload (gnu packages glib) #f]
2320: 4 [save-module-excursion #<procedure a7559f0 at ice-9/boot-9.scm:2982:17 ()>]
3001: 3 [#<procedure a7559f0 at ice-9/boot-9.scm:2982:17 ()>]
In unknown file:
   ?: 2 [primitive-load-path "gnu/packages/glib" ...]
In gnu/packages/glib.scm:
 146: 1 [#<procedure a77cbc0 ()>]
In ice-9/boot-9.scm:
 106: 0 [#<procedure a194360 at ice-9/boot-9.scm:97:6 (thrown-k . args)> unbound-variable ...]

ice-9/boot-9.scm:106:20: In procedure #<procedure a194360 at ice-9/boot-9.scm:97:6 (thrown-k . args)>:
ice-9/boot-9.scm:106:20: In procedure module-lookup: Unbound variable: perl-xml-parser
make[2]: *** [gnu/packages/fontutils.go] Error 1
make[2]: Leaving directory `/home/guix'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/guix'
make: *** [all] Error 2

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: tcl: Avoid a circular dependency.
  2013-06-07  3:59     ` Nikita Karetnikov
@ 2013-06-07 13:00       ` Ludovic Courtès
  2013-06-07 14:06         ` Nikita Karetnikov
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2013-06-07 13:00 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>> Pushed as 9d97a1b.  Since this changes the ABI, make sure to run
>> ‘make clean && make’ after ‘git pull’.
>
> Here is the output:
>
> Backtrace:
> In ice-9/eval.scm:
>  411: 19 [eval # ()]
> In ice-9/boot-9.scm:
> 2870: 18 [define-module* (gnu packages tcl) #:filename ...]
> 2845: 17 [resolve-imports ((#) (#) (#) (#) ...)]
> 2783: 16 [resolve-interface (gnu packages xorg) #:select ...]
> 2708: 15 [#<procedure a062ea0 at ice-9/boot-9.scm:2696:4 (name #:optional autoload version #:key ensure)> # ...]
> 2981: 14 [try-module-autoload (gnu packages xorg) #f]

[...]

> ice-9/boot-9.scm:106:20: In procedure #<procedure a194360 at ice-9/boot-9.scm:97:6 (thrown-k . args)>:
> ice-9/boot-9.scm:106:20: In procedure module-lookup: Unbound variable: perl-xml-parser
> make[2]: *** [gnu/packages/fontutils.go] Error 1

I can’t reproduce it.

However, I’ve observed that Guile’s auto-compilation cache seems to take
precedence sometimes, though I haven’t investigated yet.

Can you run ‘rm -rf ~/.cache/guile/ccache’, and then ‘make clean &&
make’ again?

Note that ‘guix pull’, which does a fresh recompilation of the whole
thing, doesn’t show the problem either.

TIA,
Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: tcl: Avoid a circular dependency.
  2013-06-07 13:00       ` Ludovic Courtès
@ 2013-06-07 14:06         ` Nikita Karetnikov
  2013-06-07 16:05           ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Nikita Karetnikov @ 2013-06-07 14:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guix

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

> However, I’ve observed that Guile’s auto-compilation cache seems to take
> precedence sometimes, though I haven’t investigated yet.

Could you explain when?  And when should I clean it?

> Can you run ‘rm -rf ~/.cache/guile/ccache’, and then ‘make clean &&
> make’ again?

Yes, this solved the problem.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: tcl: Avoid a circular dependency.
  2013-06-07 14:06         ` Nikita Karetnikov
@ 2013-06-07 16:05           ` Ludovic Courtès
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2013-06-07 16:05 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>> However, I’ve observed that Guile’s auto-compilation cache seems to take
>> precedence sometimes, though I haven’t investigated yet.
>
> Could you explain when?  And when should I clean it?

Normally you should never it to explicitly clean it, but it seems
there’s a bug in Guile or in Guix’s build system that makes it take
precedence over the srcdir/builddir .scm and .go files.

I’ll see if I can nail it down.

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-07 16:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-05 12:49 [PATCH] gnu: tcl: Avoid a circular dependency Nikita Karetnikov
2013-06-05 21:36 ` Ludovic Courtès
2013-06-05 22:05   ` Ludovic Courtès
2013-06-07  3:59     ` Nikita Karetnikov
2013-06-07 13:00       ` Ludovic Courtès
2013-06-07 14:06         ` Nikita Karetnikov
2013-06-07 16:05           ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).