On 03/22/2017 01:34 PM, Mark Wielaard wrote:
On Tue, 2017-03-21 at 14:15 +0200, Panu Matilainen wrote:
Commit bbfe1f86b2e4b5c0bd499d9f3dd9de9c9c20fff2 broke short-circuited
binary builds (which can be handy for testing when working on large
packages), eg:
     rpmbuild -bi foo.spec; rpmbuild -bb --short-circuit foo.spec

The problem is that in a short-circuited build all the links already
exist and point to the right place, but the code doesn't realize this
and creates new links instead, which leaves the old links unowned
in the buildroot which ultimately causes the build to fail with
"Installed (but unpackaged) file(s) found" for the previously created
build-id links.

When checking for pre-existing links see if they already point to
the right file and in that case just reuse it instead of creating new
ones, IFF %install did not execute (which means we must be in
 --short-circuited build)

It bothered me that we need to special case the --short-circuit case
since in theory your original fix should have worked.

The reason it didn't work for duplicate build-ids when using compat
links is that the compat links themselves are symlinks. So when checking
that the existing link points to the expected target we need to resolve
both the link path and the target path before comparing.

Which is what the attached patch (applied on top of your original patch)
does. With that I get zero fail again on make check.

Good. However --short-circuit is doesn't *quite* work with this version.

Using popt-1.16-7.fc24.src.rpm from Fedora as a test case, doing

$ rpm -i  popt-1.16-7.fc24.src.rpm
$ rpmbuild -bi ~/rpmbuild/SPECS/popt.spec
$ rpmbuild -bl --short-circuit ~/rpmbuild/SPECS/popt.spec

With unpatched git master I get some duplicate warnings plus:
error: Installed (but unpackaged) file(s) found:
   /usr/lib/.build-id/ef/2ba32deaf4d979c4f58538ba9c7594ff2fd7dc
   /usr/lib/debug/.build-id/ef/2ba32deaf4d979c4f58538ba9c7594ff2fd7dc
   /usr/lib/debug/.build-id/ef/2ba32deaf4d979c4f58538ba9c7594ff2fd7dc.debug

With this patch I only get:
error: Installed (but unpackaged) file(s) found:
   /usr/lib/debug/.build-id/49/bc01fadb22c6483481c0fea95e9a6013936b41

Guess there's some unhandled corner left still :)

        - Panu -
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to