From 4ad67d64b56c9a84eed118efd5d49f253bd2b0b3 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 8 Feb 2018 13:18:58 +0100 Subject: [PATCH 1/3] Fix rebuildpacs for armv6/armv7 architectures For some architectures, the rpm architecture and the Open Build Service Scheduler architecture is not identical. This is partially unavoidable as they are defined differently (OBS uses the kernel arch, and the rpm architecture might contain extra ABI information that is only relevant for user space). Accomodate by special casing the currently known two exceptions. --- rebuildpacs.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rebuildpacs.pl b/rebuildpacs.pl index 8c4947c9..cffd6c29 100755 --- a/rebuildpacs.pl +++ b/rebuildpacs.pl @@ -244,11 +244,15 @@ foreach my $package (@rpms) { close(PACKAGES); # read the problems out of installcheck -open( INSTALLCHECK, "installcheck $arch $pfile|" ); +my $rpmarch = $arch; +$rpmarch = "armv7hl" if ($arch eq "armv7l"); +$rpmarch = "armv6hl" if ($arch eq "armv6l"); + +open( INSTALLCHECK, "/usr/bin/installcheck $rpmarch $pfile|" ); while () { chomp; - if (m/^can't install (.*)\-[^-]*\-[^-]*\.($arch|noarch):/) { + if (m/^can't install (.*)\-[^-]*\-[^-]*\.($rpmarch|noarch):/) { $cproblem = $1; $cproblem =~ s/kmp-([^-]*)/kmp-default/; $cproblem = find_source_container($cproblem); @@ -265,7 +269,7 @@ while () { # very thin ice here s,\(\)\(64bit\),,; - s,(needed by [^ ]*)\-[^-]*\-[^-]*\.($arch|noarch)$,$1,; + s,(needed by [^ ]*)\-[^-]*\-[^-]*\.($rpmarch|noarch)$,$1,; s,^\s*,,; # patterns are too spammy and rebuilding doesn't help From d1598222d890efc46f9554b5e2c224c09dddb81f Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 8 Feb 2018 13:21:07 +0100 Subject: [PATCH 2/3] Avoid hitting the request limit In certain cases the rebuild url is longer than what the API server is going to handle as maximum url length. just stop adding stuff to rebuild in that case, hopefully it will reduce over repeated runs. --- rebuildpacs.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rebuildpacs.pl b/rebuildpacs.pl index cffd6c29..1b7126f0 100755 --- a/rebuildpacs.pl +++ b/rebuildpacs.pl @@ -161,6 +161,7 @@ if (%torebuild) { my $api = "/build/$project?cmd=rebuild&repository=$repo&arch=$arch"; for my $package (sort keys %torebuild) { next if (defined $ignored{$package}); + last if (length($api) > 32767); $api .= "&package=" . uri_escape( $package ); } system("osc api -X POST '$api'"); @@ -207,7 +208,7 @@ sub get_paths($$$) { open(OSC, "osc api /build/$project/$repo/$arch/$package/_buildinfo|"); my $xml = join('', ); if ($xml !~ m/^ 1); close(OSC); @@ -320,6 +321,7 @@ my $rebuildit = 0; $api = "/build/$project?cmd=rebuild&repository=$repo&arch=$arch"; for my $package (@packages) { $package = $package->{package}; + last if (length($api) > 32767); if (!$problems{$package}) { # it can go @@ -329,8 +331,8 @@ for my $package (@packages) { my $oproblem = $oproblems{$package} || ''; if ($problems{$package} eq $oproblem) { - # rebuild won't help - next; + # rebuild won't help + next; } $rebuildit = 1; print "rebuild ", $package, ": ", From d540bfa81b5c5119fdd6d7bd688a8a330fd02eb8 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 8 Feb 2018 13:22:09 +0100 Subject: [PATCH 3/3] Skip automatic rebuild for more pattern packages --- rebuildpacs.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rebuildpacs.pl b/rebuildpacs.pl index 1b7126f0..17528af3 100755 --- a/rebuildpacs.pl +++ b/rebuildpacs.pl @@ -274,7 +274,14 @@ while () { s,^\s*,,; # patterns are too spammy and rebuilding doesn't help - next if (grep { $_ eq $cproblem } qw(patterns-openSUSE installation-images:Kubic fftw3:gnu-openmpi-hpc hdf5:mvapich2 hdf5:openmpi hdf5:serial scalapack:gnu-mvapich2-hpc scalapack:gnu-openmpi-hpc python-numpy:gnu-hpc petsc:serial netcdf:serial netcdf:openmpi netcdf:gnu-hpc netcdf:gnu-openmpi-hpc netcdf:gnu-mvapich2-hpc)); + next if (grep { $_ eq $cproblem } qw( + patterns-openSUSE patterns-base patterns-haskell + patterns-mate patterns-media patterns-yast + installation-images:Kubic fftw3:gnu-openmpi-hpc hdf5:mvapich2 + hdf5:openmpi hdf5:serial scalapack:gnu-mvapich2-hpc + scalapack:gnu-openmpi-hpc python-numpy:gnu-hpc + petsc:serial netcdf:serial netcdf:openmpi netcdf:gnu-hpc + netcdf:gnu-openmpi-hpc netcdf:gnu-mvapich2-hpc)); $problems{$cproblem}->{$_} = 1; }