[libvirt] [perl PATCH] Switch over to using Module::Build

Daniel P. Berrangé posted 1 patch 5 years, 11 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
.gitignore                 |  17 +++----
Build.PL                   | 102 +++++++++++++++++++++++++++++++++++++
MANIFEST                   |  73 ++++++++++++++++++++++++++
MANIFEST.SKIP              |  20 --------
META.yml.PL                |  55 --------------------
Makefile.PL                |  85 -------------------------------
autobuild.sh               |  55 +++-----------------
Virt.xs => lib/Sys/Virt.xs |   0
perl-Sys-Virt.spec.PL      |  45 ++++++++--------
t/030-api-coverage.t       |   2 +-
10 files changed, 210 insertions(+), 244 deletions(-)
create mode 100755 Build.PL
create mode 100644 MANIFEST
delete mode 100644 MANIFEST.SKIP
delete mode 100644 META.yml.PL
delete mode 100644 Makefile.PL
rename Virt.xs => lib/Sys/Virt.xs (100%)
[libvirt] [perl PATCH] Switch over to using Module::Build
Posted by Daniel P. Berrangé 5 years, 11 months ago
The Module::Build system is nicer than ExtUtils::MakeMaker as it allows
for better cross-platform portability by only relying on Perl, rather
than both Perl and system 'make' binary.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 .gitignore                 |  17 +++----
 Build.PL                   | 102 +++++++++++++++++++++++++++++++++++++
 MANIFEST                   |  73 ++++++++++++++++++++++++++
 MANIFEST.SKIP              |  20 --------
 META.yml.PL                |  55 --------------------
 Makefile.PL                |  85 -------------------------------
 autobuild.sh               |  55 +++-----------------
 Virt.xs => lib/Sys/Virt.xs |   0
 perl-Sys-Virt.spec.PL      |  45 ++++++++--------
 t/030-api-coverage.t       |   2 +-
 10 files changed, 210 insertions(+), 244 deletions(-)
 create mode 100755 Build.PL
 create mode 100644 MANIFEST
 delete mode 100644 MANIFEST.SKIP
 delete mode 100644 META.yml.PL
 delete mode 100644 Makefile.PL
 rename Virt.xs => lib/Sys/Virt.xs (100%)

diff --git a/.gitignore b/.gitignore
index dc0ba62..3f08c79 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,17 +1,12 @@
-*.swp
 *~
-MANIFEST
 META.yml
+META.json
 MYMETA.*
-Makefile
-Makefile.old
+Makefile.PL
 Sys-Virt-*.tar.gz
-Virt.bs
-Virt.c
-Virt.o
 blib/
-cover_db
 perl-Sys-Virt.spec
-pm_to_blib
-results.log
-tags
+lib/Sys/Virt\.c
+lib/Sys/Virt\.o
+_build/
+Build
diff --git a/Build.PL b/Build.PL
new file mode 100755
index 0000000..13a0e4f
--- /dev/null
+++ b/Build.PL
@@ -0,0 +1,102 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2009-2018 Red Hat, Inc.
+# Copyright (C) 2009 Daniel P. Berrange
+#
+# This program is free software; You can redistribute it and/or modify
+# it under the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any
+# later version
+#
+# The file "LICENSE" distributed along with this file provides full
+# details of the terms and conditions
+#
+
+use Module::Build;
+
+use strict;
+use warnings;
+
+my $libvirtver = "4.4.0";
+my $stat = system "pkg-config --atleast-version=$libvirtver libvirt";
+die "cannot run pkg-config to check libvirt version" if $stat == -1;
+die "libvirt >= $libvirtver is required\n" unless $stat == 0;
+
+my $LIBVIRT_LIBS = `pkg-config --libs libvirt`;
+my $LIBVIRT_CFLAGS = `pkg-config --cflags libvirt`;
+
+my $GCC_CFLAGS = "";
+if ($ENV{TEST_MAINTAINER}) {
+    $GCC_CFLAGS = qq(
+ -W -Waddress -Wall -Warray-bounds -Wattributes
+ -Wbad-function-cast -Wbuiltin-macro-redefined -Wcast-align
+ -Wchar-subscripts -Wclobbered -Wcomment -Wcomments
+ -Wcoverage-mismatch -Wcpp -Wdeprecated-declarations
+ -Wdisabled-optimization -Wdiv-by-zero -Wdouble-promotion
+ -Wempty-body -Wendif-labels -Wextra -Wformat-contains-nul
+ -Wformat-extra-args -Wformat-security -Wformat-y2k
+ -Wformat-zero-length -Wformat=2 -Wfree-nonheap-object
+ -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration
+ -Wimplicit-int -Winit-self -Wint-to-pointer-cast
+ -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init
+ -Wlogical-op -Wmain -Wmaybe-uninitialized -Wmissing-braces
+ -Wmissing-declarations -Wmissing-field-initializers
+ -Wmissing-format-attribute -Wmissing-include-dirs
+ -Wmissing-noreturn -Wmissing-parameter-type
+ -Wmultichar -Wnarrowing -Wnonnull
+ -Wnormalized=nfc -Wold-style-declaration -Wold-style-definition
+ -Woverflow -Woverride-init -Wpacked-bitfield-compat -Wparentheses
+ -Wpointer-arith -Wpointer-sign -Wpointer-to-int-cast -Wpragmas
+ -Wreturn-type -Wsequence-point -Wno-shadow -Wstrict-aliasing
+ -Wstrict-prototypes -Wsuggest-attribute=const
+ -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wswitch
+ -Wsync-nand -Wtrampolines -Wtrigraphs -Wtype-limits -Wuninitialized
+ -Wunknown-pragmas -Wunused -Wunused-but-set-parameter
+ -Wunused-but-set-variable -Wunused-function -Wunused-label
+ -Wunused-local-typedefs -Wno-unused-parameter -Wunused-result
+ -Wunused-value -Wunused-variable -Wvariadic-macros
+ -Wvector-operation-performance -Wvolatile-register-var
+ -Wwrite-strings -Wno-sign-compare -Wjump-misses-init
+ -Wno-format-nonliteral -Wframe-larger-than=8192
+ -Wno-suggest-attribute=pure -Wno-suggest-attribute=const
+ -Wno-cast-function-type
+	);
+}
+
+my $b = Module::Build->new(
+    module_name => "Sys::Virt",
+    license => 'gpl',
+    configure_requires => {
+	'Module::Build' => 0,
+    },
+    create_makefile_pl => 'small',
+    dist_author => 'Daniel Berrange <dan@berrange.com>',
+    dist_abstract => 'libvirt Perl API',
+    requires => {
+        'perl' => '5.8.0',
+    },
+    extra_compiler_flags => $GCC_CFLAGS . $LIBVIRT_CFLAGS,
+    extra_linker_flags => $LIBVIRT_LIBS,
+    build_requires => {
+	'ExtUtils::CBuilder' => 0,
+	'Sys::Hostname' => 0,
+	'Test::CPAN::Changes' => 0,
+	'Test::More' => 0,
+        'Test::Pod' => '0',
+	'Test::Pod::Coverage' => '0',
+	'Time::HiRes' => 0,
+	'XML::XPath' => 0,
+	'XML::XPath::XMLParser' => 0,
+    },
+    script_files => [],
+    meta_add => {
+        resources => {
+            license => "http://www.gnu.org/licenses/gpl.html",
+            homepage =>  "http://libvirt.org/",
+            repository => "https://libvirt.org/git/?p=libvirt-perl.git;a=summary",
+            MailingList => "http://www.redhat.com/mailman/listinfo/libvir-list",
+        },
+    },
+    PL_files => { 'perl-Sys-Virt.spec.PL' => 'perl-Sys-Virt.spec' },
+    );
+$b->create_build_script;
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..d425ef1
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,73 @@
+.gitignore
+.gitpublish
+AUTHORS
+Build.PL
+Changes
+HACKING
+INSTALL
+LICENSE
+README
+autobuild.sh
+examples/auth.pl
+examples/devices.pl
+examples/dhcp-leases.pl
+examples/dom-fsinfo.pl
+examples/dom-ifinfo.pl
+examples/dom-migrate.pl
+examples/dom-stats.pl
+examples/dump-info.pl
+examples/dump-xml.pl
+examples/emulator-pin.pl
+examples/events.pl
+examples/fs-freeze.pl
+examples/hv-stat.pl
+examples/iothreadinfo.pl
+examples/node-alloc.pl
+examples/node-cpu.pl
+examples/node-devlist.pl
+examples/node-info.pl
+examples/node-ksm.pl
+examples/open-console.pl
+examples/save-restore.pl
+examples/send-key.pl
+examples/vcpuinfo.pl
+examples/vol-download-all.pl
+examples/vol-download-nonblock.pl
+examples/vol-download.pl
+examples/vol-sparse.pl
+examples/vol-upload-all.pl
+examples/vol-upload-nonblock.pl
+examples/vol-upload.pl
+lib/Sys/Virt.pm
+lib/Sys/Virt.xs
+lib/Sys/Virt/Domain.pm
+lib/Sys/Virt/DomainSnapshot.pm
+lib/Sys/Virt/Error.pm
+lib/Sys/Virt/Event.pm
+lib/Sys/Virt/Interface.pm
+lib/Sys/Virt/NWFilter.pm
+lib/Sys/Virt/Network.pm
+lib/Sys/Virt/NodeDevice.pm
+lib/Sys/Virt/Secret.pm
+lib/Sys/Virt/StoragePool.pm
+lib/Sys/Virt/StorageVol.pm
+lib/Sys/Virt/Stream.pm
+perl-Sys-Virt.spec
+perl-Sys-Virt.spec.PL
+Makefile.PL
+t/005-pod.t
+t/010-pod-coverage.t
+t/015-changes.t
+t/020-constants.t
+t/030-api-coverage.t
+t/100-connect.t
+t/200-domains.t
+t/300-networks.t
+t/400-storage-pools.t
+t/500-storage-vols.t
+t/600-interfaces.t
+t/800-events.t
+typemap
+Makefile.PL
+META.yml
+META.json
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
deleted file mode 100644
index ebce958..0000000
--- a/MANIFEST.SKIP
+++ /dev/null
@@ -1,20 +0,0 @@
-pm_to_blib
-Virt\.o
-Virt\.c
-Virt\.bs
-Virt\.xsc
-.*.old
-Sys-Virt-
-blib
-.*\.bak
-CVS
-.cvsignore
-.*~
-.#.*
-#.*
-^Makefile$
-^cover_db/
-.hg
-.*\.orig
-.*\.sh
-\.git
diff --git a/META.yml.PL b/META.yml.PL
deleted file mode 100644
index 0467309..0000000
--- a/META.yml.PL
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (C) 2008 Daniel Berrange <dan@berrange.com>
-
-use strict;
-use warnings;
-
-die unless (scalar @ARGV == 1);
-
-open SRC, "lib/Sys/Virt.pm"
-    or die "lib/Sys/Virt.pm: $!";
-
-our $VERSION;
-while (<SRC>) {
-    if (/\$VERSION\s*=\s*'(.*)'/) {
-	$VERSION=$1;
-    }
-}
-close SRC;
-
-local $/ = undef;
-$_ = <DATA>;
-s/\@VERSION\@/$VERSION/g;
-
-open SPEC, ">$ARGV[0]" or die "$!";
-print SPEC $_;
-close SPEC;
-__DATA__
---- #YAML:1.0
-name:         Sys-Virt
-abstract:     Extension for the libvirt library
-version:      @VERSION@
-author:
-  - Daniel P. Berrange <dan@berrange.com>
-license: perl
-generated_by: ExtUtils::MakeMaker version 6.30
-build_requires:
-   Test::More:                    0
-   Test::Pod:                     0
-   Test::Pod::Coverage:           0
-   Test::CPAN::Changes:           0
-   XML::XPath:                    0
-   XML::XPath::XMLParser:         0
-   Sys::Hostname:                 0
-   Time::HiRes:                   0
-
-resources:
-  license: http://dev.perl.org/licenses/
-  homepage: http://libvirt.org/
-  repository: http://libvirt.org/git/?p=libvirt-perl.git;a=summary
-  MailingList: http://www.redhat.com/mailman/listinfo/libvir-list
-
-distribution_type: module
-
-meta-spec:
-   version: 1.3
-   url: http://module-build.sourceforge.net/META-spec-v1.3.html
diff --git a/Makefile.PL b/Makefile.PL
deleted file mode 100644
index f72e210..0000000
--- a/Makefile.PL
+++ /dev/null
@@ -1,85 +0,0 @@
-use 5.006;
-use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
-
-my $libvirtver = "4.4.0";
-my $stat = system "pkg-config --atleast-version=$libvirtver libvirt";
-die "cannot run pkg-config to check libvirt version" if $stat == -1;
-die "libvirt >= $libvirtver is required\n" unless $stat == 0;
-
-my $LIBVIRT_LIBS = `pkg-config --libs libvirt`;
-my $LIBVIRT_CFLAGS = `pkg-config --cflags libvirt`;
-
-my $gccflags = "-W -Waddress -Wall -Warray-bounds -Wattributes \\
- -Wbad-function-cast -Wbuiltin-macro-redefined -Wcast-align \\
- -Wchar-subscripts -Wclobbered -Wcomment -Wcomments \\
- -Wcoverage-mismatch -Wcpp -Wdeprecated-declarations \\
- -Wdisabled-optimization -Wdiv-by-zero -Wdouble-promotion \\
- -Wempty-body -Wendif-labels -Wextra -Wformat-contains-nul \\
- -Wformat-extra-args -Wformat-security -Wformat-y2k \\
- -Wformat-zero-length -Wformat=2 -Wfree-nonheap-object \\
- -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration \\
- -Wimplicit-int -Winit-self -Wint-to-pointer-cast \\
- -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init \\
- -Wlogical-op -Wmain -Wmaybe-uninitialized -Wmissing-braces \\
- -Wmissing-declarations -Wmissing-field-initializers \\
- -Wmissing-format-attribute -Wmissing-include-dirs \\
- -Wmissing-noreturn -Wmissing-parameter-type \\
- -Wmultichar -Wnarrowing -Wnonnull \\
- -Wnormalized=nfc -Wold-style-declaration -Wold-style-definition \\
- -Woverflow -Woverride-init -Wpacked-bitfield-compat -Wparentheses \\
- -Wpointer-arith -Wpointer-sign -Wpointer-to-int-cast -Wpragmas \\
- -Wreturn-type -Wsequence-point -Wno-shadow -Wstrict-aliasing \\
- -Wstrict-prototypes -Wsuggest-attribute=const \\
- -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wswitch \\
- -Wsync-nand -Wtrampolines -Wtrigraphs -Wtype-limits -Wuninitialized \\
- -Wunknown-pragmas -Wunused -Wunused-but-set-parameter \\
- -Wunused-but-set-variable -Wunused-function -Wunused-label \\
- -Wunused-local-typedefs -Wno-unused-parameter -Wunused-result \\
- -Wunused-value -Wunused-variable -Wvariadic-macros \\
- -Wvector-operation-performance -Wvolatile-register-var \\
- -Wwrite-strings -Wno-sign-compare -Wjump-misses-init \\
- -Wno-format-nonliteral -Wframe-larger-than=8192 \\
- -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -Werror";
-
-my $cflags;
-if ($ENV{TEST_MAINTAINER}) {
-    $cflags = $gccflags;
-} else {
-    $cflags = "-Wall";
-}
-
-WriteMakefile(
-	      'NAME' => 'Sys::Virt',
-	      'VERSION_FROM' => 'lib/Sys/Virt.pm',
-	      'PREREQ_PM' => {
-		  'Test::More'  => 0,
-		  'Test::Pod'  => 0,
-		  'Test::Pod::Coverage'  => 0,
-		  'Test::CPAN::Changes'  => 0,
-		  'Time::HiRes'  => 0,
-		  'XML::XPath' => 0,
-		  },
-	      'AUTHOR' => 'Daniel Berrange <dan@berrange.com>',
-	      'LIBS' => [$LIBVIRT_LIBS],
-	      'INC' => "$cflags $LIBVIRT_CFLAGS",
-	      'depend' => {
-		  Sys-Virt.spec => '$(VERSION_FROM)',
-		  Makefile => '$(VERSION_FROM)',
-	      },
-              'NO_META' => 1,
-	      'realclean' => {
-		  FILES => 'Sys-Virt.spec',
-	      },
-);
-
-package MY;
-
-sub libscan
-  {
-    my ($self, $path) = @_;
-    ($path =~ /\~$/ || $path =~ m,/CVS/,) ? undef : $path;
-  }
-
-__END__
diff --git a/autobuild.sh b/autobuild.sh
index 8a6d102..597b9bf 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -7,53 +7,18 @@ NAME=Sys-Virt
 
 set -e
 
-test -n "$1" && RESULTS=$1 || RESULTS=results.log
-: ${AUTOBUILD_INSTALL_ROOT=$HOME/builder}
+rm -rf blib _build Build $NAME-*.tar.gz
 
-make -k realclean ||:
-rm -rf MANIFEST blib pm_to_blib
+test -z "$AUTOBUILD_INSTALL_ROOT" && AUTOBUILD_INSTALL_ROOT=$HOME/builder
 
 export TEST_MAINTAINER=1
 
-perl Makefile.PL  PREFIX=$AUTOBUILD_INSTALL_ROOT
+perl Build.PL install_base=$AUTOBUILD_INSTALL_ROOT
 
-rm -f MANIFEST
-
-# Build the RPM.
-make
-make manifest
-
-if [ -z "$USE_COVER" ]; then
-  perl -MDevel::Cover -e '' 1>/dev/null 2>&1 && USE_COVER=1 || USE_COVER=0
-fi
-
-if [ -z "$SKIP_TESTS" -o "$SKIP_TESTS" = "0" ]; then
-  if [ "$USE_COVER" = "1" ]; then
-    cover -delete
-    export HARNESS_PERL_SWITCHES=-MDevel::Cover
-  fi
-
-  # set -o pipefail is a bashism; this use of exec is the POSIX alternative
-  exec 3>&1
-  st=$(
-      exec 4>&1 >&3
-      { make test 2>&1 3>&- 4>&-; echo $? >&4; } | tee "$RESULTS"
-  )
-  exec 3>&-
-  test "$st" = 0
-
-  if [ "$USE_COVER" = "1" ]; then
-    cover
-    mkdir blib/coverage
-    cp -a cover_db/*.html cover_db/*.css blib/coverage
-    mv blib/coverage/coverage.html blib/coverage/index.html
-  fi
-fi
-
-make install
-
-rm -f $NAME-*.tar.gz
-make dist
+./Build
+./Build test
+./Build install
+./Build dist
 
 if [ -f /usr/bin/rpmbuild ]; then
   if [ -n "$AUTOBUILD_COUNTER" ]; then
@@ -65,10 +30,4 @@ if [ -f /usr/bin/rpmbuild ]; then
   rpmbuild --nodeps -ta --define "extra_release $EXTRA_RELEASE" --clean $NAME-*.tar.gz
 fi
 
-# Skip debian pkg for now
 exit 0
-
-if [ -f /usr/bin/fakeroot ]; then
-  fakeroot debian/rules clean
-  fakeroot debian/rules DESTDIR=$HOME/packages/debian binary
-fi
diff --git a/Virt.xs b/lib/Sys/Virt.xs
similarity index 100%
rename from Virt.xs
rename to lib/Sys/Virt.xs
diff --git a/perl-Sys-Virt.spec.PL b/perl-Sys-Virt.spec.PL
index dbb749d..e5140b6 100644
--- a/perl-Sys-Virt.spec.PL
+++ b/perl-Sys-Virt.spec.PL
@@ -6,15 +6,19 @@ use strict;
 
 die unless (scalar @ARGV == 1);
 
-unless (do './lib/Sys/Virt.pm')
-  {
-    if ($@) { die $@ };
-    die "lib/Sys/Virt.pm: $!";
-  }
+open PM, './lib/Sys/Virt.pm' or die "lib/Sys/Virt.pm: $!";
+my $ver;
+while (<PM>) {
+    if (/our \$VERSION = '(.*)'/) {
+        $ver = $1;
+	last;
+    }
+}
+die "cannot find version" unless $ver;
 
 local $/ = undef;
 $_ = <DATA>;
-s/\@VERSION\@/$Sys::Virt::VERSION/g;
+s/\@VERSION\@/$ver/g;
 
 open SPEC, ">$ARGV[0]" or die "$!";
 print SPEC $_;
@@ -29,9 +33,10 @@ Summary:        Represent and manage a libvirt hypervisor connection
 License:        GPLv2+ or Artistic
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/Sys-Virt/
-Source0:        http://www.cpan.org/authors/id/D/DA/DANBERR/Sys-Virt-%{version}.tar.gz
+Source0:        http://www.cpan.org/authors/id/D/DA/DANBERR/Sys-Virt-v%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires:  perl(ExtUtils::MakeMaker)
+BuildRequires:  perl(ExtUtils::CBuilder)
+BuildRequires:  perl(Module::Build)
 BuildRequires:  perl(Test::Pod)
 BuildRequires:  perl(Test::Pod::Coverage)
 BuildRequires:  perl(Test::CPAN::Changes)
@@ -46,32 +51,24 @@ machine management APIs. This allows machines running within arbitrary
 virtualization containers to be managed with a consistent API.
 
 %prep
-%setup -q -n Sys-Virt-%{version}
+%setup -q -n Sys-Virt-v%{version}
 
-sed -i -e '/Sys-Virt\.spec/d' Makefile.PL
-sed -i -e '/\.spec\.PL$/d' MANIFEST
-rm -f *.spec.PL
 
 %build
-%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
-make %{?_smp_mflags}
+%{__perl} Build.PL installdirs=vendor
+./Build
 
 %install
-rm -rf $RPM_BUILD_ROOT
+./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
 
-make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
-
-find $RPM_BUILD_ROOT -type f \( -name .packlist -o -name '*.bs' -empty \) |
-	xargs rm -f
-find $RPM_BUILD_ROOT -depth -type d -empty -exec rmdir {} \;
+#find $RPM_BUILD_ROOT -type f \( -name .packlist -o -name '*.bs' -empty \) |
+#	xargs rm -f
+#find $RPM_BUILD_ROOT -depth -type d -empty -exec rmdir {} \;
 
 %{_fixperms} $RPM_BUILD_ROOT/*
 
 %check
-make test
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+./Build test
 
 %files
 %defattr(-,root,root,-)
diff --git a/t/030-api-coverage.t b/t/030-api-coverage.t
index 95bbd11..39d6146 100644
--- a/t/030-api-coverage.t
+++ b/t/030-api-coverage.t
@@ -48,7 +48,7 @@ foreach my $n ($set->get_nodelist) {
     push @macros, $n->getData();
 }
 
-open XS, "<Virt.xs" or die "cannot read Virt.xs: $!";
+open XS, "<lib/Sys/Virt.xs" or die "cannot read lib/Sys/Virt.xs: $!";
 
 my $xs;
 {
-- 
2.17.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [perl PATCH] Switch over to using Module::Build
Posted by Andrea Bolognani 5 years, 11 months ago
On Tue, 2018-05-15 at 16:32 +0100, Daniel P. Berrangé wrote:
> The Module::Build system is nicer than ExtUtils::MakeMaker as it allows
> for better cross-platform portability by only relying on Perl, rather
> than both Perl and system 'make' binary.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  .gitignore                 |  17 +++----
>  Build.PL                   | 102 +++++++++++++++++++++++++++++++++++++
>  MANIFEST                   |  73 ++++++++++++++++++++++++++
>  MANIFEST.SKIP              |  20 --------
>  META.yml.PL                |  55 --------------------
>  Makefile.PL                |  85 -------------------------------
>  autobuild.sh               |  55 +++-----------------
>  Virt.xs => lib/Sys/Virt.xs |   0
>  perl-Sys-Virt.spec.PL      |  45 ++++++++--------
>  t/030-api-coverage.t       |   2 +-
>  10 files changed, 210 insertions(+), 244 deletions(-)
>  create mode 100755 Build.PL
>  create mode 100644 MANIFEST
>  delete mode 100644 MANIFEST.SKIP
>  delete mode 100644 META.yml.PL
>  delete mode 100644 Makefile.PL
>  rename Virt.xs => lib/Sys/Virt.xs (100%)

Disclaimer: I know nothing about Perl.

[...]
> diff --git a/MANIFEST b/MANIFEST
> new file mode 100644
> index 0000000..d425ef1
> --- /dev/null
> +++ b/MANIFEST
> @@ -0,0 +1,73 @@
> +.gitignore
> +.gitpublish
> +AUTHORS
> +Build.PL
> +Changes
> +HACKING
> +INSTALL
> +LICENSE
> +README
> +autobuild.sh

We renamed this script a week or so ago. Please make sure you
pull before hacking next time ;)

[...]
> diff --git a/autobuild.sh b/autobuild.sh
> index 9a6d102..597b9bf 100755
> --- a/autobuild.sh
> +++ b/autobuild.sh
> @@ -7,53 +7,18 @@ NAME=Sys-Virt
>  
>  set -e
>  
> -test -n "$1" && RESULTS=$1 || RESULTS=results.log
> -: ${AUTOBUILD_INSTALL_ROOT=$HOME/builder}
> +rm -rf blib _build Build $NAME-*.tar.gz
>  
> -make -k realclean ||:
> -rm -rf MANIFEST blib pm_to_blib
> +test -z "$AUTOBUILD_INSTALL_ROOT" && AUTOBUILD_INSTALL_ROOT=$HOME/builder
>  
>  export TEST_MAINTAINER=1
>  
> -perl Makefile.PL  PREFIX=$AUTOBUILD_INSTALL_ROOT
> +perl Build.PL install_base=$AUTOBUILD_INSTALL_ROOT
>  
> -rm -f MANIFEST
> -
> -# Build the RPM.
> -make
> -make manifest
> -
> -if [ -z "$USE_COVER" ]; then
> -  perl -MDevel::Cover -e '' 1>/dev/null 2>&1 && USE_COVER=1 || USE_COVER=0
> -fi
> -
> -if [ -z "$SKIP_TESTS" -o "$SKIP_TESTS" = "0" ]; then
> -  if [ "$USE_COVER" = "1" ]; then
> -    cover -delete
> -    export HARNESS_PERL_SWITCHES=-MDevel::Cover
> -  fi
> -
> -  # set -o pipefail is a bashism; this use of exec is the POSIX alternative
> -  exec 3>&1
> -  st=$(
> -      exec 4>&1 >&3
> -      { make test 2>&1 3>&- 4>&-; echo $? >&4; } | tee "$RESULTS"
> -  )
> -  exec 3>&-
> -  test "$st" = 0
> -
> -  if [ "$USE_COVER" = "1" ]; then
> -    cover
> -    mkdir blib/coverage
> -    cp -a cover_db/*.html cover_db/*.css blib/coverage
> -    mv blib/coverage/coverage.html blib/coverage/index.html
> -  fi
> -fi
> -
> -make install
> -
> -rm -f $NAME-*.tar.gz
> -make dist
> +./Build
> +./Build test
> +./Build install
> +./Build dist
>  
>  if [ -f /usr/bin/rpmbuild ]; then
>    if [ -n "$AUTOBUILD_COUNTER" ]; then
> @@ -65,10 +30,4 @@ if [ -f /usr/bin/rpmbuild ]; then
>    rpmbuild --nodeps -ta --define "extra_release $EXTRA_RELEASE" --clean $NAME-*.tar.gz
>  fi
>  
> -# Skip debian pkg for now
>  exit 0
> -
> -if [ -f /usr/bin/fakeroot ]; then
> -  fakeroot debian/rules clean
> -  fakeroot debian/rules DESTDIR=$HOME/packages/debian binary
> -fi

This hunk doesn't apply at all now, of course...


Lastly, the RPM build fails with

  RPM build errors:
      Empty %files file /home/test/libvirt-perl/rpmbuild/BUILD/Sys-Virt-v4.4.0/debugsourcefiles.list

on Fedora. It passes on CentOS 7, though.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [perl PATCH] Switch over to using Module::Build
Posted by Daniel P. Berrangé 5 years, 11 months ago
On Tue, May 15, 2018 at 07:23:28PM +0200, Andrea Bolognani wrote:
> On Tue, 2018-05-15 at 16:32 +0100, Daniel P. Berrangé wrote:
> > The Module::Build system is nicer than ExtUtils::MakeMaker as it allows
> > for better cross-platform portability by only relying on Perl, rather
> > than both Perl and system 'make' binary.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >  .gitignore                 |  17 +++----
> >  Build.PL                   | 102 +++++++++++++++++++++++++++++++++++++
> >  MANIFEST                   |  73 ++++++++++++++++++++++++++
> >  MANIFEST.SKIP              |  20 --------
> >  META.yml.PL                |  55 --------------------
> >  Makefile.PL                |  85 -------------------------------
> >  autobuild.sh               |  55 +++-----------------
> >  Virt.xs => lib/Sys/Virt.xs |   0
> >  perl-Sys-Virt.spec.PL      |  45 ++++++++--------
> >  t/030-api-coverage.t       |   2 +-
> >  10 files changed, 210 insertions(+), 244 deletions(-)
> >  create mode 100755 Build.PL
> >  create mode 100644 MANIFEST
> >  delete mode 100644 MANIFEST.SKIP
> >  delete mode 100644 META.yml.PL
> >  delete mode 100644 Makefile.PL
> >  rename Virt.xs => lib/Sys/Virt.xs (100%)
> 
> Disclaimer: I know nothing about Perl.
> 
> [...]
> > diff --git a/MANIFEST b/MANIFEST
> > new file mode 100644
> > index 0000000..d425ef1
> > --- /dev/null
> > +++ b/MANIFEST
> > @@ -0,0 +1,73 @@
> > +.gitignore
> > +.gitpublish
> > +AUTHORS
> > +Build.PL
> > +Changes
> > +HACKING
> > +INSTALL
> > +LICENSE
> > +README
> > +autobuild.sh
> 
> We renamed this script a week or so ago. Please make sure you
> pull before hacking next time ;)

Heh, yeah, i sent a v2 that is rebased to master.

> 
> [...]
> > diff --git a/autobuild.sh b/autobuild.sh
> > index 9a6d102..597b9bf 100755
> > --- a/autobuild.sh
> > +++ b/autobuild.sh

> 
> This hunk doesn't apply at all now, of course...
> 
> 
> Lastly, the RPM build fails with
> 
>   RPM build errors:
>       Empty %files file /home/test/libvirt-perl/rpmbuild/BUILD/Sys-Virt-v4.4.0/debugsourcefiles.list
> 
> on Fedora. It passes on CentOS 7, though.

Rather strange - i have no trouble with that on Fedora 28 at least.

How were you triggering the RPM build ?  I wonder if perhaps there was
any stale files from MakeMaker causing it ?

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [perl PATCH] Switch over to using Module::Build
Posted by Andrea Bolognani 5 years, 11 months ago
On Tue, 2018-05-15 at 18:55 +0100, Daniel P. Berrangé wrote:
> On Tue, May 15, 2018 at 07:23:28PM +0200, Andrea Bolognani wrote:
> > Lastly, the RPM build fails with
> > 
> >   RPM build errors:
> >       Empty %files file /home/test/libvirt-perl/rpmbuild/BUILD/Sys-Virt-v4.4.0/debugsourcefiles.list
> > 
> > on Fedora. It passes on CentOS 7, though.
> 
> Rather strange - i have no trouble with that on Fedora 28 at least.
> 
> How were you triggering the RPM build ?  I wonder if perhaps there was
> any stale files from MakeMaker causing it ?

I made sure the source tree was git clean'd before starting the
build.

Note that I'm testing this in guests which have been created using
the same steps as the ones in the CentOS CI environment, so it's
pretty likely that something on your system is masking the failure.

I'm attaching the rpmbuild output, maybe you'll find something
useful in there.

-- 
Andrea Bolognani / Red Hat / Virtualizationrpmbuild --define "_topdir `pwd`/rpmbuild" -ta *.tar.gz
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.1ivTEr
+ umask 022
+ cd /home/test/libvirt-perl/rpmbuild/BUILD
+ cd /home/test/libvirt-perl/rpmbuild/BUILD
+ rm -rf Sys-Virt-v4.4.0
+ /usr/bin/gzip -dc /home/test/libvirt-perl/Sys-Virt-v4.4.0.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd Sys-Virt-v4.4.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .  
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.3bQ3Yu
+ umask 022
+ cd /home/test/libvirt-perl/rpmbuild/BUILD
+ cd Sys-Virt-v4.4.0
+ /usr/bin/perl Build.PL installdirs=vendor
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Sys-Virt' version 'v4.4.0'
+ ./Build
Building Sys-Virt
ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Sys/Virt/Virt.bs')
gcc -lpthread -shared -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -fstack-protector-strong -lperl -o blib/arch/auto/Sys/Virt/Virt.so lib/Sys/Virt.o -L/home/test/build/lib
virt/lib -lvirt
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.A9ONYC
+ umask 022
+ cd /home/test/libvirt-perl/rpmbuild/BUILD
+ '[' /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64 '!=' / ']'
+ rm -rf /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64
++ dirname /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64
+ mkdir -p /home/test/libvirt-perl/rpmbuild/BUILDROOT
+ mkdir /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64
+ cd Sys-Virt-v4.4.0
+ ./Build install destdir=/home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64 create_packlist=0
Building Sys-Virt
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/auto/Sys/Virt/Virt.so
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/auto/Sys/Virt/Virt.bs
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Event.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Network.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Stream.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Interface.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/NWFilter.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/NodeDevice.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/StorageVol.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/DomainSnapshot.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/StoragePool.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Domain.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Secret.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Error.pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Stream.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Domain.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Error.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::NWFilter.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Secret.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Interface.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::NodeDevice.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Network.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::StorageVol.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::DomainSnapshot.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::StoragePool.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt.3pm
Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Event.3pm
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr
+ /usr/lib/rpm/find-debuginfo.sh -j2 --strict-build-id -m -i --build-id-seed 4.4.0-1.fc28 --unique-debug-suffix -4.4.0-1.fc28.x86_64 --unique-debug-src-base perl-Sys-Virt-4.4.0-1.fc28.x86_64 --run-dwz --dwz-low-me
m-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /home/test/libvirt-perl/rpmbuild/BUILD/Sys-Virt-v4.4.0
extracting debug info from /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/auto/Sys/Virt/Virt.so
/usr/lib/rpm/sepdebugcrcfix: Updated 1 CRC32s, 0 CRC32s did match.
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
/sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-mangle-shebangs '' ''
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.KUl62N
+ umask 022
+ cd /home/test/libvirt-perl/rpmbuild/BUILD
+ cd Sys-Virt-v4.4.0
+ ./Build test
t/005-pod.t ............ ok
t/010-pod-coverage.t ... ok
t/015-changes.t ........ ok   
t/020-constants.t ...... ok     
t/030-api-coverage.t ... skipped: Test only for module maintainer. Set TEST_MAINTAINER=1 to run
t/100-connect.t ........ ok     
t/200-domains.t ........ ok     
t/300-networks.t ....... ok     
t/400-storage-pools.t .. ok     
t/500-storage-vols.t ... ok     
t/600-interfaces.t ..... ok     
t/800-events.t ......... ok     
All tests successful.
Files=12, Tests=252,  2 wallclock secs ( 0.09 usr  0.02 sys +  1.84 cusr  0.21 csys =  2.16 CPU)
Result: PASS
+ exit 0
Processing files: perl-Sys-Virt-4.4.0-1.fc28.x86_64
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.o7Fpq5
+ umask 022
+ cd /home/test/libvirt-perl/rpmbuild/BUILD
+ cd Sys-Virt-v4.4.0
+ DOCDIR=/home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
+ export LC_ALL=C
+ LC_ALL=C
+ export DOCDIR
+ /usr/bin/mkdir -p /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
+ cp -pr AUTHORS /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
+ cp -pr Changes /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
+ cp -pr LICENSE /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
+ cp -pr README /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
+ cp -pr examples/ /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
+ exit 0
Provides: perl-Sys-Virt = 4.4.0-1.fc28 perl-Sys-Virt(x86-64) = 4.4.0-1.fc28
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: libc.so.6()(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.4)(64bit) libperl.so.5.26()(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) libvirt.so.0()(64bit) libvirt.so.0(LIBVIRT_0.0.3)(64bit) libvirt.so.0(LIBVIRT_0.0.5)(64bit) libvirt.so.0(LIBVIRT_0.1.0)(64bit) libvirt.so.0(LIBVIRT_0.1.1)(64bit) libvirt.so.0(LIBVIRT_0.1.4)(64bit) libvirt.so.0(LIBVIRT_0.1.5)(64bit) libvirt.so.0(LIBVIRT_0.1.9)(64bit) libvirt.so.0(LIBVIRT_0.10.0)(64bit) libvirt.so.0(LIBVIRT_0.10.2)(64bit) libvirt.so.0(LIBVIRT_0.2.0)(64bit) libvirt.so.0(LIBVIRT_0.2.1)(64bit) libvirt.so.0(LIBVIRT_0.2.3)(64bit) libvirt.so.0(LIBVIRT_0.3.0)(64bit) libvirt.so.0(LIBVIRT_0.3.2)(64bit) libvirt.so.0(LIBVIRT_0.3.3)(64bit) libvirt.so.0(LIBVIRT_0.4.0)(64bit) libvirt.so.0(LIBVIRT_0.4.1)(64bit) libvirt.so.0(LIBVIRT_0.4.2)(64bit) libvirt.so.0(LIBVIRT_0.4.5)(64bit) libvirt.so.0(LIBVIRT_0.5.0)(64bit) libvirt.so.0(LIBVIRT_0.6.0)(64bit) libvirt.so.0(LIBVIRT_0.6.1)(64bit) libvirt.so.0(LIBVIRT_0.6.3)(64bit) libvirt.so.0(LIBVIRT_0.6.4)(64bit) libvirt.so.0(LIBVIRT_0.7.0)(64bit) libvirt.so.0(LIBVIRT_0.7.1)(64bit) libvirt.so.0(LIBVIRT_0.7.2)(64bit) libvirt.so.0(LIBVIRT_0.7.3)(64bit) libvirt.so.0(LIBVIRT_0.7.5)(64bit) libvirt.so.0(LIBVIRT_0.7.7)(64bit) libvirt.so.0(LIBVIRT_0.8.0)(64bit) libvirt.so.0(LIBVIRT_0.8.1)(64bit) libvirt.so.0(LIBVIRT_0.8.2)(64bit) libvirt.so.0(LIBVIRT_0.8.5)(64bit) libvirt.so.0(LIBVIRT_0.8.6)(64bit) libvirt.so.0(LIBVIRT_0.8.8)(64bit) libvirt.so.0(LIBVIRT_0.9.0)(64bit) libvirt.so.0(LIBVIRT_0.9.10)(64bit) libvirt.so.0(LIBVIRT_0.9.11)(64bit) libvirt.so.0(LIBVIRT_0.9.13)(64bit) libvirt.so.0(LIBVIRT_0.9.2)(64bit) libvirt.so.0(LIBVIRT_0.9.3)(64bit) libvirt.so.0(LIBVIRT_0.9.4)(64bit) libvirt.so.0(LIBVIRT_0.9.5)(64bit) libvirt.so.0(LIBVIRT_0.9.7)(64bit) libvirt.so.0(LIBVIRT_0.9.8)(64bit) libvirt.so.0(LIBVIRT_0.9.9)(64bit) libvirt.so.0(LIBVIRT_1.0.0)(64bit) libvirt.so.0(LIBVIRT_1.0.1)(64bit) libvirt.so.0(LIBVIRT_1.0.2)(64bit) libvirt.so.0(LIBVIRT_1.0.3)(64bit) libvirt.so.0(LIBVIRT_1.0.5)(64bit) libvirt.so.0(LIBVIRT_1.1.0)(64bit) libvirt.so.0(LIBVIRT_1.1.1)(64bit) libvirt.so.0(LIBVIRT_1.1.3)(64bit) libvirt.so.0(LIBVIRT_1.2.1)(64bit) libvirt.so.0(LIBVIRT_1.2.11)(64bit) libvirt.so.0(LIBVIRT_1.2.12)(64bit) libvirt.so.0(LIBVIRT_1.2.14)(64bit) libvirt.so.0(LIBVIRT_1.2.15)(64bit) libvirt.so.0(LIBVIRT_1.2.16)(64bit) libvirt.so.0(LIBVIRT_1.2.19)(64bit) libvirt.so.0(LIBVIRT_1.2.3)(64bit) libvirt.so.0(LIBVIRT_1.2.5)(64bit) libvirt.so.0(LIBVIRT_1.2.6)(64bit) libvirt.so.0(LIBVIRT_1.2.7)(64bit) libvirt.so.0(LIBVIRT_1.2.8)(64bit) libvirt.so.0(LIBVIRT_1.2.9)(64bit) libvirt.so.0(LIBVIRT_1.3.3)(64bit) libvirt.so.0(LIBVIRT_2.0.0)(64bit) libvirt.so.0(LIBVIRT_2.2.0)(64bit) libvirt.so.0(LIBVIRT_3.0.0)(64bit) libvirt.so.0(LIBVIRT_3.1.0)(64bit) libvirt.so.0(LIBVIRT_3.4.0)(64bit) libvirt.so.0(LIBVIRT_3.7.0)(64bit) libvirt.so.0(LIBVIRT_3.9.0)(64bit) libvirt.so.0(LIBVIRT_4.1.0)(64bit) rtld(GNU_HASH)
Processing files: perl-Sys-Virt-debugsource-4.4.0-1.fc28.x86_64
error: Empty %files file /home/test/libvirt-perl/rpmbuild/BUILD/Sys-Virt-v4.4.0/debugsourcefiles.list


RPM build errors:
    Empty %files file /home/test/libvirt-perl/rpmbuild/BUILD/Sys-Virt-v4.4.0/debugsourcefiles.list

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [perl PATCH] Switch over to using Module::Build
Posted by Daniel P. Berrangé 5 years, 11 months ago
On Tue, May 15, 2018 at 08:17:09PM +0200, Andrea Bolognani wrote:
> On Tue, 2018-05-15 at 18:55 +0100, Daniel P. Berrangé wrote:
> > On Tue, May 15, 2018 at 07:23:28PM +0200, Andrea Bolognani wrote:
> > > Lastly, the RPM build fails with
> > > 
> > >   RPM build errors:
> > >       Empty %files file /home/test/libvirt-perl/rpmbuild/BUILD/Sys-Virt-v4.4.0/debugsourcefiles.list
> > > 
> > > on Fedora. It passes on CentOS 7, though.
> > 
> > Rather strange - i have no trouble with that on Fedora 28 at least.
> > 
> > How were you triggering the RPM build ?  I wonder if perhaps there was
> > any stale files from MakeMaker causing it ?
> 
> I made sure the source tree was git clean'd before starting the
> build.
> 
> Note that I'm testing this in guests which have been created using
> the same steps as the ones in the CentOS CI environment, so it's
> pretty likely that something on your system is masking the failure.
> 
> I'm attaching the rpmbuild output, maybe you'll find something
> useful in there.

Is redhat-rpm-config installed ?



> + /usr/bin/perl Build.PL installdirs=vendor
> Created MYMETA.yml and MYMETA.json
> Creating new 'Build' script for 'Sys-Virt' version 'v4.4.0'
> + ./Build
> Building Sys-Virt
> ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Sys/Virt/Virt.bs')
> gcc -lpthread -shared -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -fstack-protector-strong -lperl -o blib/arch/auto/Sys/Virt/Virt.so lib/Sys/Virt.o -L/home/test/build/lib
> virt/lib -lvirt

This is suspect - on mine it is much longer - in particular it has
the -g flag for creating debuginfo packages


+ /usr/bin/perl Build.PL installdirs=vendor
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Sys-Virt' version 'v4.4.0'
+ ./Build
Building Sys-Virt
gcc -I/usr/lib64/perl5/CORE -DVERSION="v4.4.0" -DXS_VERSION="v4.4.0" -fPIC -I/home/berrange/src/virt/libvirt/include -c -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -o lib/Sys/Virt.o lib/Sys/Virt.c
ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Sys/Virt/Virt.bs')
gcc -lpthread -shared -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -fstack-protector-strong -lperl -o blib/arch/auto/Sys/Virt/Virt.so lib/Sys/Virt.o -L/home/berrange/src/virt/libvirt/src/.libs -lvirt




> + exit 0
> Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.A9ONYC
> + umask 022
> + cd /home/test/libvirt-perl/rpmbuild/BUILD
> + '[' /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64 '!=' / ']'
> + rm -rf /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64
> ++ dirname /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64
> + mkdir -p /home/test/libvirt-perl/rpmbuild/BUILDROOT
> + mkdir /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64
> + cd Sys-Virt-v4.4.0
> + ./Build install destdir=/home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64 create_packlist=0
> Building Sys-Virt
> Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/auto/Sys/Virt/Virt.so
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/auto/Sys/Virt/Virt.bs
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Event.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Network.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Stream.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Interface.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/NWFilter.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/NodeDevice.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/StorageVol.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/DomainSnapshot.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/StoragePool.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Domain.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Secret.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/Sys/Virt/Error.pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Stream.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Domain.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Error.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::NWFilter.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Secret.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Interface.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::NodeDevice.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Network.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::StorageVol.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::DomainSnapshot.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::StoragePool.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt.3pm
> Installing /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/man/man3/Sys::Virt::Event.3pm
> + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr
> + /usr/lib/rpm/find-debuginfo.sh -j2 --strict-build-id -m -i --build-id-seed 4.4.0-1.fc28 --unique-debug-suffix -4.4.0-1.fc28.x86_64 --unique-debug-src-base perl-Sys-Virt-4.4.0-1.fc28.x86_64 --run-dwz --dwz-low-me
> m-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /home/test/libvirt-perl/rpmbuild/BUILD/Sys-Virt-v4.4.0
> extracting debug info from /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/lib64/perl5/vendor_perl/auto/Sys/Virt/Virt.so
> /usr/lib/rpm/sepdebugcrcfix: Updated 1 CRC32s, 0 CRC32s did match.
> + /usr/lib/rpm/check-buildroot
> + /usr/lib/rpm/redhat/brp-ldconfig
> /sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory
> + /usr/lib/rpm/brp-compress
> + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
> + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
> + /usr/lib/rpm/brp-python-hardlink
> + /usr/lib/rpm/redhat/brp-mangle-shebangs '' ''
> Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.KUl62N
> + umask 022
> + cd /home/test/libvirt-perl/rpmbuild/BUILD
> + cd Sys-Virt-v4.4.0
> + ./Build test
> t/005-pod.t ............ ok
> t/010-pod-coverage.t ... ok
> t/015-changes.t ........ ok   
> t/020-constants.t ...... ok     
> t/030-api-coverage.t ... skipped: Test only for module maintainer. Set TEST_MAINTAINER=1 to run
> t/100-connect.t ........ ok     
> t/200-domains.t ........ ok     
> t/300-networks.t ....... ok     
> t/400-storage-pools.t .. ok     
> t/500-storage-vols.t ... ok     
> t/600-interfaces.t ..... ok     
> t/800-events.t ......... ok     
> All tests successful.
> Files=12, Tests=252,  2 wallclock secs ( 0.09 usr  0.02 sys +  1.84 cusr  0.21 csys =  2.16 CPU)
> Result: PASS
> + exit 0
> Processing files: perl-Sys-Virt-4.4.0-1.fc28.x86_64
> Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.o7Fpq5
> + umask 022
> + cd /home/test/libvirt-perl/rpmbuild/BUILD
> + cd Sys-Virt-v4.4.0
> + DOCDIR=/home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
> + export LC_ALL=C
> + LC_ALL=C
> + export DOCDIR
> + /usr/bin/mkdir -p /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
> + cp -pr AUTHORS /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
> + cp -pr Changes /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
> + cp -pr LICENSE /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
> + cp -pr README /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
> + cp -pr examples/ /home/test/libvirt-perl/rpmbuild/BUILDROOT/perl-Sys-Virt-4.4.0-1.fc28.x86_64/usr/share/doc/perl-Sys-Virt
> + exit 0
> Provides: perl-Sys-Virt = 4.4.0-1.fc28 perl-Sys-Virt(x86-64) = 4.4.0-1.fc28
> Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
> Requires: libc.so.6()(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.4)(64bit) libperl.so.5.26()(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) libvirt.so.0()(64bit) libvirt.so.0(LIBVIRT_0.0.3)(64bit) libvirt.so.0(LIBVIRT_0.0.5)(64bit) libvirt.so.0(LIBVIRT_0.1.0)(64bit) libvirt.so.0(LIBVIRT_0.1.1)(64bit) libvirt.so.0(LIBVIRT_0.1.4)(64bit) libvirt.so.0(LIBVIRT_0.1.5)(64bit) libvirt.so.0(LIBVIRT_0.1.9)(64bit) libvirt.so.0(LIBVIRT_0.10.0)(64bit) libvirt.so.0(LIBVIRT_0.10.2)(64bit) libvirt.so.0(LIBVIRT_0.2.0)(64bit) libvirt.so.0(LIBVIRT_0.2.1)(64bit) libvirt.so.0(LIBVIRT_0.2.3)(64bit) libvirt.so.0(LIBVIRT_0.3.0)(64bit) libvirt.so.0(LIBVIRT_0.3.2)(64bit) libvirt.so.0(LIBVIRT_0.3.3)(64bit) libvirt.so.0(LIBVIRT_0.4.0)(64bit) libvirt.so.0(LIBVIRT_0.4.1)(64bit) libvirt.so.0(LIBVIRT_0.4.2)(64bit) libvirt.so.0(LIBVIRT_0.4.5)(64bit) libvirt.so.0(LIBVIRT_0.5.0)(64bit) libvirt.so.0(LIBVIRT_0.6.0)(64bit) libvirt.so.0(LIBVIRT_0.6.1)(64bit) libvirt.so.0(LIBVIRT_0.6.3)(64bit) libvirt.so.0(LIBVIRT_0.6.4)(64bit) libvirt.so.0(LIBVIRT_0.7.0)(64bit) libvirt.so.0(LIBVIRT_0.7.1)(64bit) libvirt.so.0(LIBVIRT_0.7.2)(64bit) libvirt.so.0(LIBVIRT_0.7.3)(64bit) libvirt.so.0(LIBVIRT_0.7.5)(64bit) libvirt.so.0(LIBVIRT_0.7.7)(64bit) libvirt.so.0(LIBVIRT_0.8.0)(64bit) libvirt.so.0(LIBVIRT_0.8.1)(64bit) libvirt.so.0(LIBVIRT_0.8.2)(64bit) libvirt.so.0(LIBVIRT_0.8.5)(64bit) libvirt.so.0(LIBVIRT_0.8.6)(64bit) libvirt.so.0(LIBVIRT_0.8.8)(64bit) libvirt.so.0(LIBVIRT_0.9.0)(64bit) libvirt.so.0(LIBVIRT_0.9.10)(64bit) libvirt.so.0(LIBVIRT_0.9.11)(64bit) libvirt.so.0(LIBVIRT_0.9.13)(64bit) libvirt.so.0(LIBVIRT_0.9.2)(64bit) libvirt.so.0(LIBVIRT_0.9.3)(64bit) libvirt.so.0(LIBVIRT_0.9.4)(64bit) libvirt.so.0(LIBVIRT_0.9.5)(64bit) libvirt.so.0(LIBVIRT_0.9.7)(64bit) libvirt.so.0(LIBVIRT_0.9.8)(64bit) libvirt.so.0(LIBVIRT_0.9.9)(64bit) libvirt.so.0(LIBVIRT_1.0.0)(64bit) libvirt.so.0(LIBVIRT_1.0.1)(64bit) libvirt.so.0(LIBVIRT_1.0.2)(64bit) libvirt.so.0(LIBVIRT_1.0.3)(64bit) libvirt.so.0(LIBVIRT_1.0.5)(64bit) libvirt.so.0(LIBVIRT_1.1.0)(64bit) libvirt.so.0(LIBVIRT_1.1.1)(64bit) libvirt.so.0(LIBVIRT_1.1.3)(64bit) libvirt.so.0(LIBVIRT_1.2.1)(64bit) libvirt.so.0(LIBVIRT_1.2.11)(64bit) libvirt.so.0(LIBVIRT_1.2.12)(64bit) libvirt.so.0(LIBVIRT_1.2.14)(64bit) libvirt.so.0(LIBVIRT_1.2.15)(64bit) libvirt.so.0(LIBVIRT_1.2.16)(64bit) libvirt.so.0(LIBVIRT_1.2.19)(64bit) libvirt.so.0(LIBVIRT_1.2.3)(64bit) libvirt.so.0(LIBVIRT_1.2.5)(64bit) libvirt.so.0(LIBVIRT_1.2.6)(64bit) libvirt.so.0(LIBVIRT_1.2.7)(64bit) libvirt.so.0(LIBVIRT_1.2.8)(64bit) libvirt.so.0(LIBVIRT_1.2.9)(64bit) libvirt.so.0(LIBVIRT_1.3.3)(64bit) libvirt.so.0(LIBVIRT_2.0.0)(64bit) libvirt.so.0(LIBVIRT_2.2.0)(64bit) libvirt.so.0(LIBVIRT_3.0.0)(64bit) libvirt.so.0(LIBVIRT_3.1.0)(64bit) libvirt.so.0(LIBVIRT_3.4.0)(64bit) libvirt.so.0(LIBVIRT_3.7.0)(64bit) libvirt.so.0(LIBVIRT_3.9.0)(64bit) libvirt.so.0(LIBVIRT_4.1.0)(64bit) rtld(GNU_HASH)
> Processing files: perl-Sys-Virt-debugsource-4.4.0-1.fc28.x86_64
> error: Empty %files file /home/test/libvirt-perl/rpmbuild/BUILD/Sys-Virt-v4.4.0/debugsourcefiles.list
> 
> 
> RPM build errors:
>     Empty %files file /home/test/libvirt-perl/rpmbuild/BUILD/Sys-Virt-v4.4.0/debugsourcefiles.list
> 


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [perl PATCH] Switch over to using Module::Build
Posted by Andrea Bolognani 5 years, 11 months ago
On Tue, 2018-05-15 at 20:47 +0100, Daniel P. Berrangé wrote:
> On Tue, May 15, 2018 at 08:17:09PM +0200, Andrea Bolognani wrote:
> > + /usr/bin/perl Build.PL installdirs=vendor
> > Created MYMETA.yml and MYMETA.json
> > Creating new 'Build' script for 'Sys-Virt' version 'v4.4.0'
> > + ./Build
> > Building Sys-Virt
> > ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Sys/Virt/Virt.bs')
> > gcc -lpthread -shared -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -fstack-protector-strong -lperl -o blib/arch/auto/Sys/Virt/Virt.so lib/Sys/Virt.o -L/home/test/build/lib
> > virt/lib -lvirt
> 
> This is suspect - on mine it is much longer - in particular it has
> the -g flag for creating debuginfo packages
> 
> 
> + /usr/bin/perl Build.PL installdirs=vendor
> Created MYMETA.yml and MYMETA.json
> Creating new 'Build' script for 'Sys-Virt' version 'v4.4.0'
> + ./Build
> Building Sys-Virt
> gcc -I/usr/lib64/perl5/CORE -DVERSION="v4.4.0" -DXS_VERSION="v4.4.0" -fPIC -I/home/berrange/src/virt/libvirt/include -c -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -o lib/Sys/Virt.o lib/Sys/Virt.c
> ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Sys/Virt/Virt.bs')
> gcc -lpthread -shared -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -fstack-protector-strong -lperl -o blib/arch/auto/Sys/Virt/Virt.so lib/Sys/Virt.o -L/home/berrange/src/virt/libvirt/src/.libs -lvirt

Okay, I think I'm getting closer to understanding the problem

The CI build steps for Module::Build packages, with irrelevant
details omitted, look like

  perl Build.PL install_base=...
  perl Build
  perl Build manifest
  perl Build install
  perl Build test
  perl Build dist
  rpmbuild -ta *.tar.gz

These are the steps I'm following. The prepare-release.sh script,
however, is slightly different:

  perl Build.PL install_base=..
  ./Build
  ./Build test
  ./Build install
  ./Build dist
  rpmbuild -ta *.tar.gz

The critical difference is that CI calls 'perl Build manifest',
while prepare-release.sh doesn't. If I remove that line from the
CI steps, the build suddenly succeeds on Fedora.

This is how the manifest is changed by the call, with both the
initial file and the updated one filtered through 'sort -u' to
remove the noise caused by some items changing position:

  --- MANIFEST.old        2018-05-16 08:35:17.568120131 +0000
  +++ MANIFEST.new        2018-05-16 08:35:12.246110781 +0000
  @@ -31,10 +31,10 @@
   examples/vol-upload-all.pl
   examples/vol-upload-nonblock.pl
   examples/vol-upload.pl
  -.gitignore
   .gitpublish
   HACKING
   INSTALL
  +lib/Sys/Virt.c
   lib/Sys/Virt/Domain.pm
   lib/Sys/Virt/DomainSnapshot.pm
   lib/Sys/Virt/Error.pm
  @@ -43,6 +43,7 @@
   lib/Sys/Virt/Network.pm
   lib/Sys/Virt/NodeDevice.pm
   lib/Sys/Virt/NWFilter.pm
  +lib/Sys/Virt.o
   lib/Sys/Virt.pm
   lib/Sys/Virt/Secret.pm
   lib/Sys/Virt/StoragePool.pm
  @@ -51,6 +52,7 @@
   lib/Sys/Virt.xs
   LICENSE
   Makefile.PL
  +MANIFEST
   META.json
   META.yml
   perl-Sys-Virt.spec

Interestingly, CentOS 7 is perfectly fine with the updated manifest;
only Fedora is bothered by it.

Another interesting fact is that libvirt-tck doesn't track its
manifest in git, and generates it a build time by calling the same
command as above. I'm not sure if that would be appropriate, but
perhaps a good solution would be to start tracking the manifest in
git for libvirt-tck too and stop calling 'perl Build manifest' as
part of the build procedure altogether.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [perl PATCH] Switch over to using Module::Build
Posted by Daniel P. Berrangé 5 years, 11 months ago
On Wed, May 16, 2018 at 10:49:39AM +0200, Andrea Bolognani wrote:
> On Tue, 2018-05-15 at 20:47 +0100, Daniel P. Berrangé wrote:
> > On Tue, May 15, 2018 at 08:17:09PM +0200, Andrea Bolognani wrote:
> > > + /usr/bin/perl Build.PL installdirs=vendor
> > > Created MYMETA.yml and MYMETA.json
> > > Creating new 'Build' script for 'Sys-Virt' version 'v4.4.0'
> > > + ./Build
> > > Building Sys-Virt
> > > ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Sys/Virt/Virt.bs')
> > > gcc -lpthread -shared -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -fstack-protector-strong -lperl -o blib/arch/auto/Sys/Virt/Virt.so lib/Sys/Virt.o -L/home/test/build/lib
> > > virt/lib -lvirt
> > 
> > This is suspect - on mine it is much longer - in particular it has
> > the -g flag for creating debuginfo packages
> > 
> > 
> > + /usr/bin/perl Build.PL installdirs=vendor
> > Created MYMETA.yml and MYMETA.json
> > Creating new 'Build' script for 'Sys-Virt' version 'v4.4.0'
> > + ./Build
> > Building Sys-Virt
> > gcc -I/usr/lib64/perl5/CORE -DVERSION="v4.4.0" -DXS_VERSION="v4.4.0" -fPIC -I/home/berrange/src/virt/libvirt/include -c -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -o lib/Sys/Virt.o lib/Sys/Virt.c
> > ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Sys/Virt/Virt.bs')
> > gcc -lpthread -shared -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -fstack-protector-strong -lperl -o blib/arch/auto/Sys/Virt/Virt.so lib/Sys/Virt.o -L/home/berrange/src/virt/libvirt/src/.libs -lvirt
> 
> Okay, I think I'm getting closer to understanding the problem
> 
> The CI build steps for Module::Build packages, with irrelevant
> details omitted, look like
> 
>   perl Build.PL install_base=...
>   perl Build
>   perl Build manifest
>   perl Build install
>   perl Build test
>   perl Build dist
>   rpmbuild -ta *.tar.gz
> 
> These are the steps I'm following. The prepare-release.sh script,
> however, is slightly different:
> 
>   perl Build.PL install_base=..
>   ./Build
>   ./Build test
>   ./Build install
>   ./Build dist
>   rpmbuild -ta *.tar.gz
> 
> The critical difference is that CI calls 'perl Build manifest',
> while prepare-release.sh doesn't. If I remove that line from the
> CI steps, the build suddenly succeeds on Fedora.
> 
> This is how the manifest is changed by the call, with both the
> initial file and the updated one filtered through 'sort -u' to
> remove the noise caused by some items changing position:
> 
>   --- MANIFEST.old        2018-05-16 08:35:17.568120131 +0000
>   +++ MANIFEST.new        2018-05-16 08:35:12.246110781 +0000
>   @@ -31,10 +31,10 @@
>    examples/vol-upload-all.pl
>    examples/vol-upload-nonblock.pl
>    examples/vol-upload.pl
>   -.gitignore
>    .gitpublish
>    HACKING
>    INSTALL
>   +lib/Sys/Virt.c
>    lib/Sys/Virt/Domain.pm
>    lib/Sys/Virt/DomainSnapshot.pm
>    lib/Sys/Virt/Error.pm
>   @@ -43,6 +43,7 @@
>    lib/Sys/Virt/Network.pm
>    lib/Sys/Virt/NodeDevice.pm
>    lib/Sys/Virt/NWFilter.pm
>   +lib/Sys/Virt.o

Ah ha, this will be what's causing the problem - it'll make RPM build
skip the compile step and just do the link step. So if we drop the
manifest build, the RPM build should work.

>    lib/Sys/Virt.pm
>    lib/Sys/Virt/Secret.pm
>    lib/Sys/Virt/StoragePool.pm
>   @@ -51,6 +52,7 @@
>    lib/Sys/Virt.xs
>    LICENSE
>    Makefile.PL
>   +MANIFEST
>    META.json
>    META.yml
>    perl-Sys-Virt.spec
> 
> Interestingly, CentOS 7 is perfectly fine with the updated manifest;
> only Fedora is bothered by it.
> 
> Another interesting fact is that libvirt-tck doesn't track its
> manifest in git, and generates it a build time by calling the same
> command as above. I'm not sure if that would be appropriate, but
> perhaps a good solution would be to start tracking the manifest in
> git for libvirt-tck too and stop calling 'perl Build manifest' as
> part of the build procedure altogether.

Yeah, we should commit the manifest to git - I've found there is just
too much chance of including random junk when using MANIFEST.SKIP, so
I just pre-created the MANIFEST. I'll send a patch for libvirt-tck to
do this.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list