Skip to content
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

[PATCH] fix a broken optimization in win32/config_h.PL to stop excessive rebuilding #14375

Closed
p5pRT opened this issue Dec 28, 2014 · 5 comments
Closed

Comments

@p5pRT
Copy link

p5pRT commented Dec 28, 2014

Migrated from rt.perl.org#123513 (status was 'resolved')

Searchable as RT123513$

@p5pRT
Copy link
Author

p5pRT commented Dec 28, 2014

From @bulk88

Created by @bulk88

See attached patch.

Perl Info

Flags:
                   category=core
                   severity=low

Site configuration information for perl 5.21.7:

Configured by Owner at Sat Nov 22 21:54:54 2014.

Summary of my perl5 (revision 5 version 21 subversion 7) configuration:
                 Local Commit: 1bce52df028aabe28c20b2d97949e35c17ea811e
                 Ancestor: 7072da8afeba4c87ae623cd913e274396ffcf1cd
                 Platform:
                   osname=MSWin32, osvers=5.1,
archname=MSWin32-x86-multi-thread
                   uname=''
                   config_args='undef'
                   hint=recommended, useposix=true, d_sigaction=undef
                   useithreads=define, usemultiplicity=define
                   use64bitint=undef, use64bitall=undef, uselongdouble=undef
                   usemymalloc=n, bincompat5005=undef
                 Compiler:
                   cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG
-G7 -GL
-DWIN32 -D_CONSOLE -DNO_STRICT  -DPERL_TEXTMODE_SCRIPTS
-DPERL_HASH_FUNC_ONE_AT_A_TIME -DNO_MATHOMS -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T',
                   optimize='-O1 -MD -Zi -DNDEBUG -G7 -GL',
                   cppflags='-DWIN32'
                   ccversion='13.10.6030', gccversion='', gccosandvers=''
                   intsize=4, longsize=4, ptrsize=4, doublesize=8,
byteorder=1234,
doublekind=3
                   d_longlong=undef, longlongsize=8, d_longdbl=define,
longdblsize=8,
longdblkind=0
                   ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='__int64',
lseeksize=8
                   alignbytes=8, prototype=define
                 Linker and Libraries:
                   ld='link', ldflags ='-nologo -nodefaultlib -debug
-opt:ref,icf
-ltcg  -libpath:"c:\perl521\lib\CORE"  -machine:x86'
                   libpth="C:\Program Files\Microsoft Visual Studio .NET
2003\VC7\lib"
                   libs=oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib  version.lib
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
                   perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib
version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
                   libc=msvcrt.lib, so=dll, useshrplib=true,
libperl=perl521.lib
                   gnulibc_version=''
                 Dynamic Linking:
                   dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef,
ccdlflags=' '
                   cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib
-debug
-opt:ref,icf -ltcg  -libpath:"c:\perl521\lib\CORE"  -machine:x86'

Locally applied patches:
                   ce7a4d57d0acca9f39a84d36d708c4505dfe45ca
                   ca0b263f4b167ddf97416f657d79ab5bd3344357
                   08919bf863666074243240abbd19cd1a74cc7b74
                   b8a043377dbf39548709b107a11e5cc2714c0e9a
                   efa855eb5cffb7739616c295dd968d1510efeeb0
                   1d47d0b810e26d9a2f9101fb813bd5b3dd332cc9
                   3faca062ddb056db54f73fa55b0a9d473675dd33
                   0b3e905bda3e75ad948a1213f620656b60807393
                   1b1efc719fde05d215e5a13fb38c03e12a3aab08
                   1bce52df028aabe28c20b2d97949e35c17ea811e


@INC for perl 5.21.7:
                   ..\lib
                   C:/perl521/srcnewb4opt/lib
                   .


Environment for perl 5.21.7:
                   HOME (unset)
                   LANG (unset)
                   LANGUAGE (unset)
                   LD_LIBRARY_PATH (unset)
                   LOGDIR (unset)
                   PATH=C:\WINDOWS\system32;C:\Program Files\Microsoft
Visual
Studio
.NET 2003\Vc7\bin;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\IDE;C:\WINDOWS;C:\Program Files\Git\cmd;C:\Program
Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin;C:\perl\bin
                   PERL_BADLANG (unset)
                   PERL_JSON_BACKEND=Cpanel::JSON::XS
                   PERL_YAML_BACKEND=YAML
                   SHELL (unset)



















@p5pRT
Copy link
Author

p5pRT commented Dec 28, 2014

From @bulk88

0001-fix-a-broken-optimization-in-win32-config_h.PL-to-st.patch
From 7f2b4370e3cbbdfa1698d481cdc388141cea7219 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Sun, 28 Dec 2014 15:59:38 -0500
Subject: [PATCH] fix a broken optimization in win32/config_h.PL to stop
 excessive rebuilding

In commit 137443ea0a config_h.PL was introduced. There is no ML archive
from that time of the actual patches or their rational. From day 1 of
config_h.PL for the root config.h, it didn't copy the new one config.h to
the normal location of config.h if the files matched. This prevents
redundant dirtying of all core moudules with the
"Makefile out-of-date with respect to "/make clean/rerunning of makefile.pl
/new make all cycle. But the optimization didn't work in practice since
the modules declare a dependency on /lib/CORE/config.h not /config.h.
Previously "touch"ing /win32/Makefile would trigger a mass rebuild,
even if config.h's contents are the same. Now only if the new after
"touch"ing /win32/makefile config.h is different from the old config.h
, will a mass rebuild of module be triggered. This makes reduced the
amount of time core devs have to spend to work on Win32 perl.
---
 win32/config_h.PL |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/win32/config_h.PL b/win32/config_h.PL
index 6b7fbda..03dddb3 100644
--- a/win32/config_h.PL
+++ b/win32/config_h.PL
@@ -79,10 +79,11 @@ while (<SH>)
 close(H);
 close(SH);
 
-
-chmod(0666,"$opt{CORE_DIR}/$opt{CONFIG_H}");
-copy("$file.new","$opt{CORE_DIR}/$opt{CONFIG_H}") || die "Cannot copy:$!";
-chmod(0444,"$opt{CORE_DIR}/$opt{CONFIG_H}");
+if (compare("$file.new","$opt{CORE_DIR}/$opt{CONFIG_H}")) {
+    chmod(0666,"$opt{CORE_DIR}/$opt{CONFIG_H}");
+    copy("$file.new","$opt{CORE_DIR}/$opt{CONFIG_H}") || die "Cannot copy:$!";
+    chmod(0444,"$opt{CORE_DIR}/$opt{CONFIG_H}");
+}
 
 if (compare("$file.new",$file))
  {
-- 
1.7.9.msysgit.0

@p5pRT
Copy link
Author

p5pRT commented Dec 30, 2014

From @steve-m-hay

Thanks, applied in commit 989c251.

The change looks good, but it doesn't affect the thing which I've long found annoying, namely that "nmake test" (run immediately after "nmake") relinks perl521.dll and (presumably because *that* has been relinked) all the XS DLLs.

I've poked at trying to find out why perl521.dll gets relinked by "nmake test-prep" before but never found enough tuits to dig deep enough.

@p5pRT
Copy link
Author

p5pRT commented Dec 30, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Dec 30, 2014

@steve-m-hay - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant