Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Tcl can fail to compile from source

Closed / Invalid444308ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-07-25 00:47:41
Tcl can sometimes fail to compile from source.  This
happens most often on FreeBSD machines when the Tcl
source code is being checked out of a CVS repository.

The details are as follows:
Often Tcl source code that is being checked out of a
CVS repository will end up with tcl.decls and/or
tclInt.decls having modification times that are later
than tclStubInit.c.  Typically, the modification times
will only be 1 second later, but that's enough to cause
trouble.  When Tcl is being built, it decides that it
needs to regenerate tclStubInit.c.  This happens, of
course, before tclsh is built.  If a working tclsh is
not in the current path, the make fails when it tries
to execute genStubs.tcl.  FreeBSD machines install
tclsh under tclshx.x, so compiles will fail even if Tcl
was installed by default.

To reproduce this problem, make sure that some other
tclsh is not in your path.  Touch the tcl.decls and/or
tclInt.decls files to make their modification times
later than tclStubInit.c.  Then try to configure and
make Tcl as usual.

This behavior isn't desirable.  The makefile shouldn't
try to use something before it's built.  I suggest
testing for the existence of tclsh before running
genStubs.tcl.  Here is a patch to do this:

--- Makefile.in.old     Tue Jul 24 16:49:54 2001
+++ Makefile.in Tue Jul 24 16:52:42 2001
@@ -1039,8 +1039,10 @@
 
 $(GENERIC_DIR)/tclStubInit.c: $(GENERIC_DIR)/tcl.decls
\
                $(GENERIC_DIR)/tclInt.decls
-       $(TCL_EXE) $(TOOL_DIR)/genStubs.tcl
$(GENERIC_DIR) \
-               $(GENERIC_DIR)/tcl.decls
$(GENERIC_DIR)/tclInt.decls
+       if test -e $(TCL_EXE); then \
+               $(TCL_EXE) $(TOOL_DIR)/genStubs.tcl
$(GENERIC_DIR) \
+                       $(GENERIC_DIR)/tcl.decls
$(GENERIC_DIR)/tclInt.decls; \
+       fi
 
 genstubs:
        $(TCL_EXE) $(TOOL_DIR)/genStubs.tcl
$(GENERIC_DIR) \

If someone is compiling from scratch, tclsh won't
exist.  However, if someone really modified the
declarations, then they are likely to have already
compiled the source and tclsh will exist.  Some
sequences of events won't be caught (eg--developer
changes declarations, then developer does make
distclean, then developer configures and makes).  It
will, however, compile correctly if the developer makes
again or if the developer does an explicit make
genstubs.

It'd be better if it worked 100% of the time, but I
can't think of a way to do that.  Unless someone comes
up with something better, I suggest incorporating the
above patch.  IMHO, it's better if the source code
always compiles from scratch.
lloydlimplain2001-07-25 12:48:00
Logged In: YES 
user_id=99220

After further investigation, I discovered that when the 8.3.3 source was imported into our repository, CVS 
set the modification times 1 second apart as mentioned above.  Therefore, all of our checkouts had this 
time differential.  This was fixed by editing the timestamp for tclStubInit.c in our repository.

Please disregard the above patch.  Sorry for the false alarm.  :)
Log in (anonymous is fine) to add a comment.