Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package build for openSUSE:Factory checked in at 2023-11-05 12:18:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/build (Old) and /work/SRC/openSUSE:Factory/.build.new.17445 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "build" Sun Nov 5 12:18:37 2023 rev:156 rq:1123146 version:20231027 Changes: -------- --- /work/SRC/openSUSE:Factory/build/build.changes 2023-08-10 15:33:11.251896993 +0200 +++ /work/SRC/openSUSE:Factory/.build.new.17445/build.changes 2023-11-05 12:18:46.809106798 +0100 @@ -1,0 +2,19 @@ +Fri Oct 27 08:29:31 UTC 2023 - Adrian Schröter <adr...@suse.de> + +- Docker: + - Support flavor specific build descriptions via Dockerfile.$flavor + - support "PlusRecommended" hint to also provide recommended packages + - use the name/version as filename if both are known + - Produce docker format containers by default +- pbuild: Support for signature authentification of OBS resources +- Fix wiping build root for --vm-type podman +- Put BUILD_RELEASE and BUILD_CHANGELOG_TIMESTAMP in the /.buildenv +- build-vm-kvm: use -cpu host on riscv64 +- small fixes and cleanups + +------------------------------------------------------------------- +Fri Aug 11 06:25:38 UTC 2023 - Adrian Schröter <adr...@suse.de> + +- Added parser for BcntSyncTag in sources + +------------------------------------------------------------------- Old: ---- obs-build-20230808.tar.gz New: ---- obs-build-20231027.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ build.spec ++++++ --- /var/tmp/diff_new_pack.8ai1S4/_old 2023-11-05 12:18:47.585135265 +0100 +++ /var/tmp/diff_new_pack.8ai1S4/_new 2023-11-05 12:18:47.585135265 +0100 @@ -28,7 +28,7 @@ Summary: A Script to Build SUSE Linux RPMs License: GPL-2.0-only OR GPL-3.0-only Group: Development/Tools/Building -Version: 20230808 +Version: 20231027 Release: 0 Source: obs-build-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.8ai1S4/_old 2023-11-05 12:18:47.617136439 +0100 +++ /var/tmp/diff_new_pack.8ai1S4/_new 2023-11-05 12:18:47.621136586 +0100 @@ -1,5 +1,5 @@ pkgname=build -pkgver=20230808 +pkgver=20231027 pkgrel=0 pkgdesc="Build packages in sandbox" arch=('i686' 'x86_64') ++++++ _service ++++++ --- /var/tmp/diff_new_pack.8ai1S4/_old 2023-11-05 12:18:47.637137173 +0100 +++ /var/tmp/diff_new_pack.8ai1S4/_new 2023-11-05 12:18:47.641137320 +0100 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="manual"> - <param name="revision">20230808</param> - <param name="version">20230808</param> + <param name="revision">20231027</param> + <param name="version">20231027</param> <param name="url">https://github.com/openSUSE/obs-build.git</param> <param name="scm">git</param> <param name="extract">dist/build.changes</param> ++++++ build.dsc ++++++ --- /var/tmp/diff_new_pack.8ai1S4/_old 2023-11-05 12:18:47.657137907 +0100 +++ /var/tmp/diff_new_pack.8ai1S4/_new 2023-11-05 12:18:47.661138053 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: build -Version: 20230808 +Version: 20231027 Binary: build Maintainer: Adrian Schroeter <adr...@suse.de> Architecture: all ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.8ai1S4/_old 2023-11-05 12:18:47.681138787 +0100 +++ /var/tmp/diff_new_pack.8ai1S4/_new 2023-11-05 12:18:47.685138934 +0100 @@ -1,4 +1,4 @@ -build (20230808) unstable; urgency=low +build (20231027) unstable; urgency=low * Update to current git trunk - add sles11sp2 build config and adapt autodetection ++++++ obs-build-20230808.tar.gz -> obs-build-20231027.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/Build/Docker.pm new/obs-build-20231027/Build/Docker.pm --- old/obs-build-20230808/Build/Docker.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/Build/Docker.pm 2023-10-27 10:34:38.000000000 +0200 @@ -205,6 +205,7 @@ my ($cf, $fn) = @_; my $unorderedrepos; + my $plusrecommended; my $useobsrepositories; my $nosquash; my $dockerfile_data; @@ -258,12 +259,18 @@ if ($line =~ /^#!BuildRelease:\s*(\S+)\s*$/) { $ret->{'release'} = $1; } + if ($line =~ /^#!BcntSyncTag:\s*(\S+)\s*$/) { + $ret->{'bcntsynctag'} = $1; + } if ($line =~ /^#!BuildConstraint:\s*(\S.+?)\s*$/) { push @{$ret->{'buildconstraint'}}, $1; } if ($line =~ /^#!UnorderedRepos\s*$/) { $unorderedrepos = 1; } + if ($line =~ /^#!PlusRecommended\s*$/) { + $plusrecommended = 1; + } if ($line =~ /^#!UseOBSRepositories\s*$/) { $useobsrepositories = 1; } @@ -387,6 +394,7 @@ } } } + push @{$ret->{'deps'}}, '--dorecommends--', '--dosupplements--' if $plusrecommended; push @{$ret->{'deps'}}, '--unorderedimagerepos' if $unorderedrepos; my $version = $ret->{'version'}; my $release = $ret->{'release'}; @@ -476,9 +484,11 @@ local $Build::Kiwi::urlmapper = sub { return $_[0] }; my $cf = {}; $cf->{'buildrelease'} = $release if defined $release; + $cf->{'__dockernoname'} = 1 if $field && $field eq 'filename'; my $d = {}; $d = parse($cf, $fn) if $fn; die("$d->{'error'}\n") if $d->{'error'}; + $d->{'filename'} = "$d->{'name'}-$d->{'version'}" if !$d->{'filename'} && $d->{'name'} && $d->{'version'}; my $x = $d->{$field}; $x = [ $x ] unless ref $x; print "@$x\n"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/Build/Download.pm new/obs-build-20231027/Build/Download.pm --- old/obs-build-20230808/Build/Download.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/Build/Download.pm 2023-10-27 10:34:38.000000000 +0200 @@ -36,6 +36,7 @@ my $ssl_opts = $opt{'ssl_opts'} || { verify_hostname => 1 }; my $ua = LWP::UserAgent->new(agent => $agent, timeout => $timeout, ssl_opts => $ssl_opts); $ua->env_proxy; + $ua->cookie_jar($opt{'cookie_jar'}) if $opt{'cookie_jar'}; return $ua; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/Build/Kiwi.pm new/obs-build-20231027/Build/Kiwi.pm --- old/obs-build-20230808/Build/Kiwi.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/Build/Kiwi.pm 2023-10-27 10:34:38.000000000 +0200 @@ -72,6 +72,7 @@ $obsexclusivearch = $1 if $xml =~ /^\s*<!--\s+OBS-ExclusiveArch:\s+(.*)\s+-->\s*$/im; $obsexcludearch = $1 if $xml =~ /^\s*<!--\s+OBS-ExcludeArch:\s+(.*)\s+-->\s*$/im; $ret->{'milestone'} = $1 if $xml =~ /^\s*<!--\s+OBS-Milestone:\s+(.*)\s+-->\s*$/im; + $ret->{'bcntsynctag'} = $1 if $xml =~ /^\s*<!--\s+OBS-BcntSyncTag:\s+(.*)\s+-->\s*$/im; $ret->{'name'} = $kiwi->{'name'} if $kiwi->{'name'}; $ret->{'filename'} = $kiwi->{'name'} if $kiwi->{'name'}; @@ -245,6 +246,7 @@ $obsexcludearch = $1 if $xml =~ /^\s*<!--\s+OBS-ExcludeArch:\s+(.*)\s+-->\s*$/im; $obsprofiles = $1 if $xml =~ /^\s*<!--\s+OBS-Profiles:\s+(.*)\s+-->\s*$/im; $ret->{'milestone'} = $1 if $xml =~ /^\s*<!--\s+OBS-Milestone:\s+(.*)\s+-->\s*$/im; + $ret->{'bcntsynctag'} = $1 if $xml =~ /^\s*<!--\s+OBS-BcntSyncTag:\s+(.*)\s+-->\s*$/im; if ($obsprofiles) { $obsprofiles = [ grep {defined($_)} map {$_ eq '@BUILD_FLAVOR@' ? $buildflavor : $_} split(' ', $obsprofiles) ]; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/Build/Rpm.pm new/obs-build-20231027/Build/Rpm.pm --- old/obs-build-20230808/Build/Rpm.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/Build/Rpm.pm 2023-10-27 10:34:38.000000000 +0200 @@ -819,9 +819,12 @@ delete $ret->{'buildtarget'}; $ret->{'buildtarget'} = $bt if $bt; } - if ($preamble && $line =~ /^\#\!BuildConstraint:\s*(\S.+?)\s*$/i) { + if ($preamble && $line =~ /^\#\!BuildConstraint:\s*(\S.*?)\s*$/i) { push @{$ret->{'buildconstraint'}}, $1; } + if ($preamble && $line =~ /^\#\!BcntSyncTag:\s*(\S.*?)\s*$/i) { + $ret->{'bcntsynctag'} = $1; + } if ($line =~ /^(?:Requires\(pre\)|Requires\(post\)|PreReq)\s*:\s*(\S.*)$/i) { my $deps = $1; my @deps; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/Build.pm new/obs-build-20231027/Build.pm --- old/obs-build-20230808/Build.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/Build.pm 2023-10-27 10:34:38.000000000 +0200 @@ -730,7 +730,7 @@ } else { push @deps, @{$config->{'substitute'}->{"build-packages:$buildtype"} || $subst_defaults{"build-packages:$buildtype"} || []}; } - if ($buildtype eq 'docker' || $buildtype eq 'kiwi') { + if ($buildtype eq 'docker' || $buildtype eq 'kiwi') { $nobasepackages = 1 if $config->{"expandflags:$buildtype-nobasepackages"}; @deps = grep {!/^kiwi-image:/} @deps if $buildtype eq 'kiwi'; # only needed for sysdeps @deps = grep {!/^kiwi-packagemanager:/} @deps if $buildtype eq 'kiwi' && $nobasepackages; # only needed for sysdeps @@ -1265,7 +1265,7 @@ return 'collax' if $recipe eq 'build.collax'; return 'snapcraft' if $recipe eq 'snapcraft.yaml'; return 'appimage' if $recipe eq 'appimage.yml'; - return 'docker' if $recipe eq 'Dockerfile'; + return 'docker' if $recipe eq 'Dockerfile' || $recipe =~ /^Dockerfile\..*/; return 'fissile' if $recipe eq 'fissile.yml'; return 'preinstallimage' if $recipe eq '_preinstallimage'; return 'simpleimage' if $recipe eq 'simpleimage'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/PBuild/Checker.pm new/obs-build-20231027/PBuild/Checker.pm --- old/obs-build-20230808/PBuild/Checker.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/PBuild/Checker.pm 2023-10-27 10:34:38.000000000 +0200 @@ -115,7 +115,7 @@ sub cycsort { my ($pkg2dep, $dep2src, $pkg2src, @cyc) = @_; - @cyc = sort(@cyc); + @cyc = PBuild::Util::unify(sort(@cyc)); my %d; my %cdeps; for my $pkg (@cyc) { @@ -199,8 +199,7 @@ my $incycle = 0; if ($cychash->{$packid}) { ($packid, $incycle) = handlecycle($ctx, $packid, \@cpacks, \%cycpass); - next if $incycle == 4; # ignore after pass1/2 - next if $packstatus{$packid} && $packstatus{$packid} ne 'done' && $packstatus{$packid} ne 'succeeded' && $packstatus{$packid} ne 'failed'; # already decided + next if !$packid || ($packstatus{$packid} && $packstatus{$packid} ne 'done' && $packstatus{$packid} ne 'succeeded' && $packstatus{$packid} ne 'failed'); # already decided } my $p = $pkgsrc->{$packid}; if ($p->{'error'}) { @@ -405,12 +404,6 @@ # calculate if we're blocked my @blocked = grep {$notready->{$dep2src->{$_}}} @$edeps; @blocked = () if $ctx->{'block'} && $ctx->{'block'} eq 'never'; - # check if cycle builds are in progress - if ($incycle && $incycle == 3) { - push @blocked, 'cycle' unless @blocked; - splice(@blocked, 10, scalar(@blocked), '...') if @blocked > 10; - return ('blocked', join(', ', @blocked)); - } # prune cycle packages from blocked if ($incycle > 1) { my $cyclevel = $ctx->{'cyclevel'}; @@ -431,7 +424,7 @@ my $hdeps; if ($ctx->{'bconf_host'} && !$p->{'native'}) { my $subpacks = $ctx->{'subpacks'}; - $hdeps = [ @{$p->{'dep_host'} || $p->{'dep'} || []}, @{$p->{'dep_native'} || []} ]; + $hdeps = [ @{$p->{'dep_host'} || $p->{'dep'} || []}, @{$p->{'dep_extractnative'} || []} ]; @$hdeps = Build::get_deps($ctx->{'bconf_host'}, $subpacks->{$p->{'name'}}, @$hdeps); if (!shift @$hdeps) { return ('unresolvable', 'host: '.join(', ', @$hdeps)); @@ -559,7 +552,7 @@ my ($ctx, $packid, $cpacks, $cycpass) = @_; my $cychash = $ctx->{'cychash'}; return ($packid, 0) unless $cychash->{$packid}; - my $incycle = $cycpass->{$packid}; + my $incycle = $cycpass->{$packid} || 0; return ($packid, $incycle) if $incycle > 0; # still in pass my @cycp = @{$cychash->{$packid}}; $incycle = -$incycle + 1; # start next pass @@ -575,8 +568,12 @@ $packid = shift @$cpacks; $cycpass->{$packid} = -2; # set pass2 endmarker } elsif ($incycle == 3) { - unshift @$cpacks, @cycp; - $packid = shift @$cpacks; + my $notready = $ctx->{'notready'}; + my $pkgsrc = $ctx->{'pkgsrc'}; + if (grep {$notready->{$_->{'name'} || $_->{'pkg'}}} map {$pkgsrc->{$_}} @cycp) { + $notready->{$_->{'name'} || $_->{'pkg'}} ||= 1 for @cycp; + } + return (undef, 3); } return ($packid, $incycle); } @@ -654,7 +651,7 @@ my $genbuildreqs = $p->{'genbuildreqs'}; my @bdeps = grep {!/^\// || $bconf->{'fileprovides'}->{$_}} @{$p->{'prereq'} || []}; unshift @bdeps, '--directdepsend--' if @bdeps; - unshift @bdeps, @{$p->{'dep_native'} || []}; + unshift @bdeps, @{$p->{'dep_extractnative'} || []}; unshift @bdeps, @{$genbuildreqs->[1]} if $genbuildreqs; if (!$kiwimode && $bconf_host) { unshift @bdeps, @{$p->{'dep_host'} || $p->{'dep'} || []}, @btdeps; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/PBuild/Expand.pm new/obs-build-20231027/PBuild/Expand.pm --- old/obs-build-20230808/PBuild/Expand.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/PBuild/Expand.pm 2023-10-27 10:34:38.000000000 +0200 @@ -124,7 +124,7 @@ if ($cross) { my @native; @edeps = Build::get_sysroot($bconf, $subpacks->{$p->{'name'}}, '--extractnative--', \@native, @deps); - $p->{'dep_native'} = \@native; + $p->{'dep_extractnative'} = \@native; } else { @edeps = Build::get_deps($bconf, $subpacks->{$p->{'name'}}, @deps); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/PBuild/Job.pm new/obs-build-20231027/PBuild/Job.pm --- old/obs-build-20230808/PBuild/Job.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/PBuild/Job.pm 2023-10-27 10:34:38.000000000 +0200 @@ -127,7 +127,7 @@ } @d = ('ARCHPKGS') if $p->{'recipe'} =~ /PKGBUILD$/; @d = ('KIWI') if $p->{'recipe'} =~ /\.kiwi$/; - @d = ('DOCKER') if $p->{'recipe'} =~ /Dockerfile$/; + @d = ('DOCKER') if $p->{'recipe'} =~ /Dockerfile(\.|$)/; @d = ('FISSILE') if $p->{'recipe'} =~ /fissile\.yml$/; @d = ('HELM') if $p->{'recipe'} =~ /Chart\.yaml$/; push @d, 'OTHER'; @@ -311,7 +311,7 @@ push @args, '--shell-after-fail' if $opts->{'shell-after-fail'}; push @args, '--no-timestamps' if $opts->{'no-timestamps'}; push @args, '--skip-bundle'; - push @args, '--changelog'; + push @args, '--changelog' unless $opts->{'nochangelog'}; #push @args, '--oldpackages', $oldresultdir if -d $oldresultdir; push @args, '--ccache' if $jobopts->{'ccache'}; push @args, '--ccache-create-archive' if $jobopts->{'ccache'}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/PBuild/Meta.pm new/obs-build-20231027/PBuild/Meta.pm --- old/obs-build-20230808/PBuild/Meta.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/PBuild/Meta.pm 2023-10-27 10:34:38.000000000 +0200 @@ -164,30 +164,37 @@ # return the depth where the two metas differ # 0: same metas # 1: first line (i.e. different source) -# >=2: number of '/' + 1 +# >=2: number of '/' + 2 sub diffdepth { my ($m1, $m2) = @_; my $i = -1; - for (@$m1) { - $i++; - my $m = $m2->[$i]; - if (!defined($m)) { - return 1 unless $i; - my $i1 = $_ =~ y!/!/!; - return $i1 + 2; - } elsif ($m ne $_) { - return 1 unless $i; - my $i1 = $_ =~ y!/!/!; - my $i2 = $m =~ y!/!/!; - return $i1 < $i2 ? $i1 + 2 : $i2 + 2; + if (@$m1 <= @$m2) { + for (@$m1) { + if ($_ ne $m2->[++$i]) { + return 1 unless $i; + my $i1 = $_ =~ y!/!/!; + my $i2 = $m2->[$i] =~ y!/!/!; + return $i1 < $i2 ? $i1 + 2 : $i2 + 2; + } + } + return 0 if ++$i == @$m2; + return 1 unless $i; + my $i2 = $m2->[$i] =~ y!/!/!; + return $i2 + 2; + } else { + for (@$m2) { + if ($_ ne $m1->[++$i]) { + return 1 unless $i; + my $i1 = $m1->[$i] =~ y!/!/!; + my $i2 = $_ =~ y!/!/!; + return $i1 < $i2 ? $i1 + 2 : $i2 + 2; + } } + $i++; + return 1 unless $i; + my $i1 = $m1->[$i] =~ y!/!/!; + return $i1 + 2; } - $i++; - my $m = $m2->[$i]; - return 0 unless defined $m; - return 1 unless $i; - my $i2 = $m =~ y!/!/!; - return $i2 + 2; } 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/PBuild/OBS.pm new/obs-build-20231027/PBuild/OBS.pm --- old/obs-build-20230808/PBuild/OBS.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/PBuild/OBS.pm 2023-10-27 10:34:38.000000000 +0200 @@ -27,6 +27,9 @@ use PBuild::Util; use PBuild::Cpio; use PBuild::Structured; +use PBuild::SigAuth; + +my $cookie_jar; my @binsufs = qw{rpm deb pkg.tar.gz pkg.tar.xz pkg.tar.zst}; my $binsufsre = join('|', map {"\Q$_\E"} @binsufs); @@ -77,12 +80,38 @@ ]; # +# set the cookie jar for the user agent +# +sub set_cookie_jar { + my ($ua) = @_; + if (!defined($cookie_jar)) { + eval { + require HTTP::Cookies; + $cookie_jar = HTTP::Cookies->new(); + }; + $cookie_jar = 0 unless $cookie_jar; + } + $ua->cookie_jar($cookie_jar) if $cookie_jar; +} + +# +# create a user agent if we not have it and set our cookie jar +# +sub create_ua { + my ($ua) = @_; + $ua ||= Build::Download::create_ua(); + set_cookie_jar($ua); + return $ua; +} + +# # get the project data from an OBS project # sub fetch_proj { my ($projid, $baseurl) = @_; my $projid2 = PBuild::Util::urlencode($projid); - my ($projxml) = Build::Download::fetch("${baseurl}source/$projid2/_meta"); + my $ua = create_ua(); + my ($projxml) = Build::Download::fetch("${baseurl}source/$projid2/_meta", 'ua' => $ua); return PBuild::Structured::fromxml($projxml, $dtd_proj, 0, 1); } @@ -93,7 +122,8 @@ my ($prp, $baseurl) = @_; my ($projid, $repoid) = split('/', $prp, 2); my $projid2 = PBuild::Util::urlencode($projid); - my ($config) = Build::Download::fetch("${baseurl}source/$projid2/_config", 'missingok' => 1); + my $ua = create_ua(); + my ($config) = Build::Download::fetch("${baseurl}source/$projid2/_config", 'ua' => $ua, 'missingok' => 1); $config = '' unless defined $config; $config = "\n### from $projid\n%define _repository $repoid\n$config" if $config; return $config; @@ -267,11 +297,11 @@ my ($url, $repodir, $names, $callback, $ua) = @_; my @names = sort keys %$names; while (@names) { - $ua ||= Build::Download::create_ua(); my @nchunk = splice(@names, 0, 100); my $chunkurl = "$url/_repository?view=cpio"; $chunkurl .= "&binary=".PBuild::Util::urlencode($_) for @nchunk; my $tmpcpio = "$repodir/.$$.binaries.cpio"; + $ua = create_ua($ua); Build::Download::download($chunkurl, $tmpcpio, undef, 'ua' => $ua, 'retry' => 3); PBuild::Cpio::cpio_extract($tmpcpio, sub {fetch_binaries_cpioextract($_[0], $_[1], $repodir, $names, $callback)}); unlink($tmpcpio); @@ -291,11 +321,20 @@ $baseurl .= '/' unless $baseurl =~ /\/$/; my $requrl .= "${baseurl}build/$prp/$arch/_repository?view=cache"; $requrl .= "&module=".PBuild::Util::urlencode($_) for @{$modules || []}; - Build::Download::download($requrl, "$tmpdir/repository.cpio", undef, 'retry' => 3); + my $ua = create_ua(); + Build::Download::download($requrl, "$tmpdir/repository.cpio", undef, 'ua' => $ua, 'retry' => 3); unlink("$tmpdir/repository.data"); PBuild::Cpio::cpio_extract("$tmpdir/repository.cpio", "$tmpdir/repository.data", 'extract' => 'repositorycache', 'missingok' => 1); my $rdata; - $rdata = PBuild::Util::retrieve("$tmpdir/repository.data") if -s "$tmpdir/repository.data"; + if (-s "$tmpdir/repository.data") { + if (defined $Storable::flags) { + # we do not want to trust the data from the remote OBS server + local $Storable::flags = 0; + $rdata = PBuild::Util::retrieve("$tmpdir/repository.data"); + } else { + $rdata = PBuild::Util::retrieve("$tmpdir/repository.data"); + } + } my @bins = grep {ref($_) eq 'HASH' && defined($_->{'name'})} values %{$rdata || {}}; for (@bins) { if ($_->{'path'} =~ /^\.\.\/([^\/\.][^\/]*\/[^\/\.][^\/]*)$/s) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/PBuild/Options.pm new/obs-build-20231027/PBuild/Options.pm --- old/obs-build-20230808/PBuild/Options.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/PBuild/Options.pm 2023-10-27 10:34:38.000000000 +0200 @@ -125,6 +125,8 @@ 'extra-packs' => '::', 'extrapacks' => 'extra-packs::', 'X' => 'extra-packs::', + 'nochangelog' => '', + 'no-nochangelog' => 'nochangelog', }; sub debugflags_special { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/PBuild/Recipe.pm new/obs-build-20231027/PBuild/Recipe.pm --- old/obs-build-20230808/PBuild/Recipe.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/PBuild/Recipe.pm 2023-10-27 10:34:38.000000000 +0200 @@ -45,6 +45,7 @@ return $files{'PKGBUILD'} ? $files{'PKGBUILD'} : undef if $type eq 'arch'; my $pkg = $p->{'pkg'}; $pkg = $p->{'flavor'} if $p->{'flavor'}; + return $files{"Dockerfile.$pkg"} if $type eq 'docker' && $files{"Dockerfile.$pkg"}; return $files{"$pkg.$type"} if $files{"$pkg.$type"}; # try again without last components return $files{"$1.$type"} if $pkg =~ /^(.*?)\./ && $files{"$1.$type"}; @@ -60,6 +61,7 @@ # as last resort ignore the type for image/container building if ($type ne 'docker') { return $files{'Dockerfile'} if $files{'Dockerfile'}; + return $files{"Dockerfile.$pkg"} if $files{"Dockerfile.$pkg"}; } if ($type ne 'kiwi') { @files = grep {/\.kiwi$/} keys %files; @@ -202,7 +204,7 @@ return 0 if grep {/^_build\./} @files; for my $file (@files) { return 1 if $file =~ /\.(?:spec|dsc|kiwi)$/; - return 1 if $file =~ /^mkosi\./; + return 1 if $file =~ /^(?:Dockerfile|mkosi)\./; return 1 if $file eq 'snapcraft.yaml' || $file eq 'appimage.yml'; return 1 if $file eq 'Dockerfile' || $file eq 'fissile.yml' || $file eq 'Chart.yml'; return 1 if $file eq 'PKGBUILD'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/PBuild/Repoquery.pm new/obs-build-20231027/PBuild/Repoquery.pm --- old/obs-build-20230808/PBuild/Repoquery.pm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/PBuild/Repoquery.pm 2023-10-27 10:34:38.000000000 +0200 @@ -235,7 +235,7 @@ } else { $excluded = ' '; } - print " $excluded $nevra\n"; + print " $excluded $nevra\n"; } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/PBuild/SigAuth.pm new/obs-build-20231027/PBuild/SigAuth.pm --- old/obs-build-20230808/PBuild/SigAuth.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-build-20231027/PBuild/SigAuth.pm 2023-10-27 10:34:38.000000000 +0200 @@ -0,0 +1,119 @@ +################################################################ +# +# Copyright (c) 2022 SUSE LLC +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or 3 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program (see the file COPYING); if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# +################################################################ + +package PBuild::SigAuth; + +use MIME::Base64 (); + +use strict; + +our $key_id; +our $key_file; + +sub dosshsign { + my ($signdata, $keyfile, $namespace) = @_; + die("no key file specified\n") unless $keyfile; + my $fh; + my $pid = open($fh, '-|'); + die("pipe open: $!\n") unless defined $pid; + if (!$pid) { + my $pid2 = open(STDIN, '-|'); + die("pipe open: $!\n") unless defined $pid2; + if (!$pid2) { + print STDOUT $signdata or die("write signdata: $!\n"); + exit 0; + } + exec('ssh-keygen', '-Y', 'sign', '-n', $namespace, '-f', $keyfile); + die("ssh-keygen: $!\n"); + } + my $out = ''; + 1 while sysread($fh, $out, 8192, length($out)); + die("Signature authentification: bad ssh signature format\n") unless $out =~ s/.*-----BEGIN SSH SIGNATURE-----\n//s; + die("Signature authentification: bad ssh signature format\n") unless $out =~ s/-----END SSH SIGNATURE-----.*//s; + my $sig = MIME::Base64::decode_base64($out); + die("Signature authentification: bad ssh signature\n") unless substr($sig, 0, 6) eq 'SSHSIG'; + return $sig; +} + +sub generate_authorization { + my ($auth_param, $keyid, $keyfile) = @_; + my $realm = $auth_param->{'realm'} || ''; + my $headers = $auth_param->{'headers'} || '(created)'; + my $created = time(); + my $tosign = ''; + for my $h (split(/ /, $headers)) { + if ($h eq '(created)') { + $tosign .= "(created): $created\n"; + } else { + die("Signature authentification: unsupported header element: $h\n"); + } + } + die("Signature authentification: no keyid specified\n") unless defined($keyid); + die("Signature authentification: nothing to sign?\n") unless $tosign; + chop $tosign; + my $algorithm = $auth_param->{'algorithm'} || 'ssh'; + die("Signature authentification: unsupported algorithm '$algorithm'\n") unless $algorithm eq 'ssh'; + my $sig = dosshsign($tosign, $keyfile, $realm); + $sig = MIME::Base64::encode_base64($sig, ''); + die("bad keyid '$keyid'\n") if $keyid =~ /\"/; + return "Signature keyId=\"$keyid\",algorithm=\"$algorithm\",headers=\"$headers\",created=$created,signature=\"$sig\""; +} + +sub get_key_data { + my ($uri) = @_; + my $keyid = $key_id; + my $keyfile = $key_file; + if (!defined($keyid)) { + # check if the host includes a user name + my $authority = $uri->authority; + if ($authority =~ s/^([^\@]*)\@//) { + $keyid = $1; + $keyid =~ s/:.*//; # ignore password + } + } + if (!defined($keyfile)) { + my $home = $ENV{'HOME'}; + if ($home && -d "$home/.ssh") { + for my $idfile (qw{id_ed25519 id_rsa}) { + next unless -s "$home/.ssh/$idfile"; + $keyfile = "$home/.ssh/$idfile"; + last; + } + } + } + return ($keyid, $keyfile); +} + +sub authenticate { + my ($class, $ua, $proxy, $auth_param, $response, $request, $arg, $size) = @_; + my $uri = $request->uri_canonical; + return $response unless $uri && !$proxy; + my ($keyid, $keyfile) = get_key_data($uri); + my $host_port = $uri->host_port; + my $auth = generate_authorization($auth_param, $keyid, $keyfile); + my $h = $ua->get_my_handler('request_prepare', 'm_host_port' => $host_port, sub { + $_[0]{callback} = sub { $_[0]->header('Authorization' => $auth) }; + }); + return $ua->request($request->clone, $arg, $size, $response); +} + +# install handler +no warnings; +*LWP::Authen::Signature::authenticate = \&authenticate; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/build new/obs-build-20231027/build --- old/obs-build-20230808/build 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/build 2023-10-27 10:34:38.000000000 +0200 @@ -933,19 +933,22 @@ fi } -wipe_build_environment() { - if test -n "$VM_TYPE" ; then - vm_img_wipe - else - echo "Wiping build root: '$BUILD_ROOT'" - +unmount_build_root() { # unmount all mounts still in the build root path - for m in $(cat /proc/mounts | grep "$BUILD_ROOT" | awk '{ print $2 }'); do + for m in $(cat /proc/mounts | grep " $BUILD_ROOT" | awk '{ print $2 }'); do if ! umount -n "$m" 2>/dev/null ; then echo "Failed to umount "$m", cannot wipe buildroot" exit 1 fi done +} + +wipe_build_environment() { + if test -n "$VM_TYPE" ; then + vm_img_wipe + else + echo "Wiping build root: '$BUILD_ROOT'" + unmount_build_root rm -rf "$BUILD_ROOT" fi } @@ -1628,15 +1631,21 @@ cleanup_and_exit fi + # + # create legacy .buildenv file + # + test -z "$INCARNATION" && INCARNATION=0 + echo "BUILD_INCARNATION=$INCARNATION" > $BUILD_ROOT/.buildenv + Q="'\''" + test -n "$DISTURL" && echo "BUILD_DISTURL='${DISTURL//"'"/$Q}'" >> $BUILD_ROOT/.buildenv + test -n "$RELEASE" && echo "BUILD_RELEASE='${RELEASE//"'"/$Q}'" >> $BUILD_ROOT/.buildenv + test -n "$BUILD_CHANGELOG_TIMESTAMP" && echo "BUILD_CHANGELOG_TIMESTAMP=$BUILD_CHANGELOG_TIMESTAMP" >> $BUILD_ROOT/.buildenv + + # + # install the build environment + # if test "$DO_INIT" = true ; then start_time=$SECONDS - # - # create legacy .buildenv file - # - test -z "$INCARNATION" && INCARNATION=0 - echo "BUILD_INCARNATION=$INCARNATION" > $BUILD_ROOT/.buildenv - Q="'\''" - test -n "$DISTURL" && echo "BUILD_DISTURL='${DISTURL//"'"/$Q}'" >> $BUILD_ROOT/.buildenv test "$BUILDTYPE" = preinstallimage && mkdir -p $BUILD_ROOT/.preinstall_image CREATE_BUILD_BINARIES= if recipe_needs_build_binaries "$RECIPEPATH" ; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/build-recipe new/obs-build-20231027/build-recipe --- old/obs-build-20230808/build-recipe 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/build-recipe 2023-10-27 10:34:38.000000000 +0200 @@ -29,6 +29,7 @@ RPM_BUILD_IN_PLACE= RPM_RECIPE_IN_SUBDIR= RPM_NOPREP= +BUILD_CHANGELOG_TIMESTAMP= VCSURL= for i in spec dsc kiwi arch collax preinstallimage simpleimage mock livebuild snapcraft debootstrap debbuild appimage docker podman fissile helm flatpak mkosi; do @@ -124,7 +125,7 @@ PKGBUILD) BUILDTYPE=arch ;; snapcraft.yaml) BUILDTYPE=snapcraft ;; appimage.yml) BUILDTYPE=appimage ;; - Dockerfile) BUILDTYPE=docker ;; + Dockerfile|Dockerfile.*) BUILDTYPE=docker ;; fissile.yml) BUILDTYPE=fissile ;; build.collax) BUILDTYPE=collax ;; _preinstallimage) BUILDTYPE=preinstallimage ;; @@ -139,7 +140,7 @@ mkosi.*) BUILDTYPE=mkosi ;; esac if test -z "$BUILDTYPE" ; then - cleanup_and_exit 1 "I don't know how to build $RECIPEFILE" + cleanup_and_exit 1 "I don't know how to build $RECIPEFILE" fi # we can't query right after vm startup, so we put the BUILDENGINE in the build.data if test -z "$RUNNING_IN_VM" ; then @@ -263,7 +264,7 @@ # generate a .build-changelog file from a .changes file recipe_create_changelog() { - rm -f $BUILD_ROOT/.build-changelog + rm -f $BUILD_ROOT/.build-changelog $BUILD_ROOT/.build-changelog-timestamp case $1 in *.dsc) CFFORMAT=debian ;; *) CFFORMAT=rpm ;; @@ -276,9 +277,14 @@ esac fi echo "running changelog2spec --target $CFFORMAT --file $1" - if ! $BUILD_DIR/changelog2spec --target $CFFORMAT --file "$1" > $BUILD_ROOT/.build-changelog ; then - rm -f $BUILD_ROOT/.build-changelog + if ! $BUILD_DIR/changelog2spec --target $CFFORMAT --timestampfile "$BUILD_ROOT/.build-changelog-timestamp" --file "$1" > $BUILD_ROOT/.build-changelog ; then + rm -f $BUILD_ROOT/.build-changelog $BUILD_ROOT/.build-changelog-timestamp fi + BUILD_CHANGELOG_TIMESTAMP= + if test -s "$BUILD_ROOT/.build-changelog-timestamp" ; then + read BUILD_CHANGELOG_TIMESTAMP < "$BUILD_ROOT/.build-changelog-timestamp" + fi + rm -f $BUILD_ROOT/.build-changelog-timestamp } recipe_needs_build_binaries() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/build-recipe-docker new/obs-build-20231027/build-recipe-docker --- old/obs-build-20230808/build-recipe-docker 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/build-recipe-docker 2023-10-27 10:34:38.000000000 +0200 @@ -250,7 +250,12 @@ if test "$BUILDENGINE" = podman; then test -n "$squashopt" && squashopt="--layers=false" - if ! $DOCKER_CMD build $squashopt -v "$TOPDIR/SOURCES/repos:$TOPDIR/SOURCES/repos" --network=host "${tagargs[@]}" "${buildargs[@]}" -f "$TOPDIR/SOURCES/$RECIPEFILE" $TOPDIR/SOURCES/ ; then + buildformat=$(queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" buildflags container-build-format) + formatopt="--format docker" + if test "$buildformat" = oci; then + formatopt="--format oci" + fi + if ! $DOCKER_CMD build $formatopt $squashopt -v "$TOPDIR/SOURCES/repos:$TOPDIR/SOURCES/repos" --network=host "${tagargs[@]}" "${buildargs[@]}" -f "$TOPDIR/SOURCES/$RECIPEFILE" $TOPDIR/SOURCES/ ; then cleanup_and_exit 1 "$DOCKER_TOOL build command failed" fi else @@ -269,9 +274,12 @@ # Check for OS setting GOOS=`$DOCKER_CMD image inspect "$FIRSTTAG" --format '{{ .Os }}'` - # Save the resulting image to a tarball. Use first tag for generating the file name. + # Save the resulting image to a tarball. Use first tag for generating the file name if name or version is unknown. mkdir -p $BUILD_ROOT$TOPDIR/DOCKER - FILENAME="$FIRSTTAG" + FILENAME=$(perl -I$BUILD_DIR -MBuild::Docker -e Build::Docker::show -- "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" filename) + if test -z "$FILENAME" ; then + FILENAME="$FIRSTTAG" + fi FILENAME="${FILENAME//[\/:]/-}" test -n "$GOOS" -a "$GOOS" != "linux" && FILENAME="${FILENAME}_$GOOS" FILENAME="$FILENAME.${BUILD_ARCH%%:*}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/build-vm new/obs-build-20231027/build-vm --- old/obs-build-20230808/build-vm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/build-vm 2023-10-27 10:34:38.000000000 +0200 @@ -1054,6 +1054,7 @@ echo "BUILD_RPM_BUILD_STAGE='$BUILD_RPM_BUILD_STAGE'" >> $BUILD_ROOT/.build/build.data echo "RPM_BUILD_IN_PLACE='$RPM_BUILD_IN_PLACE'" >> $BUILD_ROOT/.build/build.data echo "RPM_NOPREP='$RPM_NOPREP'" >> $BUILD_ROOT/.build/build.data + echo "BUILD_CHANGELOG_TIMESTAMP='$BUILD_CHANGELOG_TIMESTAMP'" >> $BUILD_ROOT/.build/build.data # fallback time for broken hosts rm -rf $BUILD_ROOT/.build/.date date '+@%s' > $BUILD_ROOT/.build/.date diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/build-vm-kvm new/obs-build-20231027/build-vm-kvm --- old/obs-build-20230808/build-vm-kvm 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/build-vm-kvm 2023-10-27 10:34:38.000000000 +0200 @@ -180,7 +180,6 @@ riscv64) kvm_bin="/usr/bin/qemu-system-riscv64" kvm_options="-M virt,accel=kvm" - kvm_cpu="-cpu rv64,sv48=on" vm_kernel=/boot/Image vm_initrd=/boot/initrd test -e /boot/kernel.obs.guest && vm_kernel=/boot/kernel.obs.guest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/build-vm-podman new/obs-build-20231027/build-vm-podman --- old/obs-build-20230808/build-vm-podman 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/build-vm-podman 2023-10-27 10:34:38.000000000 +0200 @@ -80,4 +80,11 @@ vm_wipe_podman() { local name="build_${RECIPEFILE}" podman rm "$name" >/dev/null 2>&1 || true + + echo "Wiping build root: '$BUILD_ROOT'" + unmount_build_root + # calling 'podman unshare' is required because podman creates the files with SubUIDs/SubGIDs + # that differ from user's UID/GID and removing them would normally end up with + # a permission error for any user that is not root + podman unshare rm -rf "$BUILD_ROOT" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/changelog2spec new/obs-build-20231027/changelog2spec --- old/obs-build-20230808/changelog2spec 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/changelog2spec 2023-10-27 10:34:38.000000000 +0200 @@ -44,6 +44,8 @@ my $printtype; my $input = ''; my $target = 'rpm'; +my $timestampfile; +my $first_timestamp; while (@ARGV) { if ($ARGV[0] eq '--selftest') { @@ -61,6 +63,11 @@ shift @ARGV; next; } + if ($ARGV[0] eq '--timestampfile') { + shift @ARGV; + $timestampfile = shift @ARGV; + next; + } if ($ARGV[0] eq '--fulltimestamps') { $fulltimestamps = 1; shift @ARGV; @@ -86,19 +93,18 @@ opendir(D, $dir) || die("$dir: $!\n"); my @changes = grep {/\.changes$/} readdir(D); closedir(D); - my $changesfile=map_changes($file, @changes); + my $changesfile = map_changes($file, @changes); exit(1) unless $changesfile; @ARGV = ("$dir/$changesfile"); } -sub map_changes -{ +sub map_changes { my ($file, @changes) = @_; @changes = sort {length($a) <=> length($b) || $a cmp $b} @changes; # support _service: prefixes, they need to be stripped $file =~ s/^_service:.*://; my %changes = map {/^((?:_service:.*:)?(.*?))$/ ? ($2, $1) : ($_, $_)} @changes; - @changes = keys %changes; + @changes = sort keys %changes; return undef unless @changes; # nothing to do @changes = sort {length($a) <=> length($b) || $a cmp $b} @changes; if (@changes > 1) { @@ -259,6 +265,7 @@ die("changes file not incremental: $dline\n") if $test; warn("changes file not incremental: $dline\n"); } + $first_timestamp = $t unless defined $first_timestamp; $lastt = $t; my @gm = gmtime($t); # silly rpm can't hande dates < 1997, so we fold everything to @@ -278,4 +285,12 @@ $changes =~ s/^\*/ */mg; print $changes; } + +if ($timestampfile) { + my $fd; + open($fd, '>', $timestampfile) || die("$timestampfile: $!\n"); + print $fd "$first_timestamp\n" if defined $first_timestamp; + close($fd) || die("$timestampfile: $!\n"); +} + exit(0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/dist/build.changes new/obs-build-20231027/dist/build.changes --- old/obs-build-20230808/dist/build.changes 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/dist/build.changes 2023-10-27 10:34:38.000000000 +0200 @@ -1,4 +1,23 @@ ------------------------------------------------------------------- +Fri Oct 27 08:29:31 UTC 2023 - Adrian Schröter <adr...@suse.de> + +- Docker: + - Support flavor specific build descriptions via Dockerfile.$flavor + - support "PlusRecommended" hint to also provide recommended packages + - use the name/version as filename if both are known + - Produce docker format containers by default +- pbuild: Support for signature authentification of OBS resources +- Fix wiping build root for --vm-type podman +- Put BUILD_RELEASE and BUILD_CHANGELOG_TIMESTAMP in the /.buildenv +- build-vm-kvm: use -cpu host on riscv64 +- small fixes and cleanups + +------------------------------------------------------------------- +Fri Aug 11 06:25:38 UTC 2023 - Adrian Schröter <adr...@suse.de> + +- Added parser for BcntSyncTag in sources + +------------------------------------------------------------------- Tue Aug 8 15:30:05 UTC 2023 - Adrian Schröter <adr...@suse.de> - pbuild: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/docs/build_config.adoc new/obs-build-20231027/docs/build_config.adoc --- old/obs-build-20230808/docs/build_config.adoc 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/docs/build_config.adoc 2023-10-27 10:34:38.000000000 +0200 @@ -1,6 +1,6 @@ == About the Build Configuration -The build configuration syntax is +The build configuration syntax is Switch on or off certain features during the build. @@ -42,7 +42,7 @@ Preinstall package list for a hint. ==== BuildEngine: ENGINE - + Use an alternative build engine. This is still chained inside of the build script for security reasons. Alternatives are mock (for Fedora and Red Hat) and debootstrap (for Debian). This will avoid differences in @@ -51,7 +51,7 @@ the distribution build. debbuild engine will build deb files out of a spec file description. It can be used by the following definition inside of the project build config: - + Repotype: debian Type: spec Binarytype: deb @@ -59,9 +59,9 @@ Support: pax Support: debbuild Keep: debbuild - + ==== BuildFlags: FLAG:VALUE - + The BuildFlags keyword defines flags for the build process. The following values for FLAG are usable. All flags with a leading colon (:) require an additional parameter directly following them. @@ -165,7 +165,14 @@ Sets a compression format for container layers. Possible values are gzip, zstd, zstd:chunked. The usage of values beside gzip is only supported by podman and buildah. - + +* container-build-format:FORMAT + +For podman container builds, it specifies the container config format. Possible values +are 'docker' and 'oci'. The default is 'docker'. The 'docker' format allows a few +extensions like ONBUILD, SHELL, DOMAINNAME, COMMENT, HEALTHCHECK amongst others. + + ==== Constraint: SELECTOR STRING CAUTION: OBS only @@ -173,9 +180,9 @@ Define build constraints for build jobs. The selector is a colon-separated list which gets a string assigned. See the build job constraints page for details. - + ==== ExpandFlags: FLAG - + Flags which modify the behaviour during dependency resolution. * unorderedimagerepos (OBS 2.10 or later) @@ -199,9 +206,9 @@ default, modules are not used, but content can be made available by specifying the module name. To remove a module, add an exclamation mark (!) as prefix. - + ==== ExportFilter: REGEX ARCH - + The export filter can be used to export build results from one architecture to others. This is required when one architecture needs packages from another architecture for building. The REGEX placeholder @@ -209,49 +216,49 @@ to all listed scheduler architectures. Using a single dot will export it to the architecture which was used to build it. So not using a dot there will filter the package. - + ==== FileProvides: FILE PACKAGES - + &obsa; ignores dependencies to files (instead of package names) by default. This is mostly done to reduce the amount of memory needed, as the package file lists take up a considerable amount of repository meta data. As a workaround, FileProvides can be used to tell the systems which packages contain a file. The File needs to have the full path. - + ==== HostArch: HOST_ARCH - + This is used for cross builds. It defines the host architecture used for building, while the scheduler architecture remains the target architecture. - + ==== Ignore: PACKAGES - + Ignore can be used to break dependencies. This can be useful to reduce the number of needed packages or to break cyclic dependencies. Be careful with this feature, as breaking dependencies can have surprising results. - + ==== Ignore: PACKAGE_A:PACKAGES - + It is possible to define the ignore only for one package. This package must be listed first with a colon. - + ==== Keep: PACKAGES - + To eliminate build cycles the to-be-built package is not installed by default, even when it is required. Keep can be used to overwrite this behavior. It is usually needed for packages like make that are used to build itself. Preinstalled packages are automatically kept, as the package installation program needs to work all the time. - + ==== OptFlags: TARGET_ARCH FLAGS (RPM only) - + Optflags exports compiler flags to the build. They will only have an effect when the spec file is using $RPM_OPT_FLAGS. The target architecture may be * to affect all architectures. - + ==== Order: PACKAGE_A:PACKAGE_B - + The build script takes care about the installation order if they are defined via dependencies inside of the packages. However, there might be dependency loops (reported during setup of the build system) or missing @@ -260,14 +267,14 @@ The package in PACKAGE_A will get installed before the package in PACKAGE_B. - + ==== Patterntype: TYPES - + Defines the pattern format. Valid values are: none (default), ymp, comps. - + ==== Prefer: PACKAGES - + In case multiple packages satisfy a dependency, the OBS system will complain about that situation. This is unlike like most package managing tools, which just pick one of the package. Because one of OBSâ goal is @@ -275,19 +282,19 @@ of choosing a random package. The Prefer: tag lists packages to be preferred in case a choice exists. When the package name is prefixed with a dash, this is treated as a de-prefer. - + ==== Prefer: PACKAGE_A:PACKAGES - + It is possible to define the prefer only when one package is creating the choice error. This package must be listed first with a colon. - + ==== Preinstall: PACKAGES - + Are needed to run the package installation program. These packages get unpacked before the VM gets started. Included scripts are not executed during this phase. However, these packages will get installed again inside of the VM including script execution. - + ==== PublishFlag: FLAG CAUTION: OBS only @@ -320,18 +327,18 @@ Defines the distversion to be used in group element of ymp files. This is used by the installer to check if the repository is suitable for the installed distribution. - + ==== PublishFilter: REGEXP [REGEXP] - + CAUTION: OBS only Limits the published binary packages in public repositories. Packages that match any REGEXP will not be put into the exported repository. There can be only one line of PublishFilter for historic reasons. However, multiple REGEXP can be defined. - + ==== Repotype: TYPE[:OPTIONS] - + Defines the repository format for published repositories. Valid values are: none, rpm-md, suse, debian, hdlist2, arch, staticlinks and vagrant. The OPTIONS parameter depends on the repository type, for rpm-md the @@ -340,51 +347,51 @@ rsyncable gzip compression. To split the debug packages in an own published repository the option splitdebug:REPOSITORY_SUFFIX can be appended, e.g. - + ==== Repotype: rpm-md splitdebug:-debuginfo - + (the repository format may even be omitted to use the default type). This results in a debuginfo package repository being created in parallel to the package repository. - + ==== Required: PACKAGES - + Contain one or more packages that always get installed for package builds. A change in one of these packages triggers a new build. - + ==== Runscripts: PACKAGES - + Defines the scripts of preinstalled packages which needs to be executed directly after the preinstall phase, but before installing the remaining packages. - + ==== Substitute: PACKAGE_A PACKAGES - + It is possible to replace to BuildRequires with other packages. This will have only an effect on directly BuildRequired packages, not on indirectly required packages. - + ==== Support: PACKAGES - + Contain one or more packages which also get installed for package builds, but a change in one of the packages does not trigger an automatic rebuild. This is useful for packages that most likely do not influence the build result, for example make or coreutils. - + ==== Target: TARGET_ARCH (RPM only) - + Defines the target architecture. This can be used to build for i686 on i586 schedulers for example. - + ==== Target: GNU_TRIPLET (DEB only) - -Defines the target architecture via a gnu triplet (not the debian + +Defines the target architecture via a gnu triplet (not the debian architecture!). For example arm-linux-gnueabihf for armv7hl builds. - + ==== Type: TYPE - + Build recipe type. This is the format of the file which provides the build description. This gets usually autodetected, but in some rare cases it can be set here to either one of these: spec, dsc, kiwi, @@ -393,9 +400,9 @@ Defines the build recipe format. Valid values are currently: none, spec, dsc, arch, kiwi, preinstallimage. If no type is specified, OBS deduces a type from the binary type. - + ==== VMInstall: PACKAGES - + Like Preinstall, but these packages get only installed when a virtual machine like Xen or KVM is used for building. Usually packages like mount are listed here. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/download_assets new/obs-build-20231027/download_assets --- old/obs-build-20230808/download_assets 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/download_assets 2023-10-27 10:34:38.000000000 +0200 @@ -153,8 +153,8 @@ find_assets($assetmgr, $bconf, $p, $opts->{'recipe'}); } else { for my $file (sort keys %$files) { - next unless $file eq 'sources' || $file eq 'go.sum' || $file eq 'PKGBUILD' || $file eq 'Dockerfile' || $file =~ /\.(?:spec|dsc|kiwi)/; - find_assets($assetmgr, $bconf, $p, $file); + next unless $file eq 'sources' || $file eq 'go.sum' || $file eq 'PKGBUILD' || $file eq 'Dockerfile' || $file =~ /^Dockerfile\./ || $file =~ /\.(?:spec|dsc|kiwi)/; + find_assets($assetmgr, $bconf, $p, $file); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/pbuild new/obs-build-20231027/pbuild --- old/obs-build-20230808/pbuild 2023-08-08 17:34:27.000000000 +0200 +++ new/obs-build-20231027/pbuild 2023-10-27 10:34:38.000000000 +0200 @@ -552,7 +552,13 @@ my $p = $job->{'pdata'}; delete $p->{'force_rebuild'}; my $duration = $job->{'endtime'} - $job->{'starttime'}; - $duration = sprintf("%d:%02d", int($duration / 60), $duration % 60); + if ($duration < 60) { + $duration = sprintf("%ds", $duration % 60); + } elsif ($duration < 3600) { + $duration = sprintf("%dm%02ds", int($duration / 60), $duration % 60); + } else { + $duration = sprintf("%dh%02dm%02ds", int($duration / 3600), int($duration / 60) % 60, $duration % 60); + } my $bid = ($job->{'nbuilders'} || 1) > 1 ? "$job->{'name'}: " : ''; print "${bid}finished $p->{'pkg'}/$p->{'recipe'} after ${duration}: $code\n"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20230808/t/diffdepth.t new/obs-build-20231027/t/diffdepth.t --- old/obs-build-20230808/t/diffdepth.t 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-build-20231027/t/diffdepth.t 2023-10-27 10:34:38.000000000 +0200 @@ -0,0 +1,57 @@ +#!/usr/bin/perl -w + +use strict; + +use Test::More tests => 18; + +use PBuild::Meta; + +sub dodiff { + my ($a1, $a2, $x, $msg) = @_; + my $n1 = PBuild::Meta::diffdepth($a1, $a2); + is($n1, $x, "$msg - normal"); + $n1 = PBuild::Meta::diffdepth($a2, $a1); + is($n1, $x, "$msg - normal reversed"); +} + +my @m1; +my @m2; + +dodiff(\@m1, \@m2, 0, 'empty1'); +push @m1, 'bbb1f01d98683e5cad6f396ae49ce66c dwz'; +dodiff(\@m1, \@m2, 1, 'empty2'); +push @m2, 'bbb1f01d98683e5cad6f396ae49ce66c dwz'; +dodiff(\@m1, \@m2, 0, 'identical1'); +@m1 = (); +dodiff(\@m1, \@m2, 1, 'empty3'); + +@m1 = split("\n", <<'EOF'); +bbb1f01d98683e5cad6f396ae49ce66c dwz +bbb1f01d98683e5cad6f396ae49ce66c aaa +EOF +@m2 = split("\n", <<'EOF'); +bbb1f01d98683e5cad6f396ae49ce66c dwz +EOF +dodiff(\@m1, \@m2, 2, 'one aaa'); + +@m2 = @m1; +dodiff(\@m1, \@m2, 0, 'identical aaa'); + +@m1 = split("\n", <<'EOF'); +bbb1f01d98683e5cad6f396ae49ce66c dwz +bbb1f01d98683e5cad6f396ae49ce66c aba +EOF +dodiff(\@m1, \@m2, 2, 'different aaa'); + +@m1 = split("\n", <<'EOF'); +bbb1f01d98683e5cad6f396ae49ce66c dwz +bbb1f01d98683e5cad6f396ae49ce66c aaa +bbb1f01d98683e5cad6f396ae49ce66c aaa/xx +EOF +dodiff(\@m1, \@m2, 3, 'different aaa/xx'); + +push @m1, 'bbb1f01d98683e5cad6f396ae49ce66c aaa/yy'; +push @m2, 'bbb1f01d98683e5cad6f396ae49ce66c aaa/yy'; +dodiff(\@m1, \@m2, 3, 'different aaa/xx 2'); + +