From Kurt.Hornik at wu-wien.ac.at  Thu Oct 23 09:40:12 2003
From: Kurt.Hornik at wu-wien.ac.at (Kurt Hornik)
Date: Thu Oct 23 09:41:28 2003
Subject: [Rd] Problem R-1.8.0 library tcltk on Tcl-8.0.5 (PR#4699)
In-Reply-To: <x28ynehaeo.fsf@biostat.ku.dk>
References: <200310210429.h9L4Tq0P021121@pubhealth.ku.dk>
	<x28ynfdr0c.fsf@biostat.ku.dk>
	<16277.19104.764444.11251@mithrandir.hornik.net>
	<x28ynehaeo.fsf@biostat.ku.dk>
Message-ID: <16279.34268.640931.682061@mithrandir.hornik.net>

>>>>> Peter Dalgaard writes:

> Kurt Hornik <Kurt.Hornik@wu-wien.ac.at> writes:
>> > (Argh. The test builds of 1.8.0 were actually against tcl8.0, but
>> > apparently our testing procedures skip any attempt to load the dynlib.
>> > Automated tests of tcl/tk are difficult because Tk will protest if
>> > there is no X display.)
>> 
>> On systems which have Xvfb, this is not a problem.
>> 
>> The daily package checker uses this, for example.

> Hmm it is more tricky than that it seems. I see

> comparing 'stepfun-Ex.Rout' to 'stepfun-Ex.Rout.prev' ... OK
> running code in 'tcltk-Ex.R' ... OK
> comparing 'tcltk-Ex.Rout' to 'tcltk-Ex.Rout.prev' ... OK
> collecting examples for package 'ts' ...
> make[5]: Entering directory `/e7/pd/r-devel/BUILD/src/library'

> However, 

> [pd@franz BUILD]$ tail  tests/Examples/tcltk-Ex.Rout
>> postscript("tcltk-Examples.ps")
>> assign("par.postscript", par(no.readonly = TRUE), env = .CheckExEnv)
>> options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly"))
>> require('tcltk') || q()
> Loading required package: tcltk
> Error in dyn.load(x, as.logical(local), as.logical(now)) :
>         unable to load shared library "/e7/pd/r-devel/BUILD/library/tcltk/libs/tcltk.so":
>   /e7/pd/r-devel/BUILD/library/tcltk/libs/tcltk.so: undefined symbol: RTcl_ActivateConsole
> Error in runHook(".onLoad", env, package.lib, package) :
>         .onLoad failed

> I.e. the seeming pass of make check is really just reflecting the fact
> that I got the same catastrophic failure as last time I ran it... 

> Is there a better way?

[Untested.]

Maybe we want to try to look more closely at why require("tcltk") might
have failed, as opposed to always exiting gracefully on failure via

  require('tcltk') || q()

Something like

  yy <- try(require("tcltk"), silent = TRUE)
  if(any(regexpr("^Tcl/Tk support is not available") > -1))
    q()
  else
    stop(yy)

???

-k


[Rd] Problem R-1.8.0 library tcltk on Tcl-8.0.5 (PR#4699)
Kurt Hornik