ashinn / chibi-scheme

Official chibi-scheme repository
Other
1.22k stars 141 forks source link

Fix SRFI 231 install #919

Closed gambiteer closed 1 year ago

gambiteer commented 1 year ago

Makefile:

When installing chibi, make installation directory and install files for SRFI 231. When uninstalling chibi, remove installation directory and files for SRFI 231.

lib/srfi/231/transforms.scm:

Move definition of vector-iota from here to ...

lib/srfi/231/base.scm:

Here.

lib/srfi/231/base.sld:

Export vector-iota to use in both base.scm and transforms.scm.

ashinn commented 1 year ago

Thanks!

gambiteer commented 1 year ago

How does one run lib/srfi/231/test.sld?

ashinn commented 1 year ago

chibi-scheme -msrfi.231.test -e'(run-tests)'

I actually have a script locally where chibi-test srfi.231 translates into this. I should commit it to the repo.

gambiteer commented 1 year ago

Am I supposed to run it in some special directory? I get

> heine:~/lang/scheme/srfi-231/srfi-231-temp> env LD_LIBRARY_PATH=/usr/local/chibi/lib: /usr/local/chibi/bin/chibi-scheme -msrfi.231.test -e'(run-tests)'
ERROR: couldn't find include: "srfi/231/base.scm"
  called from <anonymous> on line 210 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 1188 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 804 of file /usr/local/chibi//share/chibi/init-7.scm
  called from error on line 108 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 800 of file /usr/local/chibi//share/chibi/init-7.scm
  called from call-with-current-continuation on line 827 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 259 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 250 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 279 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 259 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 250 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 279 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 80 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 259 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 250 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 437 of file /usr/local/chibi//share/chibi/meta-7.scm
heine:~/lang/scheme/srfi-231/srfi-231-temp> pu ~/programs/chibi-scheme/lib/srfi/231
~/programs/chibi-scheme/lib/srfi/231 ~/lang/scheme/srfi-231/srfi-231-temp ~/lang/scheme ~ 
heine:~/programs/chibi-scheme/lib/srfi/231> env LD_LIBRARY_PATH=/usr/local/chibi/lib: /usr/local/chibi/bin/chibi-scheme -msrfi.231.test -e'(run-tests)'
ERROR: couldn't find include: "srfi/231/base.scm"
  called from <anonymous> on line 210 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 1188 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 804 of file /usr/local/chibi//share/chibi/init-7.scm
  called from error on line 108 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 800 of file /usr/local/chibi//share/chibi/init-7.scm
  called from call-with-current-continuation on line 827 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 259 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 250 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 279 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 259 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 250 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 279 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 80 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 259 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 250 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 437 of file /usr/local/chibi//share/chibi/meta-7.scm
heine:/usr/local/chibi/share/chibi/srfi/231> env LD_LIBRARY_PATH=/usr/local/chibi/lib: /usr/local/chibi/bin/chibi-scheme -msrfi.231.test -e'(run-tests)'
ERROR: couldn't find include: "srfi/231/base.scm"
  called from <anonymous> on line 210 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 1188 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 804 of file /usr/local/chibi//share/chibi/init-7.scm
  called from error on line 108 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 800 of file /usr/local/chibi//share/chibi/init-7.scm
  called from call-with-current-continuation on line 827 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 259 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 250 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 279 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 259 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 250 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 279 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 81 of file /usr/local/chibi//share/chibi/init-7.scm
  called from for1 on line 80 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 259 of file /usr/local/chibi//share/chibi/init-7.scm
  called from <anonymous> on line 250 of file /usr/local/chibi//share/chibi/meta-7.scm
  called from <anonymous> on line 437 of file /usr/local/chibi//share/chibi/meta-7.scm

I tried once in a random directory, once in the source directory, and once in the install directory.

ashinn commented 1 year ago

It works for me in the default install directory. You can view the current search path with:

chibi-scheme -Q -p'(current-module-path)'

and add to the search path with -I:

chibi-scheme -I<installed-dir> -msrfi.231.test -e'(run-tests)'

For example, from the source directory without even installing you can run:

LD_LIBRARY_PATH=. ./chibi-scheme -msrfi.231.test -e'(run-tests)'

I just added SRFI 231 to the lib test suite so running make test-libs will also test SRFI 231.

Also see the man page which describes the CHIBI_MODULE_PATH and CHIBI_IGNORE_SYSTEM_PATH env vars used in the Makefile.