chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] chicken-install -deploy and unbound variables


From: Norman Gray
Subject: Re: [Chicken-users] chicken-install -deploy and unbound variables
Date: Sat, 04 Feb 2017 15:38:43 +0000


Greetings.

On 3 Feb 2017, at 22:07, Norman Gray wrote:

Using chicken-install -deploy, to build a simple program with modules, fails for me in a rather perplexing way. Transcript below (Makefile output).

I've made progress with this, and I've now got deployment working (I think), after a huge amount of flailing around.

For reference, the sequence is as below. This is on OS X 10.11, with Chicken 4.11.0.

1. install required extensions system-wide (only required once)

2. deploy required extensions

    mkdir prog
    chicken-install -deploy -p prog foo
    chicken-install -deploy -p prog bar
    ...

3. Write stub .setup and .meta files for the per-project modules, even though they're not intended to be distributed as eggs. Sufficient contents for these are:

    echo '(standard-extension "foo")' >foo.setup
    echo '((files "foo.scm" "foo.setup"))' >foo.meta

4. deploy per-project modules

    for mod in mod1.setup mod2.setup; do
      rm -f *.so
      chicken-install -deploy -prefix prog $mod
    done

5. deploy the main program

    rm -f *.so
    chicken-install -deploy prog.scm

(the directory 'prog' must match the name 'prog.scm')

The steps 'rm -f *.so' are crucial. If there are any .so files in the build directory (they appear to be left behind by the chicken-install step), then chicken-install becomes _terribly_ confused, and I suspect this is the source of the 'unbound variable: |<hex...>|' error. That's another error message which could perhaps work on its communication skills.

This also, I think, means that plain 'chicken-install -deploy -prefix prog' fails, with the same error, because it gets confused in the same way. I've shown an example of this failing, at the bottom of this message.

I think one underlying problem is that the error messages look like crashes -- they're stack traces -- which suggests that the problem is something much more substantial than it is. And when they're finally interpreted as mere dependency/path problems, they're rather non-specific, or in the case of a hex-values unbound variable, incomprehensible to the point of fury. I'm thinking of the unbound variable error, and that reported in <https://bugs.call-cc.org/ticket/1287>; the error 'Error: (require) cannot load extension: spiffy ... Call history: ... luggage.scm:2: ##sys#require', produced at runtime when the extension library has been installed in the wrong place in the deployment directory, is intelligible, but could perhaps give more hints about where it was looking.

There _may_ also be a failure of dependency calculation in 'chicken-install -deploy -prefix prog', because I think I saw this trying to deploy per-project modules in an order contrary to that declared in the *.meta files. However I don't really want to try to reproduce that, now.

I know from experience that there's not a lot of opportunity for fancy error checking and reporting when one is loading dynamic libraries -- aren't loaders fun?

The documentation at <http://wiki.call-cc.org/man/4/Deployment> is not inaccurate, and does make sense after one understands the deployment process.

I've given up on trying to build *.c files -- maybe with the Chicken 5 compiler support.

So, Chicken program no. 1: done.  Phew.

Best wishes,

Norman


----

The business with the local repository, in the previous message, was actually a red herring. But...

The paragraph starting 'There is one restriction that you should be aware of...' in <http://wiki.call-cc.org/man/4/Deployment> can be read as suggesting that even per-project modules must be installed in a repository (which means a local repository, if they're per-project modules). That wasn't my first interpretation, but I tried it because nothing else seemed to be working.

An important point re that is that CHICKEN_REPOSITORY MUST be UNset before the invocation of chicken-install -init (the page at <http://wiki.call-cc.org/man/4/Extensions> shows these in the correct order, but doesn't indicate that this is essential, rather than merely tidy. The error message when this variable is already set is highly unilluminating. I would have guessed that chicken-install would most naturally have taken the initialising modules from its own installation location, carefully ignoring the CHICKEN_REPOSITORY environment variable. I'm happy to write this up as a bug if this behaviour is not deliberate.

Also, the page <http://wiki.call-cc.org/man/4/Extensions> suggests lib/chicken/6/ as the path to the local repository; it appears that this should be lib/chicken/8 instead.








Trying to use 'chicken-install -deploy -prefix <dir>' with a collection of .setup files in the current directory.

% rm -f *.so
% /Data/tools/chicken-4.11.0/bin/chicken-install -deploy -prefix luggage
retrieving ...
checking platform for `datetime' ...
checking dependencies for `datetime' ...
checking platform for `db' ...
checking dependencies for `db' ...
 missing: util
retrieving ...
checking platform for `util' ...
checking dependencies for `util' ...
checking platform for `server' ...
checking dependencies for `server' ...
 missing: db, util, datetime, static-content
retrieving ...
checking platform for `static-content' ...
checking dependencies for `static-content' ...
install order:
("static-content" "util" "db" "datetime" "server")
installing static-content: ...
changing current directory to .
'/Data/tools/chicken-4.11.0/bin/csi' -bnq -e "(require-library setup-api)" -e "(import setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version '(\"static-content\" \"\"))" -e "(destination-prefix \"/checkouts/itm/luggage/src/luggage\")" -e "(runtime-prefix \"/checkouts/itm/luggage/src/luggage\")" -e "(deployment-mode #t)" 'static-content.setup' '/Data/tools/chicken-4.11.0/bin/csc' -feature compiling-extension -deployed -dynamic -optimize-level 3 -debug-level 1 static-content.scm -emit-import-library static-content '/Data/tools/chicken-4.11.0/bin/csc' -feature compiling-extension -deployed -dynamic -optimize-level 3 -debug-level 0 static-content.import.scm cp -r 'static-content.so' '/checkouts/itm/luggage/src/luggage/static-content.so'
  chmod a+r '/checkouts/itm/luggage/src/luggage/static-content.so'
cp -r 'static-content.import.so' '/checkouts/itm/luggage/src/luggage/static-content.import.so' chmod a+r '/checkouts/itm/luggage/src/luggage/static-content.import.so' chmod a+r '/checkouts/itm/luggage/src/luggage/static-content.setup-info'
installing util: ...
changing current directory to .
'/Data/tools/chicken-4.11.0/bin/csi' -bnq -e "(require-library setup-api)" -e "(import setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version '(\"util\" \"\"))" -e "(destination-prefix \"/checkouts/itm/luggage/src/luggage\")" -e "(runtime-prefix \"/checkouts/itm/luggage/src/luggage\")" -e "(deployment-mode #t)" 'util.setup' '/Data/tools/chicken-4.11.0/bin/csc' -feature compiling-extension -deployed -dynamic -optimize-level 3 -debug-level 1 util.scm -emit-import-library util '/Data/tools/chicken-4.11.0/bin/csc' -feature compiling-extension -deployed -dynamic -optimize-level 3 -debug-level 0 util.import.scm
  cp -r 'util.so' '/checkouts/itm/luggage/src/luggage/util.so'
  chmod a+r '/checkouts/itm/luggage/src/luggage/util.so'
cp -r 'util.import.so' '/checkouts/itm/luggage/src/luggage/util.import.so'
  chmod a+r '/checkouts/itm/luggage/src/luggage/util.import.so'
  chmod a+r '/checkouts/itm/luggage/src/luggage/util.setup-info'
installing db: ...
changing current directory to .
'/Data/tools/chicken-4.11.0/bin/csi' -bnq -e "(require-library setup-api)" -e "(import setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version '(\"db\" \"\"))" -e "(destination-prefix \"/checkouts/itm/luggage/src/luggage\")" -e "(runtime-prefix \"/checkouts/itm/luggage/src/luggage\")" -e "(deployment-mode #t)" 'db.setup' '/Data/tools/chicken-4.11.0/bin/csc' -feature compiling-extension -deployed -dynamic -optimize-level 3 -debug-level 1 db.scm -emit-import-library db

Warning: imported identifier doesn't exist in module chicken: dynamic-wind '/Data/tools/chicken-4.11.0/bin/csc' -feature compiling-extension -deployed -dynamic -optimize-level 3 -debug-level 0 db.import.scm
  cp -r 'db.so' '/checkouts/itm/luggage/src/luggage/db.so'
  chmod a+r '/checkouts/itm/luggage/src/luggage/db.so'
cp -r 'db.import.so' '/checkouts/itm/luggage/src/luggage/db.import.so'
  chmod a+r '/checkouts/itm/luggage/src/luggage/db.import.so'
  chmod a+r '/checkouts/itm/luggage/src/luggage/db.setup-info'
installing datetime: ...
changing current directory to .
'/Data/tools/chicken-4.11.0/bin/csi' -bnq -e "(require-library setup-api)" -e "(import setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version '(\"datetime\" \"\"))" -e "(destination-prefix \"/checkouts/itm/luggage/src/luggage\")" -e "(runtime-prefix \"/checkouts/itm/luggage/src/luggage\")" -e "(deployment-mode #t)" 'datetime.setup' '/Data/tools/chicken-4.11.0/bin/csc' -feature compiling-extension -deployed -dynamic -optimize-level 3 -debug-level 1 datetime.scm -emit-import-library datetime '/Data/tools/chicken-4.11.0/bin/csc' -feature compiling-extension -deployed -dynamic -optimize-level 3 -debug-level 0 datetime.import.scm
  cp -r 'datetime.so' '/checkouts/itm/luggage/src/luggage/datetime.so'
  chmod a+r '/checkouts/itm/luggage/src/luggage/datetime.so'
cp -r 'datetime.import.so' '/checkouts/itm/luggage/src/luggage/datetime.import.so'
  chmod a+r '/checkouts/itm/luggage/src/luggage/datetime.import.so'
  chmod a+r '/checkouts/itm/luggage/src/luggage/datetime.setup-info'
installing server: ...
changing current directory to .
'/Data/tools/chicken-4.11.0/bin/csi' -bnq -e "(require-library setup-api)" -e "(import setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version '(\"server\" \"\"))" -e "(destination-prefix \"/checkouts/itm/luggage/src/luggage\")" -e "(runtime-prefix \"/checkouts/itm/luggage/src/luggage\")" -e "(deployment-mode #t)" 'server.setup' '/Data/tools/chicken-4.11.0/bin/csc' -feature compiling-extension -deployed -dynamic -optimize-level 3 -debug-level 1 server.scm -emit-import-library server

Error: during expansion of (import ...) - unbound variable: |\xcf\xfa\xed\xfe\x07\x00\x00\x01\x03\x00\x00\x00\x08\x00\x00\x00|

        Call history:

<syntax> (##core#begin (##core#begin (##core#declare (uses srfi-13)) (import srfi-13)) (##core#undefined)) <syntax> (##core#begin (##core#declare (uses srfi-13)) (import srfi-13))
        <syntax>    (##core#declare (uses srfi-13))
        <syntax>    (##core#begin (##core#undefined))
        <syntax>    (##core#undefined)
        <syntax>    (import srfi-13)
        <syntax>    (##core#undefined)
        <syntax>    (##core#undefined)
        <syntax>    (use db util datetime static-content)
<syntax> (##core#require-extension (db util datetime static-content) #t) <syntax> (##core#begin (##core#begin (##sys#require (quote db)) (import db)) (##core#begin (##core#begin (##c...
        <syntax>    (##core#begin (##sys#require (quote db)) (import db))
        <syntax>    (##sys#require (quote db))
        <syntax>    (quote db)
        <syntax>    (##core#quote db)
        <syntax>    (import db)   <--

Error: shell command terminated with non-zero exit status 17920: '/Data/tools/chicken-4.11.0/bin/chicken' 'server.scm' -output-file 'server.c' -dynamic -feature chicken-compile-shared -feature compiling-extension -optimize-level 3 -debug-level 1 -emit-import-library server

Error: shell command failed with nonzero exit status 256:

'/Data/tools/chicken-4.11.0/bin/csc' -feature compiling-extension -deployed -dynamic -optimize-level 3 -debug-level 1 server.scm -emit-import-library server


Error: shell command terminated with nonzero exit code
17920
"'/Data/tools/chicken-4.11.0/bin/csi' -bnq -e \"(require-library setup-api)\" -e...
make: *** [luggage/luggage] Error 1
%

--
Norman Gray  :  https://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK



reply via email to

[Prev in Thread] Current Thread [Next in Thread]