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] Add capability to exclude non-XS extensions #10844
Comments
From @jdheddenIn order to save time building and testing Perl, I use the I wanted the same exclusion capability for non-XS extensions Using this patch, I now exclude over 50 non-XS modules from Perl Info
|
From @jdhedden0001-Add-capability-to-exclude-non-XS-extensions.patchFrom 06352382d9fc6cff4a3e2c232011f3f300d71ceb Mon Sep 17 00:00:00 2001
From: Jerry D. Hedden <jdhedden@cpan.org>
Date: Sun, 21 Nov 2010 18:13:25 -0500
Subject: [PATCH] Add capability to exclude non-XS extensions
Currently, the -Dnoextensions=... and -Donlyextensions=... options
in Configure only work for XS extensions. This patch adds the
capabilty for these options to also work for non-XS extensions.
---
Configure | 69 +++++++++++++++++++++++++++++++++++++----------------
INSTALL | 9 ++++---
Porting/Glossary | 13 +++++++---
installperl | 6 ++++
t/TEST | 16 ++++++++++--
t/harness | 2 +-
6 files changed, 82 insertions(+), 33 deletions(-)
diff --git a/Configure b/Configure
index 793f8fa..8f1b5c7 100755
--- a/Configure
+++ b/Configure
@@ -220,6 +220,7 @@ dynamic_ext=''
extensions=''
known_extensions=''
nonxs_ext=''
+known_nonxs_ext=''
static_ext=''
useopcode=''
useposix=''
@@ -21851,7 +21852,7 @@ echo "Looking for extensions..." >&4
: If we are using the old config.sh, known_extensions may contain
: old or inaccurate or duplicate values.
known_extensions=''
-nonxs_extensions=''
+known_nonxs_ext=''
: We do not use find because it might not be available.
: We do not just use MANIFEST because the user may have dropped
: some additional extensions into the source tree and expect them
@@ -21872,7 +21873,7 @@ find_extensions='
if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
known_extensions="$known_extensions $1$this_ext";
elif $test -f $xxx/Makefile.PL; then
- nonxs_extensions="$nonxs_extensions $1$this_ext";
+ known_nonxs_ext="$known_nonxs_ext $1$this_ext";
else
if $test -d $xxx -a $# -lt 10; then
set $1$xxx/ $*;
@@ -21889,7 +21890,7 @@ find_extensions='
elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
known_extensions="$known_extensions $this_ext";
elif $test -d $xxx; then
- nonxs_extensions="$nonxs_extensions $this_ext";
+ known_nonxs_ext="$known_nonxs_ext $this_ext";
fi;
$rm -f $$.tmp;
fi
@@ -21922,9 +21923,9 @@ fi
set X $known_extensions
shift
known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
-set X $nonxs_extensions
+set X $known_nonxs_ext
shift
-nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
+known_nonxs_ext=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
cd "$tdir"
: Now see which are supported on this system.
@@ -22057,14 +22058,21 @@ for xxx in $known_extensions ; do
esac
done
-set X $avail_ext
-shift
-avail_ext="$*"
+: Now see which nonxs extensions are supported on this system.
+: For now assume all are.
+nonxs_ext=''
+for xxx in $known_nonxs_ext ; do
+ case "$xxx" in
+ *) nonxs_ext="$nonxs_ext $xxx"
+ ;;
+ esac
+done
case "$onlyextensions" in
'') ;;
-*) keepextensions=''
- echo "You have requested that only certains extensions be included..." >&4
+*) echo "You have requested that only certains extensions be included..." >&4
+
+ keepextensions=''
for i in $onlyextensions; do
case " $avail_ext " in
*" $i "*)
@@ -22075,13 +22083,26 @@ case "$onlyextensions" in
esac
done
avail_ext="$keepextensions"
+
+ keepextensions=''
+ for i in $onlyextensions; do
+ case " $nonxs_ext " in
+ *" $i "*)
+ echo "Keeping extension $i."
+ keepextensions="$keepextensions $i"
+ ;;
+ *) echo "Ignoring extension $i." ;;
+ esac
+ done
+ nonxs_ext="$keepextensions"
;;
esac
case "$noextensions" in
'') ;;
-*) keepextensions=''
- echo "You have requested that certain extensions be ignored..." >&4
+*) echo "You have requested that certain extensions be ignored..." >&4
+
+ keepextensions=''
for i in $avail_ext; do
case " $noextensions " in
*" $i "*) echo "Ignoring extension $i." ;;
@@ -22091,18 +22112,23 @@ case "$noextensions" in
esac
done
avail_ext="$keepextensions"
+
+ keepextensions=''
+ for i in $nonxs_ext; do
+ case " $noextensions " in
+ *" $i "*) echo "Ignoring extension $i." ;;
+ *) echo "Keeping extension $i.";
+ keepextensions="$keepextensions $i"
+ ;;
+ esac
+ done
+ nonxs_ext="$keepextensions"
;;
esac
-: Now see which nonxs extensions are supported on this system.
-: For now assume all are.
-nonxs_ext=''
-for xxx in $nonxs_extensions ; do
- case "$xxx" in
- *) nonxs_ext="$nonxs_ext $xxx"
- ;;
- esac
-done
+set X $avail_ext
+shift
+avail_ext="$*"
set X $nonxs_ext
shift
@@ -23182,6 +23208,7 @@ nm='$nm'
nm_opt='$nm_opt'
nm_so_opt='$nm_so_opt'
nonxs_ext='$nonxs_ext'
+known_nonxs_ext='$known_nonxs_ext'
nroff='$nroff'
nvEUformat='$nvEUformat'
nvFUformat='$nvFUformat'
diff --git a/INSTALL b/INSTALL
index c4347ef..d6c3b5c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -941,7 +941,7 @@ simple D script that uses them:
=head2 Extensions
Perl ships with a number of standard extensions. These are contained
-in the ext/ subdirectory.
+in the ext/, cpan/ and dist/ subdirectories.
By default, Configure will offer to build every extension which appears
to be supported. For example, Configure will offer to build GDBM_File
@@ -949,8 +949,8 @@ only if it is able to find the gdbm library.
To disable certain extensions so that they are not built, use the
-Dnoextensions=... and -Donlyextensions=... options. They both accept
-a space-separated list of extensions, such as C<IPC/SysV>. The extensions
-listed in
+a space-separated list of extensions, such as C<IPC/SysV>. They both
+accept XS and non-XS extensions. The extensions listed in
C<noextensions> are removed from the list of extensions to build, while
the C<onlyextensions> is rather more severe and builds only the listed
extensions. The latter should be used with extreme caution since
@@ -961,7 +961,8 @@ these options is first C<only> (if present), then C<no> (if present).
Of course, you may always run Configure interactively and select only
the extensions you want.
-If you unpack any additional extensions in the ext/ directory before
+If you unpack any additional extensions in the ext/, cpan/ or dist/
+directories before
running Configure, then Configure will offer to build those additional
extensions as well. Most users probably shouldn't have to do this --
it is usually easier to build additional extensions later after perl
diff --git a/Porting/Glossary b/Porting/Glossary
index 909d801..95681c5 100644
--- a/Porting/Glossary
+++ b/Porting/Glossary
@@ -2630,8 +2630,8 @@ expr (Loc.U):
extensions (Extensions.U):
This variable holds a list of all extension files (both XS and
- non-xs linked into the package. It is propagated to Config.pm
- and is typically used to test whether a particular extesion
+ non-XS) linked into the package. It is propagated to Config.pm
+ and is typically used to test whether a particular extension
is available.
extern_C (Csym.U):
@@ -3582,6 +3582,10 @@ known_extensions (Extensions.U):
This variable holds a list of all XS extensions included in
the package.
+known_nonxs_ext (Extensions.U):
+ This variable holds a list of all non-XS extensions included
+ in the package.
+
ksh (Loc.U):
This variable is defined but not used by Configure.
The value is the empty string and is not useful.
@@ -3944,8 +3948,9 @@ nm_so_opt (usenm.U):
Maybe Linux should just always set usenm=false.
nonxs_ext (Extensions.U):
- This variable holds a list of all non-xs extensions included
- in the package. All of them will be built.
+ This variable holds a list of the non-XS extensions linked
+ into the package. It is propagated to Config.pm, and can be
+ used to test whether a particular non-XS extension is available.
nroff (Loc.U):
This variable is used internally by Configure to determine the
diff --git a/installperl b/installperl
index d1eafe6..37403a6 100755
--- a/installperl
+++ b/installperl
@@ -118,6 +118,12 @@ while (<SCRIPTS>) {
next if /^#/;
s/\s*#\s*pod\s*=.*//; # install script regardless of pod location
next if /a2p/; # a2p is binary, to be installed separately
+ # Ignore scripts from unbuilt extensions
+ if (/^[^\/]+\/([^\/]+)\/blib\//) {
+ (my $mod = $1) =~ s/-/\//g;
+ my $ext = " $Config{extensions} ";
+ next if ($ext !~ / $mod /);
+ }
chomp;
if (/(\S*)\s*#\s*link\s*=\s*(\S*)/) {
push @scripts, $1;
diff --git a/t/TEST b/t/TEST
index 945015f..c3db4da 100755
--- a/t/TEST
+++ b/t/TEST
@@ -376,14 +376,18 @@ sub _populate_hash {
}
sub _tests_from_manifest {
- my ($extensions, $known_extensions) = @_;
+ my ($extensions, $known_extensions, $known_nonxs_ext) = @_;
my %skip;
my %extensions = _populate_hash($extensions);
my %known_extensions = _populate_hash($known_extensions);
+ my %known_nonxs_ext = _populate_hash($known_nonxs_ext);
foreach (keys %known_extensions) {
$skip{$_} = 1 unless $extensions{$_};
}
+ foreach (keys %known_nonxs_ext) {
+ $skip{$_} = 1 unless $extensions{$_};
+ }
my @results;
my $mani = '../MANIFEST';
@@ -427,7 +431,7 @@ unless (@ARGV) {
# for skipping tests on non-default builds, so it is allowed to fail.
# What we want to to is make a list of extensions which we did not build.
my $configsh = '../config.sh';
- my ($extensions, $known_extensions);
+ my ($extensions, $known_extensions, $known_nonxs_ext);
if (-f $configsh) {
open FH, $configsh or die "Can't open $configsh: $!";
while (<FH>) {
@@ -437,6 +441,12 @@ unless (@ARGV) {
elsif (/^known_extensions=['"](.*)['"]$/) {
$known_extensions = $1;
}
+ elsif (/^known_nonxs_ext=['"](.*)['"]$/) {
+ $known_nonxs_ext = $1;
+ }
+ }
+ if (!defined $known_nonxs_ext) {
+ warn "No known_nonxs_ext line found in $configsh";
}
if (!defined $known_extensions) {
warn "No known_extensions line found in $configsh";
@@ -449,7 +459,7 @@ unless (@ARGV) {
# a list, might fail if perl is really hosed, but they aren't needed for
# make minitest, and the building of extensions will likely also fail if
# something is that badly wrong.
- push @ARGV, _tests_from_manifest($extensions, $known_extensions);
+ push @ARGV, _tests_from_manifest($extensions, $known_extensions, $known_nonxs_ext);
unless ($::core) {
_find_tests('x2p');
_find_tests('porting');
diff --git a/t/harness b/t/harness
index 7748c26..9b3fc9a 100644
--- a/t/harness
+++ b/t/harness
@@ -162,7 +162,7 @@ if (@ARGV) {
my @last;
push @last, sort { lc $a cmp lc $b }
- _tests_from_manifest($Config{extensions}, $Config{known_extensions});
+ _tests_from_manifest($Config{extensions}, $Config{known_extensions}, $Config{known_nonxs_ext});
push @last, <x2p/*.t>;
my %times;
--
1.6.1.2
|
From @obraOn Sun, Nov 21, 2010 at 03:19:21PM -0800, Jerry D. Hedden wrote:
Hi Jerry, As I mentioned on Thursday, I'd prefer that we not end up with this Best, -Jesse |
The RT System itself - Status changed from 'new' to 'open' |
From @jdheddenThe consensus seems to be in favor of this patch. You're argument The most fundamental philosophy of Perl it the capability to 'roll your Yes, coding up tests correctly to account for modules not being On Sun, Nov 21, 2010 at 19:21, Jesse Vincent <jesse@fsck.com> wrote:
|
From @andk
> The consensus seems to be in favor of this patch. You're argument > The most fundamental philosophy of Perl it the capability to 'roll your > Yes, coding up tests correctly to account for modules not being +1 # like @cpantesters: testers invent their personal testbed -- |
From @TuxOn Sun, 21 Nov 2010 15:19:21 -0800, "Jerry D. Hedden" (via RT)
Not-supported by the system/OS/architecture seems like a good reason to OTOH I don't think that excluding default modules from the CORE, in I also see that these two statements have a conflicting overlap. It is
There is another way to do this. If you run Configure, it will see if config.arch exists and run it if So, if you create one of your own, and put it in the build folder just -- |
From @demerphqOn 22 November 2010 09:01, H.Merijn Brand <h.m.brand@xs4all.nl> wrote:
I dont entirely agree. And we have precedent. When I was working on I hacked the make file to make a minimal target which rebuilt the Its been in-core for years now. I dont think its unreasonable to want to do this /in this way/. That is, i think it would be ok to have a make homebrew or something which did a reduced build cycle, so long as the normal And actually Jerry could use git rerere to set up alocal makefile Yves |
From @janduboisOn Mon, 22 Nov 2010, demerphq wrote:
Not building all the extensions also helps with bisecting (even though [...]
Would you mind adding some tutorial-style docs for this approach to Cheers, |
From @doughera88On Mon, 22 Nov 2010, Jan Dubois wrote:
On balance, I'm in favor of this extension to an existing command-line Equally emphatically, however, I don't think any compensating changes to Incidentally, as H.Merijn has pointed out, you can already do this with an -- |
From @nwc10On Sun, Nov 21, 2010 at 07:55:48PM -0500, Jerry D. Hedden wrote:
What consensus? There was very little comment. Nicholas Clark |
From @jdheddenOn Tue, Nov 23, 2010 at 11:07, Nicholas Clark <nick@ccl4.org> wrote:
Agreed. It was premature. However, there are some that are in favor. |
From @cpansproutOn Tue Nov 23 07:36:50 2010, doughera wrote:
I’m in favour of this patch, as long as we don’t modify the test suite -- Father Chrysostomos |
From @jkeenanOn Fri Jan 06 23:46:45 2012, sprout wrote:
A patch to permit exclusion of non-XS extensions was originally I suspect that if we were to adopt this patch, the maintenance burden Do we want to move forward with this? Thank you very much. |
From @nwc10On Fri, Sep 06, 2013 at 07:12:46PM -0700, James E Keenan via RT wrote:
Yes, I think that we should, but specifically as sprout states, that we I don't think that it will a significant ongoing burden on the Configure It would be a long term cost if we start to feel the need to add skip()s Nicholas Clark |
From @jkeenanOn Fri, 13 Sep 2013 12:38:30 GMT, nicholas wrote:
Jerry (original poster): Would you like to draw a new version of this patch against blead and re-submit it? That would give us something to consider after 5.26.0 is released. (Otherwise, the ticket is so old that it should be closed.) Thank you very much. -- |
From @jdheddenI no longer involve myself with building custom versions of perl as I did On Sun, Feb 26, 2017 at 6:46 PM, James E Keenan via RT <
|
From @jkeenanOn Tue, 28 Feb 2017 02:50:47 GMT, jdhedden@cpan.org wrote:
Accordingly, closing. Thanks for getting back to us on this. -- |
@jkeenan - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#79538 (status was 'rejected')
Searchable as RT79538$
The text was updated successfully, but these errors were encountered: