You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Massimo Manghi <ma...@unipr.it> on 2007/11/02 00:45:28 UTC

Re: rivetlib, directory config and exit handler

These are the patches addressing the issues about which
I wrote last week. I added 2 patches for apache-1: one
to delete an interpreter before the child process
exits and the second to take rivetWWW.c away from
mod_rivet.c linking.
(the docs should be updated for those commands for 
which a 'package require Rivet' is needed to load 
them into the interp).

configure.ac, Makefile.am src/Makefile.am: 
a new macro 'rivet_target_dir' allows to specify 
where the Tcl stuff has to be installed. 
When not specified the variable defined by this 
macro defaults to 
${apache_base}/lib/rivet${PACKAGE_VERSION}.

src/apache-2/mod_rivet.c: during the per-interpreter 
initialization 'init.tcl' is run by calling 
Tcl_EvalFile on it.
The path to init.tcl is obtained from RIVETLIB_DESTDIR,
whose definition is in Makefile.am. I also changed
src/Makefile.am to reflect this. RIVETLIB_DESTDIR
is defined by substitution of the variable
RIVET_TCL_TARGET (see macro rivet_target_dir in 
configure.ac). Perhaps it's suboptimal, but I only
recently started to write m4 macros for the autotools.
The exit handler was re-enabled and Tcl_DeleteInterp 
called upon child exit.

apache-2/TclWebapache.c: A bug (?) caused children to 
crash when dir_module was called to look up 'index.rvt'
(or whatever else) in DirectoryIndex. 
It turned out that in this specific case the envvars 
table has a (key,value) pair where key is a valid string 
pointer, while the corresponding value is NULL. 
Fixed this by extending the check on both fields.
 
issues that need to be addressed: 

1 - make uninstall has no method that complements 
'install-data-local' during the uninstallation phase. 
In other words we can have this things installed 
everywhere but they have to be removed manually. 

2 - The env variables DATE_GMT and DATE_LOCAL carry 
wrong data. These fields are returned by ap_ht_time. 
I couldn't find a corresponding apreq2 function 
(Valery can you help?)

waiting for the usual comments and inevitable
criticism. Thank you for your patience.

 -- Massimo

--
Universita' degli Studi di Parma (http://www.unipr.it)


Re: rivetlib, directory config and exit handler

Posted by Massimo Manghi <ma...@unipr.it>.
David Welton wrote:
> Sorry for the slow response... had some messiness with work, and guests.
>
>   
>> src/apache-2/mod_rivet.c: during the per-interpreter
>> initialization 'init.tcl' is run by calling
>> Tcl_EvalFile on it.
>> The path to init.tcl is obtained from RIVETLIB_DESTDIR,
>> whose definition is in Makefile.am. I also changed
>> src/Makefile.am to reflect this. RIVETLIB_DESTDIR
>> is defined by substitution of the variable
>> RIVET_TCL_TARGET (see macro rivet_target_dir in
>> configure.ac). Perhaps it's suboptimal, but I only
>> recently started to write m4 macros for the autotools.
>> The exit handler was re-enabled and Tcl_DeleteInterp
>> called upon child exit.
>>     
>
> The apache-1 patch I see is related to init.tcl.  I forget exactly how
> things work, but should we be using the PkgRequire instead of sourcing
> init.tcl ?
>   
Di David, thank you for pointing this out. In fact the solution is
an overkill of the problem. We have to go for either on way or
the other.

Rivet loads the first init.tcl file it encounters in the PkgRequire search
path: it means that (on Unix) /usr/lib/rivet0.5.0/init.tcl takes
precedence over /usr/lib/rivet0.8.0 even though you want
the latter to be sourced in.
In fact it is init.tcl which sets up auto_path to include its own
directory in the scripts search path. This implies that if more
than one install of rivet is present a whole possibly wrong or
incompatible directory can be included in auto_path.

I didn't try to bind PACKAGE_VERSION to the 'package provide xxx'
command in init.tcl (thought it must be doable using autotools),
I chose to enable the user to install the Tcl library everywhere
he/she likes using --with-rivet-target-dir

 -- Massimo


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: rivetlib, directory config and exit handler

Posted by David Welton <da...@gmail.com>.
Sorry for the slow response... had some messiness with work, and guests.

> src/apache-2/mod_rivet.c: during the per-interpreter
> initialization 'init.tcl' is run by calling
> Tcl_EvalFile on it.
> The path to init.tcl is obtained from RIVETLIB_DESTDIR,
> whose definition is in Makefile.am. I also changed
> src/Makefile.am to reflect this. RIVETLIB_DESTDIR
> is defined by substitution of the variable
> RIVET_TCL_TARGET (see macro rivet_target_dir in
> configure.ac). Perhaps it's suboptimal, but I only
> recently started to write m4 macros for the autotools.
> The exit handler was re-enabled and Tcl_DeleteInterp
> called upon child exit.

The apache-1 patch I see is related to init.tcl.  I forget exactly how
things work, but should we be using the PkgRequire instead of sourcing
init.tcl ?

> apache-2/TclWebapache.c: A bug (?) caused children to
> crash when dir_module was called to look up 'index.rvt'
> (or whatever else) in DirectoryIndex.
> It turned out that in this specific case the envvars
> table has a (key,value) pair where key is a valid string
> pointer, while the corresponding value is NULL.
> Fixed this by extending the check on both fields.
>
> issues that need to be addressed:
>
> 1 - make uninstall has no method that complements
> 'install-data-local' during the uninstallation phase.
> In other words we can have this things installed
> everywhere but they have to be removed manually.
>
> 2 - The env variables DATE_GMT and DATE_LOCAL carry
> wrong data. These fields are returned by ap_ht_time.
> I couldn't find a corresponding apreq2 function
> (Valery can you help?)
>
> waiting for the usual comments and inevitable
> criticism. Thank you for your patience.


-- 
David N. Welton

http://www.welton.it/davidw/

http://www.dedasys.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org