On Tue, Oct 07, 2025 at 03:53:32PM +0800, Qian Yun wrote:
> This is a simple workaround for the CLISP out-of-source
> build problem.
>
> By using "abs_srcdir" instead of "srcdir".
>
> BTW, the "PARSE-NAMESTRING: Illegal :DIRECTORY argument"
> error could be mitigated by "ignore-errors".
>
> - Qian
>
> diff --git a/src/etc/Makefile.in b/src/etc/Makefile.in
> index b5dc8295..0f87a447 100644
> --- a/src/etc/Makefile.in
> +++ b/src/etc/Makefile.in
> @@ -60,7 +60,7 @@
>
> $(fricas_target_libdir)/command.list: $(srcdir)/gen-cpl.lisp \
> stamp-databases
> - echo ")read $(srcdir)/gen-cpl.lisp" >
gen-cpl.in
> + echo ")read $(abs_srcdir)/gen-cpl.lisp" >
gen-cpl.in
> echo ')lisp (do_command_list "'$@'")' >>
gen-cpl.in
> (DD=$(fricas_targetdir); \
> if test -d ${PREGENERATED}/target/algebra ; then \
This is reasonable workaround, however see below.
>
> On 10/23/24 6:36 PM, Qian Yun wrote:
> > Actually it does not happen at "make", it happen at "make install",
> > when doing out-of-source build on Linux or macOS.
> >
> > It complains about missing of "target/x86_64-linux-gnu/lib/command.list".
> >
> > When doing "make" in src/etc, there's this error:
> >
> > (1) ->
> > >> System error:
> >
> > PARSE-NAMESTRING: Illegal :DIRECTORY argument (:ABSOLUTE :UP
> > "fricas-1.3.11" "src" "etc")
> >
> >
> > This error happens because fricas tries to do this:
> > ")read ../../../fricas-1.3.11/src/etc/gen-cpl.lisp".
> >
> > But ")read" implemented in fricas will try to search this file
> > in home directory: see in function "|get_directory_list|".
> >
> > So "/home/username/../../../fricas-1.3.11/src/etc/gen-cpl.lisp"
> > is passed to CLISP and causes error.
> >
> > The problem with CLISP is that, it does not support path like
> > "/../" (parent of root directory):
> >
> > [1]> (truename "/../")
> >
> > *** - PARSE-NAMESTRING: Illegal :DIRECTORY argument (:ABSOLUTE :UP)
> >
> >
> > Clearly this is a deficiency in CLISP, and hard to workaround it.
> >
> > BUT, it is also very questionable for fricas that, when ")read"
> > files, it will try to search at home directory (and other fricas
> > install directory). There is chance of file name collision.
> >
> > So I'd like to change fricas semantics of ")read".
Thinking about this, I wonder if it ever makes sence to do directory
search for paths starting with '..'. Normally, such path goes outside
"base" directory, so file in the directory will be unused. So
rationale for doing search trough directories is gone. Only when
'..' part is redundant, that is path goes back to the "base"
directory we will use it. But going back depends on what is in
directory tree above "base" directory. So paths starting from
'..' make sense inside build tree or for relations between build
tree and source tree, but they seem to make no sense for
general directory searches.
--
Waldek Hebisch