another obscure bug with CLISP build

16 views
Skip to first unread message

Qian Yun

unread,
Oct 23, 2024, 6:36:10 AM10/23/24
to fricas-devel
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".

- Qian

Waldek Hebisch

unread,
Nov 29, 2024, 9:53:22 AM11/29/24
to fricas...@googlegroups.com
So what do you propose? Most radical approach would be to
look only at specified name, without search for extra
directories (except of database files which normally should
come from the system. Slightly less radical would be
to have user-settable paths, with trivial defaut (current
directory only).

--
Waldek Hebisch

Qian Yun

unread,
Dec 5, 2024, 7:48:34 AM12/5/24
to fricas...@googlegroups.com
On 11/29/24 10:53 PM, Waldek Hebisch wrote:
>>
>> So I'd like to change fricas semantics of ")read".
>
> So what do you propose? Most radical approach would be to
> look only at specified name, without search for extra
> directories (except of database files which normally should
> come from the system.

I'd like to experiment with this approach first, to see
if there's unexpected problems.

- Qian

Qian Yun

unread,
Oct 7, 2025, 3:53:39 AM (8 days ago) Oct 7
to fricas-devel
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 \

Waldek Hebisch

unread,
Oct 7, 2025, 5:41:05 PM (7 days ago) Oct 7
to fricas...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages