[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

binNMU status: related packages



Hi WB maintainers,

I learnt from the triggers code trigger.debian that for stable suites,
trigger_wb_update_for_overlay is used to track not only the packages in
stable-pu, but also the packages in stable, which are added in the status
"related". This provides a mechanism to binNMU a package in stable without
moving or copying the source package to stable-pu. 

However, it seems that after the binNMU-ed version has been built and uploaded
to the archive, the corresponding source package tracked by wb cannot be
migrated to the Installed state, stuck in the Uploaded state. From the code I
can see that the installed packages and the installed sources are read in the
beginning of merge-v3 by WB::QD::readsourcebins(). In WB::QD::readsourcebins(),
sources are first read and then packages are read and the information of the
corresponding source package is annotated with "installed", "compiled" and
"binnmu". If a binary package belongs to an unknown source package, then the
binary package is skipped (QD.pm: 104). Next, in merge-v3, the additional
sources are read with empty package list, the status of these source packages
are set to related, and the information is merged. Note here the information of
the additional sources are not annotated with the information from the binary
packages. Suppose there is a source package named foo, whose version is 1.2.3
and it builds into a binary package named foo-bin, with the same version
number. Both the source package and the binary package are in the codename
stable. As a result, we can see en entry foo, with version 1.2.3, State
Installed and Notes related in wanna-build. Suppose a binNMU 1.2.3+b1 is
requested from wanna-build. After the package foo-bin is uploaded to the
codename stable-proposed-updates in the archive, in the arguments of merge-v3,
foo-bin_1.2.3+b1 will appear in the installed packages, i.e. @ipkgs,
src:foo_1.2.3 will not appear in the installed sources, i.e. @isrcs, but in the
considered-as-installed sources, i.e. @psrcs. As a result, the returned $srcs
from WB::QD::readsourcebins() will not contain src:foo since @isrcs does not
contain src:foo. src:foo will appear in $psrcs, but without any annotation
about the binNMU number, since WB::QD::readsourcebins() is only called with
@psrcs. After being merged, $srcs will finally contain information about
src:foo, but without the binNMU number. In parse_all_v3(), it will compare the
given source information with that recorded in the database. Specifically, it
will compare both the version number and the binNMU number. If both match, the
source package will be moved into Installed state. Since the $srcs given to
parse_all_v3() does not contain binNMU number of src:foo, the comparison will
never succeed and the state of foo will be set to out-of-date and foo will
remain in the Uploaded state.

By applying the following patch, @prsrcs are loaded along with @ipkgs to
correctly annotate the source packages in it and the source package foo above
can successfully transit into Installed state. 

diff --git a/bin/wanna-build b/bin/wanna-build
index 0a893fd..ea2f1ac 100755
--- a/bin/wanna-build
+++ b/bin/wanna-build
@@ -517,7 +517,7 @@ undef $distribution if $distribution eq 'any';
                             # Installed sources of the base suite: only add them as related, not
                             # installed; skip the entries if we got something in installed
                             # sources already.
-                            my $psrcs = WB::QD::readsourcebins($arch, $Pas, \@psrcs, []);
+                            my $psrcs = WB::QD::readsourcebins($arch, $Pas, \@psrcs, \@ipkgs);
                             foreach my $k (keys %$$psrcs) {
                                 next if $$srcs->{$k};
                                 my $pkg = $$psrcs->{$k};


I wonder why the wanna-build instance of the official build network works for
this case. I can see currently bash is in the Installed state [1]. How the
transition to the Installed state is done or I have some mis-understanding about
how wanna-build is expected to work?

Cheers,

Miao Wang

[1]: https://buildd.debian.org/status/package.php?p=bash&suite=trixie

Reply to: