New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Win32] 5.25.2 fails to build in ListUtil.xs #15400
Comments
From @sisyphusHi, I'm using mingw-w64 ports of gcc-5.3.0 (both 64-bit and 32-bit) and failing The error is always the same: In file included from ListUtil.xs:7:0: Cheers, |
From @tonycozOn Mon, Jun 20, 2016 at 06:52:51PM -0700, Sisyphus wrote:
It's a bug in one of the optimizations done in GNUmakefile and Instead of building a full ppport.h for XS modules to use, those The assumption made at the time the optimization was done was that I plan to make them build ppport.h properly. Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @sisyphus-----Original Message-----
By the time the error occurs, ppport.h is already to be found in Thanks for the pointer, Tony. Cheers, |
From @tonycozOn Mon Jun 20 18:52:51 2016, sisyphus wrote:
Please try the attached patch. Tony |
From @tonycoz0001-perl-128438-build-ppport.h-instead-of-using-a-dummy-.patchFrom c6d7175037b69051c82f6f4d38de030ec60f60d4 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Wed, 22 Jun 2016 15:43:21 +1000
Subject: [PATCH] (perl #128438) build ppport.h instead of using a dummy file
The changes to parallelize win32 perl builds with dmake and gmake
assumed that ppport.h only provided macros and functions that are
already provided by the latest perl.
This turns out not to be the case, preventing the building of
a new Scalar-List-Utils with dmake and gmake.
I only briefly considered changing Scalar-List-Utils - the difference
in build systems is what lead to the failure, so properly build ppport.h
so that all Win32 builds have a full ppport.h just as POSIXish builds
do.
---
win32/.gitignore | 1 +
win32/GNUmakefile | 21 ++++++++++++---------
win32/makefile.mk | 20 ++++++++++----------
3 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/win32/.gitignore b/win32/.gitignore
index 9719332..56dee9f 100644
--- a/win32/.gitignore
+++ b/win32/.gitignore
@@ -6,6 +6,7 @@ bin/*.bat
html/
mini/
Extensions_static
+.coreheaders
dlutils.c
perllibst.h
perlmain.c
diff --git a/win32/GNUmakefile b/win32/GNUmakefile
index 112ea4c..0fc3e58 100644
--- a/win32/GNUmakefile
+++ b/win32/GNUmakefile
@@ -998,9 +998,8 @@ UUDMAP_H = ..\uudmap.h
BITCOUNT_H = ..\bitcount.h
MG_DATA_H = ..\mg_data.h
GENERATED_HEADERS = $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H)
-#a stub ppport.h must be generated so building XS modules, .c->.obj wise, will
-#work, so this target also represents creating the COREDIR and filling it
-HAVE_COREDIR = $(COREDIR)\ppport.h
+
+HAVE_COREDIR = .coreheaders
MICROCORE_OBJ = $(MICROCORE_SRC:.c=$(o))
CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=$(o))
@@ -1419,10 +1418,13 @@ else
$(EMBED_EXE_MANI)
endif
-#This generates a stub ppport.h & creates & fills /lib/CORE to allow for XS
-#building .c->.obj wise (linking is a different thing). This target is AKA
-#$(HAVE_COREDIR).
-$(COREDIR)\ppport.h : $(CORE_H)
+.PHONY: MakePPPort
+
+MakePPPort : $(HAVEMINIPERL) $(CONFIGPM)
+ $(MINIPERL) -I..\lib ..\mkppport
+
+# also known as $(HAVE_COREDIR)
+.coreheaders : $(CORE_H)
$(XCOPY) *.h $(COREDIR)\\*.*
$(RCOPY) include $(COREDIR)\\*.*
$(XCOPY) ..\\*.h $(COREDIR)\\*.*
@@ -1461,7 +1463,7 @@ endif
# DynaLoader.pm, so this will have to do
#most of deps of this target are in DYNALOADER and therefore omitted here
-Extensions : $(PERLDEP) $(DYNALOADER) $(GLOBEXE)
+Extensions : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) MakePPPort
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic !Unicode/Normalize
Extensions_normalize : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES)
@@ -1470,7 +1472,7 @@ Extensions_normalize : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES)
Extensions_reonly : $(PERLDEP) $(DYNALOADER)
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re
-Extensions_static : ..\make_ext.pl list_static_libs.pl $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR)
+Extensions_static : ..\make_ext.pl list_static_libs.pl $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR) MakePPPort
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static
$(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static
@@ -1769,6 +1771,7 @@ _clean :
-@erase $(PERLDLL)
-@erase $(CORE_OBJ)
-@erase $(GENUUDMAP) $(GENUUDMAP_OBJ) $(GENERATED_HEADERS)
+ -@erase .coreheaders
-if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
-if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
-if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 58abd45..29c2ce6 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -985,9 +985,8 @@ UUDMAP_H = ..\uudmap.h
BITCOUNT_H = ..\bitcount.h
MG_DATA_H = ..\mg_data.h
GENERATED_HEADERS = $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H)
-#a stub ppport.h must be generated so building XS modules, .c->.obj wise, will
-#work, so this target also represents creating the COREDIR and filling it
-HAVE_COREDIR = $(COREDIR)\ppport.h
+
+HAVE_COREDIR = .\.coreheaders
MICROCORE_OBJ = $(MICROCORE_SRC:db:+$(o))
CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o))
@@ -1387,10 +1386,11 @@ $(GENUUDMAP) $(GENERATED_HEADERS) .UPDATEALL : ..\mg_raw.h
.ENDIF
$(GENUUDMAP) $(GENERATED_HEADERS)
-#This generates a stub ppport.h & creates & fills /lib/CORE to allow for XS
-#building .c->.obj wise (linking is a different thing). This target is AKA
-#$(HAVE_COREDIR).
-$(COREDIR)\ppport.h : $(CORE_H)
+MakePPPort : $(HAVEMINIPERL) $(CONFIGPM)
+ $(MINIPERL) -I..\lib ..\mkppport
+
+# also known as $(HAVE_COREDIR)
+.\.coreheaders : $(CORE_H)
$(XCOPY) *.h $(COREDIR)\*.* && $(RCOPY) include $(COREDIR)\*.* && $(XCOPY) ..\*.h $(COREDIR)\*.*
rem. > $@
@@ -1427,7 +1427,7 @@ $(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES)
# DynaLoader.pm, so this will have to do
#most of deps of this target are in DYNALOADER and therefore omitted here
-Extensions : $(PERLDEP) $(DYNALOADER) $(GLOBEXE)
+Extensions : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) MakePPPort
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic !Unicode/Normalize
Extensions_normalize : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES)
@@ -1436,7 +1436,7 @@ Extensions_normalize : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES)
Extensions_reonly : $(PERLDEP) $(DYNALOADER)
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re
-Extensions_static : ..\make_ext.pl list_static_libs.pl $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR)
+Extensions_static : ..\make_ext.pl list_static_libs.pl $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR) MakePPPort
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static
$(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static
@@ -1644,7 +1644,6 @@ install : all installbare installhtml
installbare : utils ..\pod\perltoc.pod
$(PERLEXE) ..\installperl
- attrib -r $(INST_COREDIR)\ppport.h && del $(INST_COREDIR)\ppport.h
if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
if exist $(PERLEXESTATIC) $(XCOPY) $(PERLEXESTATIC) $(INST_BIN)\*.*
$(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
@@ -1735,6 +1734,7 @@ _clean :
-@erase $(PERLDLL)
-@erase $(CORE_OBJ)
-@erase $(GENUUDMAP) $(GENUUDMAP_OBJ) $(GENERATED_HEADERS)
+ -@erase .coreheaders
-if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
-if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
-if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)
--
2.7.0.windows.1
|
From @sisyphus-----Original Message-----
The patch to GNUmakefile does the trick, and the one to makefile.mk might I hadn't tried building with dmake since 5.23.something, but when I build Is my problem with the dmake build a PEBCAK ?
A perfectly reasonable assumption, IMO. Cheers, |
From @sisyphusdmake: Executing shell macro: for /f "delims=. tokens=1,2,3" %i in |
From @tonycozOn Wed Jun 22 02:58:15 2016, sisyphus wrote:
Right GNUmakefile detects that automatically. I haven't installed gcc 5.3.0, but the toolchain provided with strawberry perl 5.22.1.2 32-bit still builds perl with dmake / makefile.mk I built with the default makefile.mk, with command-line arguments: dmake CCHOME=c:\sperl-5.22.1.2-32bit-portable\c\bin WIN64=undef test-prep Tony |
From @dcollinsnI did try building perl 5.25.2 on 64-bit Windows with dmake and mingw-w64. Dmake is dmake-4.12.2.2.zip from cpan, mingw-w64 provides gcc 5.3.0. I was able to reproduce the "ListUtil.xs:18:44: error: 'newsp' undeclared" issue, but I was not able to reproduce Sisyphus' linker issue. Applying TonyC's patch fixed the ListUtil error on dmake for me, and perl built successfully. |
From @bulk88On Tue Jun 21 22:45:15 2016, tonyc wrote:
The core patch is unnecessary, I already submitted a patch to SLU Dual-Life/Scalar-List-Utils#47 that makes it ppport free |
From @sisyphus-----Original Message-----
Yes - my issue *was* a PEBCAK. I had forgotten to set CCHOME to the correct
Same here. Cheers, |
From @bulk88On Wed Jun 22 23:58:55 2016, bulk88 wrote:
Patch attached for blead. -- |
From @bulk880001-Scalar-List-Utils-make-the-XS-code-ppport.h-free-whe.patchFrom fe3f529c19df90a78bfe06e6fa1233af97be3af7 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Wed, 13 Jul 2016 17:13:30 -0400
Subject: [PATCH] Scalar-List-Utils: make the XS code ppport.h free when in
core
ppport.h is an empty file on the Win32 Perl build and therefore
PERL_BCDVERSION macro doesn't exist/not defined. Use the core VERSION
macros, not the ppport family of VERSION macros. Make SLU ppport-free
when inside core.
submitted upstream as
https://github.com/Scalar-List-Utils/Scalar-List-Utils/pull/47
---
Porting/Maintainers.pl | 2 +
cpan/Scalar-List-Utils/ListUtil.xs | 33 ++++++++++++++++++++++------
cpan/Scalar-List-Utils/Makefile.PL | 2 +-
cpan/Scalar-List-Utils/lib/List/Util.pm | 2 +-
cpan/Scalar-List-Utils/lib/List/Util/XS.pm | 2 +-
cpan/Scalar-List-Utils/lib/Scalar/Util.pm | 2 +-
cpan/Scalar-List-Utils/lib/Sub/Util.pm | 2 +-
t/porting/customized.dat | 11 +++++----
8 files changed, 39 insertions(+), 17 deletions(-)
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index ab21522..26969f3 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -951,8 +951,10 @@ use File::Glob qw(:case);
'FILES' => q[cpan/Scalar-List-Utils],
# Waiting to be merged upstream
# https://github.com/Scalar-List-Utils/Scalar-List-Utils/pull/42
+ # https://github.com/Scalar-List-Utils/Scalar-List-Utils/pull/47
'CUSTOMIZED' => [
qw( ListUtil.xs
+ Makefile.PL
lib/List/Util.pm
lib/List/Util/XS.pm
lib/Scalar/Util.pm
diff --git a/cpan/Scalar-List-Utils/ListUtil.xs b/cpan/Scalar-List-Utils/ListUtil.xs
index cd84770..eca71ea 100644
--- a/cpan/Scalar-List-Utils/ListUtil.xs
+++ b/cpan/Scalar-List-Utils/ListUtil.xs
@@ -7,14 +7,33 @@
#include <perl.h>
#include <XSUB.h>
-#define NEED_sv_2pv_flags 1
-#include "ppport.h"
+#ifdef USE_PPPORT_H
+# define NEED_sv_2pv_flags 1
+# define NEED_newSVpvn_flags 1
+# include "ppport.h"
+#endif
+
+#ifndef PERL_VERSION_DECIMAL
+# define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
+#endif
+#ifndef PERL_DECIMAL_VERSION
+# define PERL_DECIMAL_VERSION \
+ PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
+#endif
+#ifndef PERL_VERSION_GE
+# define PERL_VERSION_GE(r,v,s) \
+ (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
+#endif
+#ifndef PERL_VERSION_LE
+# define PERL_VERSION_LE(r,v,s) \
+ (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
+#endif
-#if PERL_BCDVERSION >= 0x5006000
+#if PERL_VERSION_GE(5,6,0)
# include "multicall.h"
#endif
-#if PERL_BCDVERSION < 0x5023008
+#if !PERL_VERSION_GE(5,23,8)
# define UNUSED_VAR_newsp PERL_UNUSED_VAR(newsp)
#else
# define UNUSED_VAR_newsp NOOP
@@ -28,7 +47,7 @@
was not exported. Therefore platforms like win32, VMS etc have problems
so we redefine it here -- GMB
*/
-#if PERL_BCDVERSION < 0x5007000
+#if !PERL_VERSION_GE(5,7,0)
/* Not in 5.6.1. */
# ifdef cxinc
# undef cxinc
@@ -870,7 +889,7 @@ PPCODE:
/* This MULTICALL-based code appears to fail on perl 5.10.0 and 5.8.9
* Skip it on those versions (RT#87857)
*/
-#if defined(dMULTICALL) && (PERL_BCDVERSION > 0x5010000 || PERL_BCDVERSION < 0x5008009)
+#if defined(dMULTICALL) && (PERL_VERSION_GE(5,10,1) || PERL_VERSION_LE(5,8,8))
if(!CvISXSUB(cv)) {
/* Since MULTICALL is about to move it */
SV **stack = PL_stack_base + ax;
@@ -1319,7 +1338,7 @@ CODE:
if(SvAMAGIC(sv) && (tempsv = AMG_CALLun(sv, numer))) {
sv = tempsv;
}
-#if PERL_BCDVERSION < 0x5008005
+#if !PERL_VERSION_GE(5,8,5)
if(SvPOK(sv) || SvPOKp(sv)) {
RETVAL = looks_like_number(sv) ? &PL_sv_yes : &PL_sv_no;
}
diff --git a/cpan/Scalar-List-Utils/Makefile.PL b/cpan/Scalar-List-Utils/Makefile.PL
index 247b3b7..9859730 100644
--- a/cpan/Scalar-List-Utils/Makefile.PL
+++ b/cpan/Scalar-List-Utils/Makefile.PL
@@ -11,7 +11,7 @@ WriteMakefile(
NAME => q[List::Util],
ABSTRACT => q[Common Scalar and List utility subroutines],
AUTHOR => q[Graham Barr <gbarr@cpan.org>],
- DEFINE => q[-DPERL_EXT],
+ DEFINE => ($ENV{PERL_CORE} ? q[-DPERL_EXT] : q[-DPERL_EXT -DUSE_PPPORT_H]),
DISTNAME => q[Scalar-List-Utils],
VERSION_FROM => 'lib/List/Util.pm',
diff --git a/cpan/Scalar-List-Utils/lib/List/Util.pm b/cpan/Scalar-List-Utils/lib/List/Util.pm
index d537053..928833d 100644
--- a/cpan/Scalar-List-Utils/lib/List/Util.pm
+++ b/cpan/Scalar-List-Utils/lib/List/Util.pm
@@ -15,7 +15,7 @@ our @EXPORT_OK = qw(
all any first min max minstr maxstr none notall product reduce sum sum0 shuffle uniq uniqnum uniqstr
pairs unpairs pairkeys pairvalues pairmap pairgrep pairfirst
);
-our $VERSION = "1.45_01";
+our $VERSION = "1.45_02";
our $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
diff --git a/cpan/Scalar-List-Utils/lib/List/Util/XS.pm b/cpan/Scalar-List-Utils/lib/List/Util/XS.pm
index 67093bd..4c181d3 100644
--- a/cpan/Scalar-List-Utils/lib/List/Util/XS.pm
+++ b/cpan/Scalar-List-Utils/lib/List/Util/XS.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
use List::Util;
-our $VERSION = "1.45_01"; # FIXUP
+our $VERSION = "1.45_02"; # FIXUP
$VERSION = eval $VERSION; # FIXUP
1;
diff --git a/cpan/Scalar-List-Utils/lib/Scalar/Util.pm b/cpan/Scalar-List-Utils/lib/Scalar/Util.pm
index eb430cd..c322742 100644
--- a/cpan/Scalar-List-Utils/lib/Scalar/Util.pm
+++ b/cpan/Scalar-List-Utils/lib/Scalar/Util.pm
@@ -17,7 +17,7 @@ our @EXPORT_OK = qw(
dualvar isdual isvstring looks_like_number openhandle readonly set_prototype
tainted
);
-our $VERSION = "1.45_01";
+our $VERSION = "1.45_02";
$VERSION = eval $VERSION;
require List::Util; # List::Util loads the XS
diff --git a/cpan/Scalar-List-Utils/lib/Sub/Util.pm b/cpan/Scalar-List-Utils/lib/Sub/Util.pm
index 79e80fc..fdef2b6 100644
--- a/cpan/Scalar-List-Utils/lib/Sub/Util.pm
+++ b/cpan/Scalar-List-Utils/lib/Sub/Util.pm
@@ -15,7 +15,7 @@ our @EXPORT_OK = qw(
subname set_subname
);
-our $VERSION = "1.45_01";
+our $VERSION = "1.45_02";
$VERSION = eval $VERSION;
require List::Util; # as it has the XS
diff --git a/t/porting/customized.dat b/t/porting/customized.dat
index 49fd57d..1a2a544 100644
--- a/t/porting/customized.dat
+++ b/t/porting/customized.dat
@@ -11,11 +11,12 @@ Pod::Checker cpan/Pod-Checker/t/pod/selfcheck.t 8ce3cfd38e4b9bcf5bc7fe7f2a14195e
Pod::Checker cpan/Pod-Checker/t/pod/testcmp.pl a0cd5c8eca775c7753f4464eee96fa916e3d8a16
Pod::Checker cpan/Pod-Checker/t/pod/testpchk.pl b2072c7f4379fd050e15424175d7cac5facf5b3b
Pod::Perldoc cpan/Pod-Perldoc/lib/Pod/Perldoc.pm fe0bc906fb74b69cfd3fb289316ba669d770d465
-Scalar-List-Utils cpan/Scalar-List-Utils/lib/List/Util.pm e479a29c6b66ac5cbbde4ef2296afaab6c4635a6
-Scalar-List-Utils cpan/Scalar-List-Utils/lib/List/Util/XS.pm cbc38838d32fd213ae7b37ac38e30195355be3b9
-Scalar-List-Utils cpan/Scalar-List-Utils/lib/Scalar/Util.pm 14a20075dfb9a4ef33b99115ed6f43e6d1a15f9b
-Scalar-List-Utils cpan/Scalar-List-Utils/lib/Sub/Util.pm b984c0a2935bd5f5cf1733df846c8a8c0661ef32
-Scalar-List-Utils cpan/Scalar-List-Utils/ListUtil.xs 362a247c65878265fd8acae607b207400628ef3b
+Scalar-List-Utils cpan/Scalar-List-Utils/lib/List/Util.pm 4329ed96bd043044a3fe220d8fce5a2c4200ca38
+Scalar-List-Utils cpan/Scalar-List-Utils/lib/List/Util/XS.pm 728b257fbbcc2a61d6116829aef692cbae24dee4
+Scalar-List-Utils cpan/Scalar-List-Utils/lib/Scalar/Util.pm ff81acf87ec9e6e310265d0cd8e58a5401a0cfc5
+Scalar-List-Utils cpan/Scalar-List-Utils/lib/Sub/Util.pm c58eaab37d838b9b074cad413a140d98691ecfea
+Scalar-List-Utils cpan/Scalar-List-Utils/ListUtil.xs cf30d240f0473edf905ea0412af3d5c573770870
+Scalar-List-Utils cpan/Scalar-List-Utils/Makefile.PL 24a3a2e2bd2adb6d6734b620e02f5d0e2cc19891
Socket cpan/Socket/Socket.pm 98e38176d745c38282907f391c077298f5a3d0ba
Socket cpan/Socket/Socket.xs edd4fed212785f11c5c2095a75941dad27d586d9
autodie cpan/autodie/t/mkdir.t 9e70d2282a3cc7d76a78bf8144fccba20fb37dac
--
1.7.9.msysgit.0
|
From @tonycozOn Wed Jun 22 23:58:55 2016, bulk88 wrote:
The problem is this makes Win32 an even more special snowflake than it needs to be - making it harder for CPAN upstream authors to maintain their modules. An alternative to my original patch is to clean up the differences between the real-ppport.h and empty-ppport.h environments by adding PERL_BCDVERSION to perl.h, as per the attached patch. Tony |
From @tonycoz0001-perl-128438-make-PERL_BCDVERSION-from-ppport.h-core.patchFrom 1a4fbf151aa963c25227a98063d52700dae5d432 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Thu, 14 Jul 2016 14:54:02 +1000
Subject: [PATCH] (perl #128438) make PERL_BCDVERSION from ppport.h core
This means that Win32 [gd]make builds can continue to use a default
empty ppport.h to speed up their build process.
This reduces the unnecessary differences between the Win32 and
non-Win32 build environments.
---
Porting/Maintainers.pl | 3 ++-
cpan/Devel-PPPort/parts/inc/version | 2 ++
perl.h | 5 +++++
t/porting/customized.dat | 1 +
4 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index ab21522..65b1073 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -346,7 +346,8 @@ use File::Glob qw(:case);
'FILES' => q[cpan/Devel-PPPort],
'EXCLUDED' => [
'PPPort.pm', # we use PPPort_pm.PL instead
- ]
+ ],
+ 'CUSTOMIZED' => [ qw( parts/inc/version ) ],
},
'Devel::SelfStubber' => {
diff --git a/cpan/Devel-PPPort/parts/inc/version b/cpan/Devel-PPPort/parts/inc/version
index 1d5c556..01af2d3 100644
--- a/cpan/Devel-PPPort/parts/inc/version
+++ b/cpan/Devel-PPPort/parts/inc/version
@@ -41,8 +41,10 @@ _dpppDEC2BCD
# endif
#endif
+#ifndef PERL_BCDVERSION
#define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
#define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
+#endif
/* It is very unlikely that anyone will try to use this with Perl 6
(or greater), but who knows.
diff --git a/perl.h b/perl.h
index 1f19140..4106f11 100644
--- a/perl.h
+++ b/perl.h
@@ -4701,6 +4701,11 @@ extern char ** environ; /* environment variables supplied via exec */
STRINGIFY(PERL_API_VERSION) "." \
STRINGIFY(PERL_API_SUBVERSION)
+/* use the ppport name here to avoid macro redefinition errors with
+ older ppport.h files that don't guard the PERL_BCDVERSION macro */
+#define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
+#define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
+
START_EXTERN_C
/* handy constants */
diff --git a/t/porting/customized.dat b/t/porting/customized.dat
index 0fc7bec..8188c39 100644
--- a/t/porting/customized.dat
+++ b/t/porting/customized.dat
@@ -1,3 +1,4 @@
+Devel::PPPort cpan/Devel-PPPort/parts/inc/version 1b89cdcb609d2ee0c8fea96e718eb86a91cda4bc
Encode cpan/Encode/Byte/Makefile.PL 54f446297d614331ef3f51e8310faff27cc44f90
Encode cpan/Encode/encoding.pm 90ea1844e5ae863a17dd40ac6a0f27f438db9c1f
ExtUtils::Constant cpan/ExtUtils-Constant/t/Constant.t a0369c919e216fb02767a637666bb4577ad79b02
--
2.7.0.windows.1
|
From @bulk88On Wed Jul 13 21:59:53 2016, tonyc wrote:
I dont remember the default include order for EUMM .c files, but wouldn't first perl.h be included from installed CORE dir, then in the .xs/.c, ppport.h is included, but the local tarballed ppport.h is picked over the CORE one ( https://msdn.microsoft.com/en-us/library/36k2cdd4.aspx ) because all CPAN modules that use ppport.h are supposed to ship their own copy of it, which might be a very new ppport.h or very old ppport.h? Im thinking there will still be redefinition warnings between blead perl.h and old ppport.h'es since old ppport.h'es wont have the ifndef on their PERL_BCDVERSION. For a cpan module to be in core, it already has special requirements for its build process. It can't require XS code. It can't require an SQL server or 3rd party libs. It can't require root or a package manager (Alien cough cough). Continuing to ban ppport.h in core makes sense since many modules already do it with USE_PPPORT_H/_NOT_CORE, so its not a special snowflake scenario. Simplifying the module dependency tree is also good for all OSes to increase parallelism or decrease the number of serial building points (bulk88 wont touch the unix makefile, so bulk88 will never fix the false Math::BigInt::FastCalc dep on List::Utils, this is from the IRC convo yesterday in #p5p). Here is an idea, Im not 100% sure it is worthwhile to pursue. Im thinking maybe the empty ppport.h should contain a "#error ppport.h not available in core" instead of being empty. Greping /cpan shows all modules except two guard against using ppport.h on blead with either USE_PPPORT_H or _NOT_CORE macros. IPC-SysV and Win32API-File needs to be fixed. Pathtools and Time::HiRes in /dist also need fixing. There are only 5 modules listed, one is SLU, in http://perl5.git.perl.org/perl.git/blob/HEAD:/mkppport.lst . Getting it to zero doesn't seem impossible. Then makeppport target from the root makefiles, mkppport file and mkppport.lst file can be deleted forever. Im not 100% sure putting a #error will solve anything, because just adding USE_PPPORT_H or _NOT_CORE isn't a 100% guarantee that the .xs file uses a ppport-only macro. Only looking at the code throughly might show or make it standout that it used a ppport-only macro. Also at a random point in the build, the #error ppport.h will become the full ppport.h and it wont error anymore, covering up core modules that use ppport.h when they shouldn't. The "empty ppport.h design" already went through one round of "fix the module" last year with https://rt.cpan.org/Public/Bug/Display.html?id=102799 https://rt.perl.org/Ticket/Display.html?id=123867 https://rt-archive.perl.org/perl5/Ticket/Display.html?id=125807 http://www.nntp.perl.org/group/perl.perl5.porters/2016/02/msg234196.html Unless p5p changes blead perl to NEVER install the full ppport.h in installed CORE dir and if a CPAN on CPAN module does #include "ppport.h", and didn't ship its own copy of ppport.h in its tarball, someone can say its the module author's fault for relying on the user's existing installed, random age, possibly medieval ppport.h. IDK if this is true/right/opinions/etc. -- |
From @bulk88*bump* I havent been able to compile blead perl on win32 without patching it for a month or 2 now. -- |
From @sisyphus-----Original Message-----
+1 Cheers, |
From @tonycozOn Thu Jul 14 09:53:22 2016, bulk88 wrote:
I tested a CPAN XS module with ppport.h against the modified build A compiler *should* accept the redefinition which will occur between That said, there is a risk that a compiler will produce noise on such
Why not? We can add dependencies between XS modules.
GDBM_File, DB_File depend on 3rd party libs.
That might be a future change.
Yes, I remember that. The issues raised and fixed while you did that work to make dmake
That's only an issue if the compiler fails to build because of the redefinition, if it does fail to build it's not a C compiler. I've applied my original patch that re-instates building ppport.h as Tony |
@tonycoz - Status changed from 'open' to 'pending release' |
From @cpansproutOn Wed Jul 27 21:47:22 2016, tonyc wrote:
Aren’t all modules built with miniperl on Unix? -- Father Chrysostomos |
From @tonycozOn Wed, Jul 27, 2016 at 10:13:26PM -0700, Father Chrysostomos via RT wrote:
We have an (unneeded) dependency between Math::BigInt::FastCalc and A dependency on the XS implementation probably wouldn't work, since Tony |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
From @bulk88On Wed, 27 Jul 2016 21:47:22 -0700, tonyc wrote:
In june 2016/july 2016 https://perl5.git.perl.org/perl.git/8657e86b4fb3c8cf23a0c23b7093dda2e79b462b was commited which added back making a real ppport.h for win32 Perl. Around that time, I submitted https://github.com/Dual-Life/Scalar-List-Utils/pull/47 but it took 6 months before the maintainer merged it (Dec 2016). That new SLU with the -DUSE_PPPORT_H was merged to blead in June 2017 https://perl5.git.perl.org/perl.git/5e99e069f583949fb8ac93b20100ac8054a66d3a so commit "(perl #128438) build ppport.h instead of using a dummy file" which was made as an emergency fix can now be reverted now . My problem with reinstating full ppport.h is now perl52*.dll is rebuilt/recompiled every time make is called on that dep. I ran "C:\perl521\src\win32>dmake -P2 CCTYPE=MSVC70 ..\perl527.dll" once then ran it again. C:\perl521\src\win32>dmake -P2 CCTYPE=MSVC70 ..\perl527.dll C:\perl521\src\win32> So working on core takes more time on rebuilds. If I revert "(perl #128438) build ppport.h instead of using a dummy file" perl52*.dll isn't rebuilt. C:\perl521\src\win32>gmake CCTYPE=MSVC70 ..\perl527.dll C:\perl521\src\win32> Problem is that psuedo target "MakePPPort" can't be satisfied on disk which means all dependents will reexecute/rebuild every time. The old way I had it with a fake ppport.h made libperl satisfiable on disk. I think this ticket should be reopened. Or do I just submit a revert patch now that an updated SLU is in blead? -- |
Migrated from rt.perl.org#128438 (status was 'resolved')
Searchable as RT128438$
The text was updated successfully, but these errors were encountered: