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 2/11] make -s and TAGS #14582

Closed
p5pRT opened this issue Mar 14, 2015 · 13 comments
Closed

[PATCH 2/11] make -s and TAGS #14582

p5pRT opened this issue Mar 14, 2015 · 13 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 14, 2015

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

Searchable as RT124063$

@p5pRT
Copy link
Author

p5pRT commented Mar 14, 2015

From @rurban

This is a bug report for perl from rurban@​cpanel.net,
generated with the help of perlbug 1.40 running under perl 5.21.9.


make -s​: silent means silent
check MAKEFLAGS for -s|--silent|--quiet and honor it in some places.
(more on this later)

add TAGS target (etags, not ctags)



Flags​:
  category=core
  severity=medium
  Type=Patch
  PatchStatus=HasPatch


Site configuration information for perl 5.21.9​:

Configured by rurban at Sun Feb 22 17​:14​:55 CET 2015.

Summary of my perl5 (revision 5 version 21 subversion 9) configuration​:
 
  Platform​:
  osname=linux, osvers=3.16.0-4-amd64, archname=x86_64-linux-debug
  uname='linux reini 3.16.0-4-amd64 #1 smp debian 3.16.7-ckt2-1 (2014-12-08) x86_64 gnulinux '
  config_args='-de -Dusedevel -Uversiononly -Dinstallman1dir=none -Dinstallman3dir=none -Dinstallsiteman1dir=none -Dinstallsiteman3dir=none -DEBUGGING -Doptimize='-g3' -Uuseithreads -D'cc=gcc-5.0' -Accflags=''-msse4.2'' -Accflags=''-march=corei7'' -Dcf_email=''rurban@​cpanel.net'' -Dperladmin=''rurban@​cpanel.net'''
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='gcc-5.0', ccflags ='-msse4.2 -march=corei7 -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-g3',
  cppflags='-msse4.2 -march=corei7 -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
  ccversion='', gccversion='5.0.0 20150103 (experimental)', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='gcc-5.0', ldflags =' -fstack-protector-strong -L/usr/local/lib'
  libpth=/usr/local/lib /usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /lib64 /usr/lib64 /usr/local/lib64
  libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
  perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
  libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.19'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -g3 -L/usr/local/lib -fstack-protector-strong'

Locally applied patches​:
  Devel​::PatchPerl 1.30


@​INC for perl 5.21.9​:
  /usr/local/lib/perl5/site_perl/5.21.9/x86_64-linux-debug
  /usr/local/lib/perl5/site_perl/5.21.9
  /usr/local/lib/perl5/5.21.9/x86_64-linux-debug
  /usr/local/lib/perl5/5.21.9
  /usr/local/lib/perl5/site_perl/5.21.8
  /usr/local/lib/perl5/site_perl/5.21.7
  /usr/local/lib/perl5/site_perl/5.21.4
  /usr/local/lib/perl5/site_perl/5.21.3
  /usr/local/lib/perl5/site_perl/5.21.2
  /usr/local/lib/perl5/site_perl/5.21.1
  /usr/local/lib/perl5/site_perl/5.21.0
  /usr/local/lib/perl5/site_perl/5.20.1
  /usr/local/lib/perl5/site_perl/5.20.0
  /usr/local/lib/perl5/site_perl/5.19.11
  /usr/local/lib/perl5/site_perl/5.19.10
  /usr/local/lib/perl5/site_perl/5.19.9
  /usr/local/lib/perl5/site_perl/5.19.8
  /usr/local/lib/perl5/site_perl/5.19.7
  /usr/local/lib/perl5/site_perl/5.19.6
  /usr/local/lib/perl5/site_perl/5.19.5
  /usr/local/lib/perl5/site_perl/5.19.4
  /usr/local/lib/perl5/site_perl/5.19.3
  /usr/local/lib/perl5/site_perl/5.19.2
  /usr/local/lib/perl5/site_perl/5.19.1
  /usr/local/lib/perl5/site_perl/5.19.0
  /usr/local/lib/perl5/site_perl/5.18.4
  /usr/local/lib/perl5/site_perl/5.18.2
  /usr/local/lib/perl5/site_perl/5.18.1
  /usr/local/lib/perl5/site_perl/5.18.0
  /usr/local/lib/perl5/site_perl/5.17.11
  /usr/local/lib/perl5/site_perl/5.17.10
  /usr/local/lib/perl5/site_perl/5.17.8
  /usr/local/lib/perl5/site_perl/5.17.7
  /usr/local/lib/perl5/site_perl/5.17.6
  /usr/local/lib/perl5/site_perl/5.17.5
  /usr/local/lib/perl5/site_perl/5.17.4
  /usr/local/lib/perl5/site_perl/5.17.3
  /usr/local/lib/perl5/site_perl/5.17.2
  /usr/local/lib/perl5/site_perl/5.17.1
  /usr/local/lib/perl5/site_perl/5.17.0
  /usr/local/lib/perl5/site_perl/5.17
  /usr/local/lib/perl5/site_perl/5.16.3
  /usr/local/lib/perl5/site_perl/5.16.2
  /usr/local/lib/perl5/site_perl/5.16.1
  /usr/local/lib/perl5/site_perl/5.16.0
  /usr/local/lib/perl5/site_perl/5.15.9
  /usr/local/lib/perl5/site_perl/5.15.8
  /usr/local/lib/perl5/site_perl/5.15.7
  /usr/local/lib/perl5/site_perl/5.15.6
  /usr/local/lib/perl5/site_perl/5.15.5
  /usr/local/lib/perl5/site_perl/5.15.4
  /usr/local/lib/perl5/site_perl/5.15.3
  /usr/local/lib/perl5/site_perl/5.15.2
  /usr/local/lib/perl5/site_perl/5.14.4
  /usr/local/lib/perl5/site_perl/5.14.3
  /usr/local/lib/perl5/site_perl/5.14.2
  /usr/local/lib/perl5/site_perl/5.14.1
  /usr/local/lib/perl5/site_perl/5.12.5
  /usr/local/lib/perl5/site_perl/5.12.4
  /usr/local/lib/perl5/site_perl/5.10.1
  /usr/local/lib/perl5/site_perl/5.8.9
  /usr/local/lib/perl5/site_perl/5.8.8
  /usr/local/lib/perl5/site_perl/5.8.7
  /usr/local/lib/perl5/site_perl/5.8.6
  /usr/local/lib/perl5/site_perl/5.8.5
  /usr/local/lib/perl5/site_perl/5.8.4
  /usr/local/lib/perl5/site_perl/5.8.3
  /usr/local/lib/perl5/site_perl/5.8.2
  /usr/local/lib/perl5/site_perl/5.8.1
  /usr/local/lib/perl5/site_perl/5.6.2
  /usr/local/lib/perl5/site_perl
  .


Environment for perl 5.21.9​:
  HOME=/home/rurban
  LANG=en_US.utf8
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/home/rurban/bin​:/usr/local/bin​:/usr/bin​:/bin​:/usr/local/games​:/usr/games
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Mar 14, 2015

From @rurban

0001-make-s-silent-means-silent.patch
From b3ac587375d63ccd86e36e74d970c212f37e7288 Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@cpanel.net>
Date: Mon, 9 Feb 2015 09:41:43 +0100
Subject: [PATCH 1/2] make -s: silent means silent

check MAKEFLAGS for -s|--silent|--quiet and honor it
---
 make_ext.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git make_ext.pl make_ext.pl
index 12926f8..ca6deca 100644
--- make_ext.pl
+++ make_ext.pl
@@ -656,7 +656,8 @@ sub just_pm_to_blib {
     die "Inconsistent module $mname has both lib/ and $first/"
         if $has_lib && $has_topdir;
 
-    print "\nRunning pm_to_blib for $ext_dir directly\n";
+    print "\nRunning pm_to_blib for $ext_dir directly\n"
+      if !defined $ENV{MAKEFLAGS} or $ENV{MAKEFLAGS} !~ /\b(s|silent|quiet)\b/;
 
     my %pm;
     if ($has_top) {
-- 
2.1.4

@p5pRT
Copy link
Author

p5pRT commented Mar 14, 2015

From @rurban

0002-Makefile-add-TAGS-target-etags-not-ctags.patch
From c9349331eec6441fbb398c9ee4efb38f9e1cd2c6 Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@cpanel.net>
Date: Mon, 9 Feb 2015 10:08:45 +0100
Subject: [PATCH 2/2] Makefile: add TAGS target (etags, not ctags)

---
 Makefile.SH | 3 +++
 1 file changed, 3 insertions(+)

diff --git Makefile.SH Makefile.SH
index 12414a5..229f0e8 100755
--- Makefile.SH
+++ Makefile.SH
@@ -1589,6 +1589,9 @@ distcheck: FORCE
 
 .PHONY: ctags
 
+TAGS: $(c1) $(c2) $(c3) $(c4) $(c5) $(h)
+	etags $(c1) $(c2) $(c3) $(c4) $(c5) $(h)
+
 ctags:
 	ctags -f Tags -N --totals --languages=c --langmap=c:+.h --exclude=opmini.c --exclude=perlmini.c *.c *.h
 
-- 
2.1.4

@p5pRT
Copy link
Author

p5pRT commented Mar 14, 2015

From @bulk88

On Sat Mar 14 03​:47​:47 2015, rurban@​cpanel.net wrote​:

This is a bug report for perl from rurban@​cpanel.net,
generated with the help of perlbug 1.40 running under perl 5.21.9.

-----------------------------------------------------------------
make -s​: silent means silent
check MAKEFLAGS for -s|--silent|--quiet and honor it in some places.
(more on this later)


+ if !defined $ENV{MAKEFLAGS} or $ENV{MAKEFLAGS} !~ /\b(s|silent|quiet)\b/;


that statement looks too complicated if the point of the patch is to speed up the build by not printing to console. "!defined $ENV{MAKEFLAGS} or $ENV{MAKEFLAGS} !~ /\b(s|silent|quiet)\b/" should be cached to a my var ONCE on startup. Else atleast do a "\" ref on the hash slice to stop 2 magic hash lookups.

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Mar 14, 2015

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

@p5pRT
Copy link
Author

p5pRT commented Mar 14, 2015

From @rurban

On 03/14/2015 10​:08 PM, bulk88 via RT wrote​:

On Sat Mar 14 03​:47​:47 2015, rurban@​cpanel.net wrote​:

This is a bug report for perl from rurban@​cpanel.net,
generated with the help of perlbug 1.40 running under perl 5.21.9.

-----------------------------------------------------------------
make -s​: silent means silent
check MAKEFLAGS for -s|--silent|--quiet and honor it in some places.
(more on this later)

------------------------------------------------
+ if !defined $ENV{MAKEFLAGS} or $ENV{MAKEFLAGS} !~ /\b(s|silent|quiet)\b/;
------------------------------------------------

that statement looks too complicated if the point of the patch is to speed up the build by not printing to console. "!defined $ENV{MAKEFLAGS} or $ENV{MAKEFLAGS} !~ /\b(s|silent|quiet)\b/" should be cached to a my var ONCE on startup. Else atleast do a "\" ref on the hash slice to stop 2 magic hash lookups.

True, this looks better.

@p5pRT
Copy link
Author

p5pRT commented Mar 14, 2015

From @rurban

0001-Improve-make-s-silent-means-silent.patch
From 4f610b515187c199bc19781b311aa140df7cac9f Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@cpanel.net>
Date: Sat, 14 Mar 2015 22:41:13 +0100
Subject: [PATCH] Improve make -s: silent means silent

---
 ext/DynaLoader/dlutils.c | 7 ++++++-
 make_ext.pl              | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git ext/DynaLoader/dlutils.c ext/DynaLoader/dlutils.c
index 26c3698..bfcbc61 100644
--- ext/DynaLoader/dlutils.c
+++ ext/DynaLoader/dlutils.c
@@ -136,7 +136,12 @@ dl_generic_private_init(pTHX)	/* called by dl_*.xs dl_private_init() */
 #ifdef DL_UNLOAD_ALL_AT_EXIT
     call_atexit(&dl_unload_all_files, (void*)0);
 #endif
-    dl_boot(aTHX);
+#ifdef DL_LOADONCEONLY
+    if (!dl_loaded_files)
+#else
+    if (!get_cv("DynaLoader::bootstrap", 0))
+#endif
+      dl_boot(aTHX);
 }
 
 
diff --git make_ext.pl make_ext.pl
index ca6deca..73d4283 100644
--- make_ext.pl
+++ make_ext.pl
@@ -612,6 +612,7 @@ sub just_pm_to_blib {
     my ($first) = $mname =~ /^([^:]+)/;
 
     my $pm_to_blib = IS_VMS ? 'pm_to_blib.ts' : 'pm_to_blib';
+    my $silent = defined $ENV{MAKEFLAGS} and $ENV{MAKEFLAGS} =~ /\b(s|silent|quiet)\b/;
 
     foreach my $leaf (<*>) {
         if (-d $leaf) {
@@ -657,7 +658,7 @@ sub just_pm_to_blib {
         if $has_lib && $has_topdir;
 
     print "\nRunning pm_to_blib for $ext_dir directly\n"
-      if !defined $ENV{MAKEFLAGS} or $ENV{MAKEFLAGS} !~ /\b(s|silent|quiet)\b/;
+      unless $silent;
 
     my %pm;
     if ($has_top) {
-- 
2.1.4

@p5pRT
Copy link
Author

p5pRT commented Mar 15, 2015

From @bulk88

On Sat Mar 14 14​:42​:09 2015, rurban@​cpanel.net wrote​:

True, this looks better.

On 2nd thought, const sub/"use constant" like the IS_OSNAME stuff in make_ext.pl (which I added in the past) would be better than "my $silent". That way the bool check op is skipped and optimized away by the constant folder. The ENV var isn't expected to ever change during make_ext.pl's process run life. IIRC on unix make_ext.pl runs once per each module, but on Win32 make_ext.pl builds many modules in 1 run of make_ext.pl so the optimization is more for Win32 than Unix perl, it is still something I'd have to fix in the future if the my $silent version is commited,.

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Apr 13, 2015

From @tonycoz

On Sat Mar 14 14​:42​:09 2015, rurban@​cpanel.net wrote​:

On 03/14/2015 10​:08 PM, bulk88 via RT wrote​:

that statement looks too complicated if the point of the patch is to
speed up the build by not printing to console. "!defined
$ENV{MAKEFLAGS} or $ENV{MAKEFLAGS} !~ /\b(s|silent|quiet)\b/" should
be cached to a my var ONCE on startup. Else atleast do a "\" ref on
the hash slice to stop 2 magic hash lookups.

True, this looks better.

You included an unrelated change in that patch.

Tony

@p5pRT
Copy link
Author

p5pRT commented Oct 14, 2015

From @tonycoz

On Sun Apr 12 18​:36​:31 2015, tonyc wrote​:

On Sat Mar 14 14​:42​:09 2015, rurban@​cpanel.net wrote​:

On 03/14/2015 10​:08 PM, bulk88 via RT wrote​:

that statement looks too complicated if the point of the patch is to
speed up the build by not printing to console. "!defined
$ENV{MAKEFLAGS} or $ENV{MAKEFLAGS} !~ /\b(s|silent|quiet)\b/" should
be cached to a my var ONCE on startup. Else atleast do a "\" ref on
the hash slice to stop 2 magic hash lookups.

True, this looks better.

You included an unrelated change in that patch.

That unrelated change doesn't apply to any recent version of perl that I can see.

Ignoring that part, I've applied 0001-make-s-silent-means-silent.patch and 0001-Improve-make-s-silent-means-silent.patch squeezed together as b4c079c and 0002-Makefile-add-TAGS-target-etags-not-ctags.patch as e8d46ec.

Tony

@p5pRT
Copy link
Author

p5pRT commented Oct 14, 2015

@tonycoz - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed Oct 14, 2015
@p5pRT
Copy link
Author

p5pRT commented Nov 12, 2015

From @bulk88

On Tue Oct 13 20​:30​:15 2015, tonyc wrote​:

That unrelated change doesn't apply to any recent version of perl that
I can see.

Ignoring that part, I've applied 0001-make-s-silent-means-silent.patch
and 0001-Improve-make-s-silent-means-silent.patch squeezed together as
b4c079c and 0002-Makefile-add-TAGS-
target-etags-not-ctags.patch as
e8d46ec.

Tony

There seems to be something very wrong with commit "make -s​: silent means silent"


  my $silent = defined $ENV{MAKEFLAGS} and $ENV{MAKEFLAGS} =~ /\b(s|silent|quiet)\b/;


On my Win32 gmake build (but not dmake), $ENV{MAKEFLAGS} is


-j --jobserver-fds=gmake_semaphore_5876



$ENV{MAKEFLAGS} = " -j --jobserver-fds=gmake_semaphore_5876";
my $silent = defined $ENV{MAKEFLAGS} and $ENV{MAKEFLAGS} =~ /\b(s|silent|quiet)\b/;
print $silent;


prints 1. Also empty string


$ENV{MAKEFLAGS} = "";
my $silent = defined $ENV{MAKEFLAGS} and $ENV{MAKEFLAGS} =~ /\b(s|silent|quiet)\b/;
print $silent;


prints 1. Something is wrong with that regex.

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Nov 12, 2015

From Eirik-Berg.Hanssen@allverden.no

On Thu, Nov 12, 2015 at 7​:04 AM, bulk88 via RT <perlbug-followup@​perl.org>
wrote​:

There seems to be something very wrong with commit "make -s​: silent means
silent"

<snip>


$ENV{MAKEFLAGS} = "";
my $silent = defined $ENV{MAKEFLAGS} and $ENV{MAKEFLAGS} =~
/\b(s|silent|quiet)\b/;
print $silent;
----------------------------------------------

prints 1. Something is wrong with that regex.

  The regex looks fine. The problem looks like one of precedence (C<=>
binds more tightly than C<and>)​: The return value of the match is thrown
away, which does not appear to be the intent.

Eirik

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

No branches or pull requests

1 participant