Thread: RE: [tcltk-perl] What version of perl is required?
Brought to you by:
hobbs
From: Konovalov, V. <vko...@sp...> - 2004-04-14 09:43:49
|
> Apparently the code works with perl-5.6 and better, and fails with > perl-5.005. Is this what is expected? I ask because I was looking > into suggesting cleanups for the perl code, but was not sure which > perl's you try to stay portabe to. > > If perl-5.6 is the baseline, then it is a good idea to put a: > > require 5.006; At some moment I managed things to work with 5.005_03, and, to be honest, not very glad for 'Tcl' perl module to require 5.8.0. 5.6.1 compatibility could be approached however, but we must decide whether elder than 5.6.0 are supported. Could you please point out what is broken? > statement in the Makefile.PL and Tcl.pm to document this. Probably > also say so in the README. "Changes" file of Tcl distribution claims compatibility with 5.005 in 0.7 Best regards, Vadim. |
From: Konovalov, V. <vko...@sp...> - 2004-04-14 11:22:09
|
> This patch is needed to get Tcl to build and have a clean 'make test' > on perl5.005_04-RC1: Thank you a lot. Will insert those to next CPAN release. But did you used latest CVS version, where Jeff made many improvements? Best regards, Vadim. > > ==== //depot/users/gisle/hacks/Tcl/Tcl.xs#3 - > /home/gisle/hacks/Tcl/Tcl.xs ==== > Index: users/gisle/hacks/Tcl/Tcl.xs > --- users/gisle/hacks/Tcl/Tcl.xs.~1~ Wed Apr 14 11:58:30 2004 > +++ users/gisle/hacks/Tcl/Tcl.xs Wed Apr 14 11:58:30 2004 > @@ -15,6 +15,17 @@ > #include "perl.h" > #include "XSUB.h" > > +#ifndef dTHX > + #define dTHX ; > + #define pTHX_ > + #define aTHX_ > +#endif > + > +#ifndef SvPV_nolen > + STRLEN my_na; > + #define SvPV_nolen(str) SvPV(str, my_na) > +#endif > + > #ifndef DEBUG_REFCOUNTS > #define DEBUG_REFCOUNTS 0 > #endif > @@ -136,9 +147,11 @@ > str = Tcl_GetStringFromObj(objPtr, &len); > sv = newSVpvn(str, len); > /* should turn on, but let's check this first for efficiency */ > +#ifdef SvUTF8_on > if (len && has_highbit(str, len)) { > SvUTF8_on(sv); > } > +#endif > } > return sv; > } > ==== //depot/users/gisle/hacks/Tcl/t/var.t#2 - > /home/gisle/hacks/Tcl/t/var.t ==== > Index: users/gisle/hacks/Tcl/t/var.t > --- users/gisle/hacks/Tcl/t/var.t.~1~ Wed Apr 14 11:58:30 2004 > +++ users/gisle/hacks/Tcl/t/var.t Wed Apr 14 11:58:30 2004 > @@ -41,6 +41,7 @@ > > # some Unicode tests > if ($]>=5.006 && $i->GetVar("tcl_version")>=8.1) { > +eval <<'EOT'; die $@ if $@; > $i->SetVar("univar","\x{abcd}\x{1234}"); > if ($i->GetVar("univar") ne "\x{abcd}\x{1234}") { > print "not "; > @@ -55,6 +56,7 @@ > print "ok 8 # Unicode persistence for tied variable\n"; > binmode(STDOUT, ":utf8") if $] >= 5.008; > print "# $r\n"; > +EOT > } > else { > for (7..8) {print "ok $_ # skipped: not Unicode-aware > Perl or Tcl\n";} > End of Patch. |
From: Gisle A. <gi...@Ac...> - 2004-04-14 11:34:19
|
"Konovalov, Vadim" <vko...@sp...> writes: > But did you used latest CVS version, where Jeff made many improvements? Yes, I'm using the CVS version as my baseline. --Gisle |
From: Gisle A. <gi...@Ac...> - 2004-04-14 13:23:31
|
Related question is what versions of 'tcl' is the Tcl.pm supposed to be compatible with? --Gisle |
From: Jeff H. <je...@Ac...> - 2004-04-14 17:57:55
|
> Related question is what versions of 'tcl' is the Tcl.pm > supposed to be compatible with? I'm ignoring anything below 8.4, but it's theoretically compatible with Tcl 8.1+ still (I think). Jeff |
From: Konovalov, V. <vko...@sp...> - 2004-04-14 13:53:34
|
> Related question is what versions of 'tcl' is the Tcl.pm supposed to > be compatible with? Ohhhh.... Tricky question... At first, when Malcolm Beattie, famous perl pumpking released module, only old Tcl/Tk existed, and nowadays module crashed when newer Tcl/Tk was used. RTFS-ing proved a necessity to call Tcl_FindExecutable in this case, so I added this, and both old and new versions were supported. Nowadays Tcl/Tk moved to "Object" system and looks like we're losing elder Tcl/Tk, and at least 0.72 supported both old and new Tcl/Tk. (worked perl-581+Tcl/Tk-800, and perl-5.005_03+Tcl/Tk-8.4-Unicodish) It appears that CPAN testers use old Tcl/Tk and *will* report FAILs in case their version is very old. In case support for old Tcl/Tk will be dropped, we must include proper check in Makefile.PL, for people not even trying testing in this case. My dream is to have something like Tcl.xs and Tcl800.xs, and Tcl800.xs could just contain old non-Unicodish non-tcl-Object, just to have working bridge even for such cases.. Best regards, Vadim. |
From: Jeff H. <je...@Ac...> - 2004-04-14 21:38:40
|
> > Related question is what versions of 'tcl' is the Tcl.pm supposed to > > be compatible with? > My dream is to have something like Tcl.xs and Tcl800.xs, and > Tcl800.xs could just contain old non-Unicodish > non-tcl-Object, just to have working bridge even for such cases.. My dream is that people realize 8.0 is 7 years old and used newer versions of Tcl. However, if you wanted to support it, the only thing you need to fix is Tcl_GetString (that was added in 8.1, but is simply Tcl_GetStringFromObj(var, NULL)) and Tcl_FindExecutable (that's 8.1+). I reference tclStringTypePtr (8.1+) and tclWideIntTypePtr (8.4+), but don't actually use them yet, so there is no issue there (they will be NULL). All the object stuff is correct in 8.0. I'm not using the Tcl unicode routines in Tcl.xs, so there's no issue there. Tcl::Tk does have some Tk 8.4 references as well, but I don't think that's a big deal (for example, labelframe and panedwindow are both 8.4+ widgets, but if you don't use them, no problem). Jeff |
From: Konovalov, V. <vko...@sp...> - 2004-04-14 11:38:43
|
> > But did you used latest CVS version, where Jeff made many > improvements? > > Yes, I'm using the CVS version as my baseline. good... |
From: Jan D. <ja...@Ac...> - 2004-04-14 23:32:51
|
Gisle posted the following patch earlier today (before I subscribed to the list): Index: users/gisle/hacks/Tcl/Tcl.xs --- users/gisle/hacks/Tcl/Tcl.xs.~1~ Wed Apr 14 11:58:30 2004 +++ users/gisle/hacks/Tcl/Tcl.xs Wed Apr 14 11:58:30 2004 @@ -15,6 +15,17 @@ #include "perl.h" #include "XSUB.h" +#ifndef dTHX + #define dTHX ; + #define pTHX_ + #define aTHX_ +#endif The definition of dTHX is not robust. You should use something like this: #define dTHX extern int Perl___notused without the trailing semicolon. Otherwise code breaks if dTHX is followed by more variable declarations: int foo(pTHX_ int arg) { dTHX; int bar; /* ... */ } The definition above is also what perl.h generates for current Perl when you are not using PERL_IMPLICIT_CONTEXT. Cheers, -Jan |
From: Konovalov, V. <vko...@sp...> - 2004-04-15 05:17:54
|
> > > Related question is what versions of 'tcl' is the Tcl.pm > supposed to > > > be compatible with? > > > My dream is to have something like Tcl.xs and Tcl800.xs, and > > Tcl800.xs could just contain old non-Unicodish > > non-tcl-Object, just to have working bridge even for such cases.. > > My dream is that people realize 8.0 is 7 years old and used > newer versions of Tcl. However, if you wanted to support it, > the only thing you need to fix is Tcl_GetString (that was > added in 8.1, but is simply Tcl_GetStringFromObj(var, NULL)) > and Tcl_FindExecutable (that's 8.1+). Supporting 8.0 is not necessity, but in case we'll drop it, we *must* improve Makefile.PL to detect elder Tcl/Tk versions and refuse to go through build and test, otherwise CPAN testers will send a bunch of FAILs. My opinion is gaining compatibility is even easier that fixing Makefile.PL properly :) :) > I reference tclStringTypePtr (8.1+) and tclWideIntTypePtr (8.4+), > but don't actually use them yet, so there is no issue there (they > will be NULL). > > All the object stuff is correct in 8.0. I'm not using the Tcl > unicode routines in Tcl.xs, so there's no issue there. > > Tcl::Tk does have some Tk 8.4 references as well, but I don't > think that's a big deal (for example, labelframe and panedwindow > are both 8.4+ widgets, but if you don't use them, no problem). This sounds very promising... Best regards, Vadim. |
From: Gisle A. <gi...@Ac...> - 2004-04-14 10:02:50
|
"Konovalov, Vadim" <vko...@sp...> writes: > > Apparently the code works with perl-5.6 and better, and fails with > > perl-5.005. Is this what is expected? I ask because I was looking > > into suggesting cleanups for the perl code, but was not sure which > > perl's you try to stay portabe to. > > > > If perl-5.6 is the baseline, then it is a good idea to put a: > > > > require 5.006; > > At some moment I managed things to work with 5.005_03, and, to be honest, > not very glad for 'Tcl' perl module to require 5.8.0. Agree. perl-5.6 is very much alive. I'm not sure how many still are stuck with 5.005 though. I would suggest that perl-5.6 is made a requirement. > 5.6.1 compatibility could be approached however, but we must decide whether > elder than 5.6.0 are supported. > Could you please point out what is broken? This patch is needed to get Tcl to build and have a clean 'make test' on perl5.005_04-RC1: ==== //depot/users/gisle/hacks/Tcl/Tcl.xs#3 - /home/gisle/hacks/Tcl/Tcl.xs ==== Index: users/gisle/hacks/Tcl/Tcl.xs --- users/gisle/hacks/Tcl/Tcl.xs.~1~ Wed Apr 14 11:58:30 2004 +++ users/gisle/hacks/Tcl/Tcl.xs Wed Apr 14 11:58:30 2004 @@ -15,6 +15,17 @@ #include "perl.h" #include "XSUB.h" +#ifndef dTHX + #define dTHX ; + #define pTHX_ + #define aTHX_ +#endif + +#ifndef SvPV_nolen + STRLEN my_na; + #define SvPV_nolen(str) SvPV(str, my_na) +#endif + #ifndef DEBUG_REFCOUNTS #define DEBUG_REFCOUNTS 0 #endif @@ -136,9 +147,11 @@ str = Tcl_GetStringFromObj(objPtr, &len); sv = newSVpvn(str, len); /* should turn on, but let's check this first for efficiency */ +#ifdef SvUTF8_on if (len && has_highbit(str, len)) { SvUTF8_on(sv); } +#endif } return sv; } ==== //depot/users/gisle/hacks/Tcl/t/var.t#2 - /home/gisle/hacks/Tcl/t/var.t ==== Index: users/gisle/hacks/Tcl/t/var.t --- users/gisle/hacks/Tcl/t/var.t.~1~ Wed Apr 14 11:58:30 2004 +++ users/gisle/hacks/Tcl/t/var.t Wed Apr 14 11:58:30 2004 @@ -41,6 +41,7 @@ # some Unicode tests if ($]>=5.006 && $i->GetVar("tcl_version")>=8.1) { +eval <<'EOT'; die $@ if $@; $i->SetVar("univar","\x{abcd}\x{1234}"); if ($i->GetVar("univar") ne "\x{abcd}\x{1234}") { print "not "; @@ -55,6 +56,7 @@ print "ok 8 # Unicode persistence for tied variable\n"; binmode(STDOUT, ":utf8") if $] >= 5.008; print "# $r\n"; +EOT } else { for (7..8) {print "ok $_ # skipped: not Unicode-aware Perl or Tcl\n";} End of Patch. |
From: Jeff H. <je...@Ac...> - 2004-04-14 16:08:04
|
> > If perl-5.6 is the baseline, then it is a good idea to put a: > > > > require 5.006; > > At some moment I managed things to work with 5.005_03, and, > to be honest, not very glad for 'Tcl' perl module to require 5.8.0. > > 5.6.1 compatibility could be approached however, but we must > decide whether elder than 5.6.0 are supported. FWIW, I think supporting only 5.6.0 up officially is the way to go. I have only been testing with 5.8, and I know that there are unicode issues with 5.6 (which may be alleviated by some of the C code changes I made), but 5.005 has no value in maintaining things for anymore. Jeff |