Bug#708635: perl-tk: FTBFS with Perl 5.18

2013-05-18 Thread Niko Tyni
tag 708635 fixed-upstream
thanks

On Fri, May 17, 2013 at 07:13:39PM +0300, Niko Tyni wrote:
 On Fri, May 17, 2013 at 03:35:15PM +0300, Niko Tyni wrote:
  Package: perl-tk
  Version: 1:804.030-1
  Severity: important
  Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=82677
  Tags: upstream
  User: debian-p...@lists.debian.org
  Usertags: perl-5.18-transition

 The attached patch makes the package build for me, no guarantees about
 correctness.  I see the test suite doesn't pass even on current sid.

Similar fixes were recently incorporated upstream in the development
release 804.030_500.
-- 
Niko Tyni   nt...@debian.org


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#708635: perl-tk: FTBFS with Perl 5.18

2013-05-18 Thread Colin Tuckley
Niko,

Thanks for your investigation on this, I will have a talk with upstream
about a real fix for this.

In the meantime I was about to look at the perltk package anyway to fix
some of the Lintian errors so I will move it to the top of my queue.

Thanks,

Colin

-- 
Colin Tuckley  |  +44(0)1223 830814  |  PGP/GnuPG Key Id
Debian Developer   |  +44(0)7799 143369  | 0x1B3045CE

Dinner not ready: (A)bort (R)etry (P)izza


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#708635: perl-tk: FTBFS with Perl 5.18

2013-05-17 Thread Niko Tyni
Package: perl-tk
Version: 1:804.030-1
Severity: important
Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=82677
Tags: upstream
User: debian-p...@lists.debian.org
Usertags: perl-5.18-transition

After fixing #708624, this package fails to build with perl 5.18.0-RC1
from experimental:

  cc -c  -I..  -I/usr/include/freetype2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN 
-fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\804.03\ 
-DXS_VERSION=\804.03\ -fPIC -I/usr/lib/perl/5.18/CORE   -Wall 
-Wno-implicit-int -Wno-comment -Wno-unused -D__USE_FIXED_PROTOTYPES__ IO.c
  IO.xs: In function 'XS_Tk__IO_read':
  IO.xs:210:6: error: invalid use of void expression
  make[2]: *** [IO.o] Error 1
  make[2]: Leaving directory `/home/niko/tmp/perl-tk-804.030/IO'
  make[1]: *** [subdirs] Error 2
  make[1]: Leaving directory `/home/niko/tmp/perl-tk-804.030'
  make: *** [build-stamp] Error 2
  
From the 5.18 perldelta.pod:

  SvUPGRADE() is no longer an expression. Originally this macro (and
  its underlying function, sv_upgrade()) were documented as boolean,
  although in reality they always croaked on error and never returned
  false. In 2005 the documentation was updated to specify a void return
  value, but SvUPGRADE() was left always returning 1 for backwards
  compatibility. This has now been removed, and SvUPGRADE() is now a
  statement with no return value.

This is easily fixed by the attached patch, but then we see:

  cc -c  -I/usr/include/freetype2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN 
-fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\804.03\ 
-DXS_VERSION=\804.03\ -fPIC -I/usr/lib/perl/5.18/CORE   -Wall 
-Wno-implicit-int -Wno-comment -Wno-unused -D__USE_FIXED_PROTOTYPES__ tkGlue.c
  tkGlue.c: In function 'LangSaveVar':
  tkGlue.c:4195:26: error: lvalue required as left operand of assignment
  tkGlue.c: In function 'XEvent_Info':
  tkGlue.c:5023:9: warning: cast to pointer from integer of different size 
[-Wint-to-pointer-cast]
  tkGlue.c: In function 'install_vtab':
  tkGlue.c:5513:6: warning: format '%d' expects argument of type 'int', but 
argument 3 has type 'size_t' [-Wformat]
  make[1]: *** [tkGlue.o] Error 1

which I don't have fix for ATM. FWIW, the code around tkGlue.c:4195 is

  #ifdef USE_ITHREADS
 CopSTASHPV(PL_curcop) = NULL;
  #else
 CopSTASH(PL_curcop) = NULL;
  #endif

-- 
Niko Tyni   nt...@debian.org
From 1c62e2862c2ca72f21b9bb0e78f6d565d321d866 Mon Sep 17 00:00:00 2001
From: Niko Tyni nt...@debian.org
Date: Fri, 17 May 2013 11:28:47 +0300
Subject: [PATCH] SvUPGRADE return value hasn't meant anything for years

Quoting Perl 5.18 release notes (perldelta.pod):

 SvUPGRADE() is no longer an expression. Originally this macro (and its
 underlying function, sv_upgrade()) were documented as boolean, although in
 reality they always croaked on error and never returned false. In 2005 the
 documentation was updated to specify a void return value, but SvUPGRADE()
 was left always returning 1 for backwards compatibility. This has now
 been removed, and SvUPGRADE() is now a statement with no return value.
---
 IO/IO.xs |6 +-
 tkGlue.c |5 +
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/IO/IO.xs b/IO/IO.xs
index 8ae2a57..9eb7823 100644
--- a/IO/IO.xs
+++ b/IO/IO.xs
@@ -207,11 +207,7 @@ int	offset
  info.count  = 0;
  info.error  = 0;
  info.eof= 0;
- if (!SvUPGRADE(buf, SVt_PV))
-  {
-   RETVAL = PL_sv_undef;
-   return;
-  }
+ (void) SvUPGRADE(buf, SVt_PV);
  SvPOK_only(buf);		/* validate pointer */
  Tcl_CreateFileHandler(fd, TCL_READABLE, read_handler, (ClientData) info);
  do
diff --git a/tkGlue.c b/tkGlue.c
index dd3d283..443ba46 100644
--- a/tkGlue.c
+++ b/tkGlue.c
@@ -3830,10 +3830,7 @@ ClientData clientData;
  return EXPIRE((interp, Cannot trace readonly variable));
 }
   }
- if (!SvUPGRADE(sv, SVt_PVMG))
-  {
-   return EXPIRE((interp, Trace SvUPGRADE failed));
-  }
+ (void) SvUPGRADE(sv, SVt_PVMG);
 
  if (SvTYPE(sv) == SVt_PVAV)
   {
-- 
1.7.10.4



Bug#708635: perl-tk: FTBFS with Perl 5.18

2013-05-17 Thread Niko Tyni
On Fri, May 17, 2013 at 03:35:15PM +0300, Niko Tyni wrote:
 Package: perl-tk
 Version: 1:804.030-1
 Severity: important
 Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=82677
 Tags: upstream
 User: debian-p...@lists.debian.org
 Usertags: perl-5.18-transition

   tkGlue.c: In function 'LangSaveVar':
   tkGlue.c:4195:26: error: lvalue required as left operand of assignment

 which I don't have fix for ATM. FWIW, the code around tkGlue.c:4195 is
 
   #ifdef USE_ITHREADS
  CopSTASHPV(PL_curcop) = NULL;
   #else
  CopSTASH(PL_curcop) = NULL;
   #endif

The attached patch makes the package build for me, no guarantees about
correctness.  I see the test suite doesn't pass even on current sid.

Hope this helps.
-- 
Niko Tyni   nt...@debian.org
From 61187c190172b401e740515781f630d6f834ab45 Mon Sep 17 00:00:00 2001
From: Niko Tyni nt...@debian.org
Date: Fri, 17 May 2013 15:04:40 +0300
Subject: [PATCH] CopSTASHPV isn't an lvalue anymore

Commit d4d03940c58a0177edb93c8854929856e9975bf9 in Perl 5.17.1 broke
assignment to CopSTASHPV(), so use CopSTASHPV_set() instead.

This only touches threaded perls, so non-threaded ones may or may not
be broken too.
---
 tkGlue.c |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tkGlue.c b/tkGlue.c
index dd3d283..dcb1d6a 100644
--- a/tkGlue.c
+++ b/tkGlue.c
@@ -4195,7 +4192,11 @@ int type;
int prefix = '?';
name = SvPV(sv,na);
 #ifdef USE_ITHREADS
+#if PERL_REVISION  5 || (PERL_REVISION == 5  PERL_VERSION = 17)
+   CopSTASHPV_set(PL_curcop, NULL);
+#else
CopSTASHPV(PL_curcop) = NULL;
+#endif
 #else
CopSTASH(PL_curcop) = NULL;
 #endif
-- 
1.7.10.4