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

B::Section should be removed from the Perl source code #14957

Closed
p5pRT opened this issue Oct 1, 2015 · 8 comments
Closed

B::Section should be removed from the Perl source code #14957

p5pRT opened this issue Oct 1, 2015 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 1, 2015

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

Searchable as RT126244$

@p5pRT
Copy link
Author

p5pRT commented Oct 1, 2015

From @toddr

Created by @toddr

When B​::C was removed from sources in de12544, it was missed
that B​::Section was only needed by B​::C and so should also have been
removed at that time.

According to http​://grep.cpan.me/?q=B%3A%3ASection, the module is only
used by B​::C and old perl distributions.

1. B​::C in it's current CPAN state does not function on blead.
2. Any future version of B​::C can function fine with the following
patch​: rurban/perl-compiler#225
3. Perl isn't even aware that this package is a core module.

For these reasons, I suggest removal of the code from blead. I'll
attach a patch shortly.

Perl Info

Flags:
    category=library
    severity=low

Site configuration information for perl 5.18.2:

Configured by _trustevaluationagent at Thu Jul  9 01:25:35 PDT 2015.

Summary of my perl5 (revision 5 version 18 subversion 2) configuration:

  Platform:
    osname=darwin, osvers=14.0, archname=darwin-thread-multi-2level
    uname='darwin osx228.apple.com 14.0 darwin kernel version 14.0.0:
tue jun 2 11:49:04 pdt 2015;
root:xnu-2782.1.97.1.3~1development_x86_64 x86_64 '
    config_args='-ds -e -Dprefix=/usr -Dccflags=-g  -pipe  -Dldflags=
-Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none
-Dcc=cc'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-arch i386 -arch x86_64 -g -pipe -fno-common
-DPERL_DARWIN -fno-strict-aliasing -fstack-protector',
    optimize='-Os',
    cppflags='-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing
-fstack-protector'
    ccversion='', gccversion='4.2.1 Compatible Apple LLVM 6.0
(clang-600.0.39)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc -mmacosx-version-min=10.10.5', ldflags ='-arch i386 -arch
x86_64 -fstack-protector'
    libpth=/usr/lib /usr/local/lib
    libs=
    perllibs=
    libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-arch i386 -arch x86_64 -bundle
-undefined dynamic_lookup -fstack-protector'
Locally applied patches:
    /Library/Perl/Updates/<version> comes before system perl directories
    installprivlib and installarchlib points to the Updates directory


@INC for perl 5.18.2:
    /Library/Perl/5.18/darwin-thread-multi-2level
    /Library/Perl/5.18
    /Network/Library/Perl/5.18/darwin-thread-multi-2level
    /Network/Library/Perl/5.18
    /Library/Perl/Updates/5.18.2
    /System/Library/Perl/5.18/darwin-thread-multi-2level
    /System/Library/Perl/5.18
    /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level
    /System/Library/Perl/Extras/5.18
   .


Environment for perl 5.18.2:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/toddr
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
    PERLDB_OPTS=RemotePort=:9000
    PERL_BADLANG (unset)
    SHELL=/bin/zsh

@p5pRT
Copy link
Author

p5pRT commented Oct 1, 2015

From @toddr

Suggested change attached.

@p5pRT
Copy link
Author

p5pRT commented Oct 1, 2015

From @toddr

0001-Remove-B-Section-from-B.pm.patch
From c66681e70ce13124df7a8247abd31bd5826702ff Mon Sep 17 00:00:00 2001
From: Todd Rinaldo <toddr@cpan.org>
Date: Thu, 1 Oct 2015 18:05:49 -0500
Subject: [PATCH] Remove B::Section from B.pm

This package is a vestigial reminant of B::C's removal
in de1254415ffeb03b so is safe to be removed.
---
 ext/B/B.pm | 66 --------------------------------------------------------------
 1 file changed, 66 deletions(-)

diff --git a/ext/B/B.pm b/ext/B/B.pm
index 706e19a..bb5b71a 100644
--- a/ext/B/B.pm
+++ b/ext/B/B.pm
@@ -274,72 +274,6 @@ sub walksymtable {
     }
 }
 
-{
-    package B::Section;
-    my $output_fh;
-    my %sections;
-
-    sub new {
-	my ($class, $section, $symtable, $default) = @_;
-	$output_fh ||= FileHandle->new_tmpfile;
-	my $obj = bless [-1, $section, $symtable, $default], $class;
-	$sections{$section} = $obj;
-	return $obj;
-    }
-
-    sub get {
-	my ($class, $section) = @_;
-	return $sections{$section};
-    }
-
-    sub add {
-	my $section = shift;
-	while (defined($_ = shift)) {
-	    print $output_fh "$section->[1]\t$_\n";
-	    $section->[0]++;
-	}
-    }
-
-    sub index {
-	my $section = shift;
-	return $section->[0];
-    }
-
-    sub name {
-	my $section = shift;
-	return $section->[1];
-    }
-
-    sub symtable {
-	my $section = shift;
-	return $section->[2];
-    }
-
-    sub default {
-	my $section = shift;
-	return $section->[3];
-    }
-
-    sub output {
-	my ($section, $fh, $format) = @_;
-	my $name = $section->name;
-	my $sym = $section->symtable || {};
-	my $default = $section->default;
-
-	seek($output_fh, 0, 0);
-	while (<$output_fh>) {
-	    chomp;
-	    s/^(.*?)\t//;
-	    if ($1 eq $name) {
-		s{(s\\_[0-9a-f]+)} {
-		    exists($sym->{$1}) ? $sym->{$1} : $default;
-		}ge;
-		printf $fh $format, $_;
-	    }
-	}
-    }
-}
-
 1;
 
 __END__
-- 
2.5.0

@p5pRT
Copy link
Author

p5pRT commented Nov 18, 2015

From @toddr

With the commit applied to B​::C listed below, there is now officially no code I can find now or in the future that uses B​::Section. I'm not aware of a reason to keep it at this point so the patch should be good to merge as is.

rurban/perl-compiler@25e2d8c

@p5pRT
Copy link
Author

p5pRT commented Dec 3, 2015

From @jkeenan

On Wed Nov 18 12​:12​:43 2015, TODDR wrote​:

With the commit applied to B​::C listed below, there is now officially
no code I can find now or in the future that uses B​::Section. I'm not
aware of a reason to keep it at this point so the patch should be good
to merge as is.

https://github.com/rurban/perl-
compiler/commit/25e2d8c4c2aa9d434c6110ef5dc9079ebf23da6f

Smoking in this branch​:

smoke-me/jkeenan/trinaldo/126244-remove-b-section

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Dec 3, 2015

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

@p5pRT
Copy link
Author

p5pRT commented Jan 19, 2016

From @iabyn

On Wed, Dec 02, 2015 at 05​:39​:05PM -0800, James E Keenan via RT wrote​:

On Wed Nov 18 12​:12​:43 2015, TODDR wrote​:

With the commit applied to B​::C listed below, there is now officially
no code I can find now or in the future that uses B​::Section. I'm not
aware of a reason to keep it at this point so the patch should be good
to merge as is.

https://github.com/rurban/perl-
compiler/commit/25e2d8c4c2aa9d434c6110ef5dc9079ebf23da6f

Smoking in this branch​:

smoke-me/jkeenan/trinaldo/126244-remove-b-section

Now pushed to blead as 88e8953

--
No matter how many dust sheets you use, you will get paint on the carpet.

@p5pRT p5pRT closed this as completed Jan 19, 2016
@p5pRT
Copy link
Author

p5pRT commented Jan 19, 2016

@iabyn - 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