This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

build foible: IRIX 6.2, guile-doc-snarf, nawk


IRIX 6.2 nawk has an obscure bug that interacts with
guile-doc-snarf in such a way that guile (1.4) builds
without make errors, but exits immediately with the
sole message

	ERROR: Unbound variable: memq

the fault was not with guile, but it took me so long
to track down, i thought
i should post an FYI, plus a couple minor suggested
fixes for guile-doc-snarf ...

FYI #1) if you're building guile on IRIX, make sure
"gawk" is in your path (and double check that
./configure selected it for $AWK).  on IRIX 6.2, this
is essential.  (actually no one should be using IRIX
6.2, IRIX 6.5 has been out for ages, but you know how
people get behind.....) 

on IRIX 6.5, nawk will work, but if something else
goes wrong and the awk script tries to print an error
message, nawk will fail instead.  (there's no
"/dev/stderr" on IRIX.  gawk apparently handles this
as a special case.)

(should this advice be included in INSTALL, or even
codified in ./configure?   it doesn't seem quite
enough reason to make someone go and download and
build another package (gawk) just to build guile.)

FYI #2) if you hit a problem where built-ins are
unbound when they should be there, check the relevant
.x file, and make sure your built-in is being
registered there.  ("memq" comes from "list.x".)  if
it's not, you may have to investigate guile-doc-snarf.


suggestion #1)  it would be nice if guile-doc-snarf
could exit with non-zero status when $AWK does.  it
doesn't because of its "trap" command -- it returns
the status of the "rm -f $temp" not the $AWK.  (at
least on IRIX 6.2.)

suggestion #2) guile-snarf.awk can print  messages
(like "*** Argument name/number mismatch") but it
still exits with zero status.
here again, it's easy to lose the messages in the make
output.
(maybe they were intended as warnings only, i don't
know.)

overall, the snarf thing is cool, but it's complex,
and it introduces awk as a "new food group" (i.e.
place for things to go wrong, type of code to
maintain, etc).  i had to grab tmp files, find
SCM_ARG_BETTER_BE_IN_POSITION, read through awk code
to try to grasp its intent, fiddle with $AWK, etc.


here are the gory details (non-masochists, stop
reading here):  The old IRIX nawk doesn't correctly
handle "\n" inside []'s in regexps.  so when
guile-doc-snarf went to parse "(length lst)", the "n"
in "length" matched "/[ \n]/" even though it should
not have.   so guile-doc-snarf decided that an
argument was in the wrong position, and went to print
an error message.  this failed because nawk can't
print to "/dev/stderr".  so nawk complained and
failed, but guile-doc-snarf exited with normal status,
so make kept going, leaving a partial "list.x",
truncated just before scm_length; in particular,
scm_memq was never registered.  memq is about the
first thing called by ice-9/boot-9.scm. (saying "guile
--debug" doesn't give you any more detail, in this
case.)

i never did find a way to make IRIX nawk print to
stderr.

thanks for listening,
--Eric

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]