unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#10556: (use-modules ) references not found on file system when compiling
@ 2012-01-19 22:27 Ian Hulin
  2012-01-20 22:19 ` Ian Price
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Hulin @ 2012-01-19 22:27 UTC (permalink / raw)
  To: 10556

I am compiling a file which references some modules declared in source
files present in the %load-path.  However I get a "no code for (xxx
yyy)" error when I attempt to compile with guild compile.

Guile version 2.0.3
Ubuntu 11.10

I am running the compilation from a shell command procedure as follows
(the PWD is /home/ian/src/lilypond):
declare -x GUILE_LOAD_COMPILED_PATH='/home/ian/src/lilypond/scm/out'
declare -x GUILE_AUTO_COMPILE=0
guild compile scm/lily-guile2.scm \
--load-path=/home/ian/src/lilypond/scm/ \
--warn=unbound-variable \
--output=scm/out/lily-guile2.go


lily-guile2.scm starts as follows:


(eval-when (compile load eval)
(display "%load-path: ")
(display %load-path) (newline)
(display (%search-load-path "clip-region")) (newline)
(display (%search-load-path "memory-trace")) (newline)
(display (%search-load-path "coverage")) (newline)
(display (%search-load-path "safe-utility-defs")) (newline))

(use-modules (scm clip-region)
             (scm memory-trace)
             (scm coverage)
	     (scm safe-utility-defs))

I've attached the trace-back below.  It looks like the use-modules code
isn't doing the right thing in translating the module name list into a
file system path and file-name (as in 6.19.1 General Information about
Modules, pages 385-386).

Cheers,
Ian Hulin

===================================================================================================

ian@ian-laptop ~/src/lilypond (T1686)$ sh compile-lily.sh
compile-lily.sh: 1: declare: not found
compile-lily.sh: 2: declare: not found
%load-path: (/home/ian/src/lilypond/scm/ /usr/local/share/guile/2.0
/usr/local/share/guile/site/2.0 /usr/local/share/guile/site
/usr/local/share/guile)
/home/ian/src/lilypond/scm/clip-region.scm
/home/ian/src/lilypond/scm/memory-trace.scm
/home/ian/src/lilypond/scm/coverage.scm
/home/ian/src/lilypond/scm/safe-utility-defs.scm
Backtrace:
In scripts/compile.scm:
 174: 19 [#<procedure 97d98a0 at scripts/compile.scm:171:14 (file)>
"scm/lily-guile2.scm"]
In system/base/compile.scm:
 148: 18 [compile-file "scm/lily-guile2.scm" #:output-file ...]
  43: 17 [call-once #<procedure 97d9720 at system/base/compile.scm:56:5 ()>]
In ice-9/boot-9.scm:
 184: 16 [with-throw-handler #t ...]
In system/base/compile.scm:
  59: 15 [#<procedure 97d9700 at system/base/compile.scm:58:9 ()>]
 151: 14 [#<procedure 97d9740 at system/base/compile.scm:149:8 (port)>
#<input-output: scm/out/lily-guile2.go.SmCR1v 41>]
 200: 13 [read-and-compile #<input: lily-guile2.scm 40> #:from ...]
 212: 12 [lp (# #) #<directory # 994fd38> #<directory # 994fd38>]
 178: 11 [lp (#<procedure compile-tree-il (x e opts)>) (use-modules # #
...) ...]
In ice-9/boot-9.scm:
2095: 10 [save-module-excursion #<procedure 996bc78 at
language/scheme/compile-tree-il.scm:29:3 ()>]
In language/scheme/compile-tree-il.scm:
  31: 9 [#<procedure 996bc78 at language/scheme/compile-tree-il.scm:29:3
()>]
In ice-9/psyntax.scm:
1011: 8 [chi-top-sequence ((use-modules # # # ...)) () ((top)) ...]
 898: 7 [scan ((use-modules (scm clip-region) (scm memory-trace) ...))
() ...]
 269: 6 [scan ((# #) #(syntax-object *unspecified* # #)) () (()) ...]
In ice-9/boot-9.scm:
3117: 5 [process-use-modules ((#) (#) (#) (#))]
 538: 4 [map #<procedure 97227f0 at ice-9/boot-9.scm:3117:25 (mif-args)>
(# # # #)]
3118: 3 [#<procedure 97227f0 at ice-9/boot-9.scm:3117:25 (mif-args)> (#)]
2567: 2 [resolve-interface (scm clip-region) #:select ...]
In unknown file:
   ?: 1 [scm-error misc-error #f ...]
In ice-9/boot-9.scm:
 119: 0 [#<procedure 97d96e0 at ice-9/boot-9.scm:110:6 (thrown-k .
args)> misc-error ...]

ice-9/boot-9.scm:119:20: In procedure #<procedure 97d96e0 at
ice-9/boot-9.scm:110:6 (thrown-k . args)>:
ice-9/boot-9.scm:119:20: no code for module (scm clip-region)
ian@ian-laptop ~/src/lilypond (T1686)$






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

* bug#10556: (use-modules ) references not found on file system when compiling
  2012-01-19 22:27 bug#10556: (use-modules ) references not found on file system when compiling Ian Hulin
@ 2012-01-20 22:19 ` Ian Price
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Price @ 2012-01-20 22:19 UTC (permalink / raw)
  To: 10556; +Cc: Ian Hulin, 10556-done

Ian Hulin <ian@hulin.org.uk> writes:

> I am compiling a file which references some modules declared in source
> files present in the %load-path.  However I get a "no code for (xxx
> yyy)" error when I attempt to compile with guild compile.
>
> Guile version 2.0.3
> Ubuntu 11.10
>
> I am running the compilation from a shell command procedure as follows
> (the PWD is /home/ian/src/lilypond):
> declare -x GUILE_LOAD_COMPILED_PATH='/home/ian/src/lilypond/scm/out'
> declare -x GUILE_AUTO_COMPILE=0
> guild compile scm/lily-guile2.scm \
> --load-path=/home/ian/src/lilypond/scm/ \
> --warn=unbound-variable \
> --output=scm/out/lily-guile2.go
>
>
> lily-guile2.scm starts as follows:
>
>
> (eval-when (compile load eval)
> (display "%load-path: ")
> (display %load-path) (newline)
> (display (%search-load-path "clip-region")) (newline)
> (display (%search-load-path "memory-trace")) (newline)
> (display (%search-load-path "coverage")) (newline)
> (display (%search-load-path "safe-utility-defs")) (newline))
>
> (use-modules (scm clip-region)
>              (scm memory-trace)
>              (scm coverage)
> 	     (scm safe-utility-defs))
>
> I've attached the trace-back below.  It looks like the use-modules code
> isn't doing the right thing in translating the module name list into a
> file system path and file-name (as in 6.19.1 General Information about
> Modules, pages 385-386).

This is your mistake, I would say.

Lets see, quoting
https://www.gnu.org/software/guile/manual/html_node/General-Information-about-Modules.html 

To use a module, it must be found and loaded. All Guile modules have a
unique module name, which is a list of one or more symbols. Examples are
(ice-9 popen) or (srfi srfi-11). When Guile searches for the code of a
module, it constructs the name of the file to load by concatenating the
name elements with slashes between the elements and appending a number
of file name extensions from the list %load-extensions (see
Loading). The resulting file name is then searched in all directories in
the variable %load-path (see Build Config). For example, the (ice-9
popen) module would result in the filename ice-9/popen.scm and searched
in the installation directories of Guile and in all other directories in
the load path.

So, for your example, (scm clip-region), it looks for
scm/clip-region.scm in %load-path, or in scheme
(%search-load-path "scm/clip-region")

Which fails to match in your case, because /home/ian/src/lilypond/scm/
is in your path, not /home/ian/src/lilypond/. And hence it will look for 
the existence of a /home/ian/src/lilypond/scm/scm/clip-region.scm. 

My advice is to change your %load-path, or if you prefer, use
(clip-region) instead of (scm clip-region), and so on.

-- 
Ian Price

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"





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

end of thread, other threads:[~2012-01-20 22:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-19 22:27 bug#10556: (use-modules ) references not found on file system when compiling Ian Hulin
2012-01-20 22:19 ` Ian Price

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).