Bug 219008 - pkg deleted print/harfbuzz when upgrading due to plist errors
Summary: pkg deleted print/harfbuzz when upgrading due to plist errors
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords:
: 218998 222381 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-05-01 21:36 UTC by rkoberman
Modified: 2018-02-13 01:15 UTC (History)
8 users (show)

See Also:


Attachments
Patch to fixes incorrect plist (339 bytes, patch)
2017-05-23 00:56 UTC, Ilia Skalozubov
freebsd: maintainer-approval? (gnome)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rkoberman 2017-05-01 21:36:17 UTC
This morning I ran 'pkg upgrade' and it deleted harfbuzz. This sems linked to the installation of harfbuzzz-icu, but that is just a guess. Even though harfbuzz-icu show as depending on harfbuzz, I got the following in my log:
May  1 11:21:24 server pkg: harfbuzz-1.4.6_1 installed
May  1 11:21:24 server pkg: harfbuzz-1.4.6 deinstalled
May  1 11:21:25 server pkg: harfbuzz-icu-1.4.6_1 installed
May  1 11:21:30 server pkg: webkit2-gtk3 upgraded: 2.8.5_8 -> 2.8.5_9 
May  1 11:21:34 server pkg: webkit-gtk2 upgraded: 2.4.11_7 -> 2.4.11_8 
May  1 11:21:35 server pkg: tmux upgraded: 2.3_2 -> 2.4 
May  1 11:21:35 server pkg: mDNSResponder upgraded: 765.50.9 -> 765.50.9_2 

So it installed a new version of harfbuzz, then deleted it and installed harfbuzz-icu. As a result, gnuplot would not run as libpangocairo is linged to libharfbuzz.so.0 which was not longer present.

But wait! 'pkg info harfbuzz' still showed harfbuzz and I was able to "successfully" delete it with 'pkg delete -f harfbuzz'. The delete showed al of the files in the packing list as missing.

I then re-installed harfbuzz without error and things started running normally again.
Comment 1 Baptiste Daroussin freebsd_committer 2017-05-01 22:27:34 UTC
This seems like a bug in pkg I was hitted with it as well, I'm trying to isolate to reproduce and see what happened and fix it
Comment 2 Koop Mast freebsd_committer 2017-05-04 06:41:36 UTC
*** Bug 218998 has been marked as a duplicate of this bug. ***
Comment 3 bsd 2017-05-04 06:53:54 UTC
This bug hit many users on our side, too, including users of LibreOffice.

I see other ports are affected, all seems related to "libharfbuzz.so.0" not found.

Possible candidate is the "Split off the harfbuzz icu support into it's own port." recent change in those ports?
Comment 4 Baptiste Daroussin freebsd_committer 2017-05-04 11:37:51 UTC
for sure it is related to the split.

The workaround is pkg install -f harfbuzz
Comment 5 jakub_lach 2017-05-13 20:51:08 UTC
I'm getting libharfbuzz-icu.so.0 not found when trying to build LibreOffice. Is it the same? libharfbuzz-icu is either installed (then it tries to install it once more on top pf it and fails) or not  (then it installs it but -icu lib is still missing /usr/local/ still and LibreOffice build fails.



e.g. 
===>  Checking if harfbuzz-icu already installed
===>   harfbuzz-icu-1.4.6_1 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of harfbuzz-icu
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

make: stopped in /usr/ports/editors/libreoffice

===>>> make build failed for editors/libreoffice
===>>> Aborting update

===>>> Update for editors/libreoffice failed
===>>> Aborting update

===>>> The following actions were performed:
        Installation of devel/icu (icu-58.2_2,1)
        Installation of print/harfbuzz (harfbuzz-1.4.6_1)
        Installation of print/harfbuzz-icu (harfbuzz-icu-1.4.6_1)
Comment 6 rkoberman 2017-05-14 05:56:20 UTC
(In reply to jakub_lach from comment #5)
This sounds like the inverse of what I saw.

Grep /var/log/messages for the day you did the upgrade for "harfbuzz". See if any of he packages was deinstalled AFTER installing it. This is what I saw. After that I checked and "pkg info" still showed the port installed but the files listed were simply not present.

A 'pkg delete -f' followed by a 'pkg install' restored the missing files.
  
If this is what you find, please report this in the PR.
Comment 7 jakub_lach 2017-05-14 09:09:36 UTC
I was able to better isolated what was going on-

In my case, if I build locally harfbuzz-icu (portmaster or just make build) it doesn't actually copy upon installation libharfbuzz-icu.so.0 and libharfbuzz-icu.so.0.10400.6 to /usr/local/lib. The resulting package is 'installed' without errors, but there are no relevant libraries actually copied (so LibreOffice build is missing those yet harfbuzz-icu is registered as already installed).

Non-icu harfbuzz port builds and installs it's files just fine. If I just 'pkg install harfbuzz-icu' I get missing libraries installed normally. So somehow I silently get broken harfbuzz-icu package if build locally.
Comment 8 jakub_lach 2017-05-15 10:56:14 UTC
(In reply to jakub_lach from comment #7)

It is similar after all. I've locally built -icu package and it adds just fine. It must have been deleted similarly to your case (registered but non existent files).
Comment 9 Ilia Skalozubov 2017-05-23 00:56:24 UTC
Created attachment 182822 [details]
Patch to fixes incorrect plist

print/harfbuzz-icu port does not contain files, due to the fact that PLIST in Makefile is not defined correctly.
According to bsd.port.mk, PLIST must contain a path to the file, not just its name.
Comment 10 Ilia Skalozubov 2017-07-28 20:13:30 UTC
Comment on attachment 182822 [details]
Patch to fixes incorrect plist

I remind about the fact that the port is broken for 3 months.
Comment 11 Mark Linimon freebsd_committer freebsd_triage 2017-07-30 15:18:05 UTC
Turn this back into a PR about an individual port and properly assign.
Comment 12 VVD 2017-08-21 22:24:25 UTC
(In reply to jakub_lach from comment #7)
> In my case, if I build locally harfbuzz-icu (portmaster or just make build) it doesn't actually copy upon installation libharfbuzz-icu.so.0 and libharfbuzz-icu.so.0.10400.6 to /usr/local/lib. The resulting package is 'installed' without errors, but there are no relevant libraries actually copied (so LibreOffice build is missing those yet harfbuzz-icu is registered as already installed).

I see same on i386 host, but it installed fine on amd64 host…
Build logs same on both hosts.
Comment 13 VVD 2017-08-21 22:33:29 UTC
(In reply to vvd from comment #12)
Both i386 and amd64 are 11.1, print/harfbuzz 1.4.8.
Comment 14 VVD 2017-08-21 22:40:05 UTC
One more: part of pkg info -R harfbuzz-icu-1.4.8
on amd64:
…
flatsize = 9491;
…
categories [
    "print",
]
shlibs_required [
    "libicudata.so.58",
    "libharfbuzz.so.0",
    "libicuuc.so.58",
]
shlibs_provided [
    "libharfbuzz-icu.so.0",
]
files {
    /usr/local/include/harfbuzz/hb-icu.h = "1$f2eaa478e7ecc533be912d75288e6fa8c2157191edbc03b2bd68c302bbcd0f6e";
    /usr/local/lib/libharfbuzz-icu.so = "1$7724a6332e1d8cffb5239378092f858931fcaed172befd9d4df28660da4ed8df";
    /usr/local/lib/libharfbuzz-icu.so.0 = "1$7724a6332e1d8cffb5239378092f858931fcaed172befd9d4df28660da4ed8df";
    /usr/local/lib/libharfbuzz-icu.so.0.10400.8 = "1$6521a331490c106e425000bca38df4b330d1ce9beb70c37a076b734f08efa17a";
    /usr/local/libdata/pkgconfig/harfbuzz-icu.pc = "1$a5c3e5ce936b7ea172f023e5aa6778e9ee2c7631dfe3e5237d268784e6873e51";
}
scripts {
    post-install = "/sbin/ldconfig -m /usr/local/lib";
    post-deinstall = "/sbin/ldconfig -R";
}

on i386:
…
flatsize = 0;
…
categories [
    "print",
]
scripts {
    post-install = "/sbin/ldconfig -m /usr/local/lib";
    post-deinstall = "/sbin/ldconfig -R";
}
Comment 15 Zane C. Bowers-Hadley 2017-09-22 21:24:49 UTC
(In reply to vvd from comment #12)

Everything I have is amd64 and on anything with harfbuzz-icu, it fails.

What needs to happen is harfbuzz-icu needs merged back into harfbuzz. The split was entirely with out merit.
Comment 16 jakub_lach 2017-09-28 12:37:49 UTC
(In reply to Zane C. Bowers-Hadley from comment #15)

Currently I cannot build non-empty harfbuzz-icu package locally anymore. Only solution was to add premade one it with pkg install.
Comment 17 Zane C. Bowers-Hadley 2017-09-29 01:19:41 UTC
You need to unsplit it.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222466

Contains patches to unbreak all the harfbuzz stuff via unsplitting it.

Honestly it is just getting bloody stupid at this point that this issue is being ignored for so long.
Comment 18 VVD 2017-09-29 08:50:55 UTC
Last commit r450872 didn't change anything for me: shlibs_required, shlibs_provided and files records are empty on i386.
But attached in comment #9 patch fixed "my" bug as expected!
Records shlibs_required, shlibs_provided and files of pkg info -R harfbuzz-icu-1.5.1_2 are same on i386 and amd64 now!
Thanks, Ilia Skalozubov!
Comment 19 jakub_lach 2017-09-29 09:28:40 UTC
Thanks, though I prefer the plist fix above.
Comment 20 sdalu 2017-10-15 12:21:57 UTC
PLIST fix is working well. Is there someone to commit it?
Comment 21 commit-hook freebsd_committer 2017-11-02 04:08:12 UTC
A commit references this bug:

Author: jbeich
Date: Thu Nov  2 04:07:24 UTC 2017
New revision: 453334
URL: https://svnweb.freebsd.org/changeset/ports/453334

Log:
  Don't try to look for PLIST under .OBJDIR

  If MAKEOBJDIRPREFIX and WRKDIRPREFIX are same PLIST may point to a
  non-existing file under .OBJDIR without breaking build.

  $ export MAKEOBJDIRPREFIX=/tmp
  $ echo WRKDIRPREFIX=/tmp >>${__MAKE_CONF-/etc/make.conf}
  $ cd /usr/ports/print/harfbuzz-icu
  $ make clean patch
  $ make -V .OBJDIR
  /tmp/usr/ports/print/harfbuzz-icu
  $ make install
  $ pkg info -l harfbuzz-icu
  harfbuzz-icu-1.5.1_2:

  PR:		219008
  Submitted by:	Ilia Skalozubov (based on)
  Approved by:	portmgr blanket

Changes:
  head/print/harfbuzz-icu/Makefile
  head/science/gnudatalanguage/Makefile
  head/security/ossec-hids-client/Makefile
Comment 22 commit-hook freebsd_committer 2017-11-02 04:13:23 UTC
A commit references this bug:

Author: jbeich
Date: Thu Nov  2 04:12:20 UTC 2017
New revision: 453335
URL: https://svnweb.freebsd.org/changeset/ports/453335

Log:
  MFH: r453334

  Don't try to look for PLIST under .OBJDIR

  If MAKEOBJDIRPREFIX and WRKDIRPREFIX are same PLIST may point to a
  non-existing file under .OBJDIR without breaking build.

  $ export MAKEOBJDIRPREFIX=/tmp
  $ echo WRKDIRPREFIX=/tmp >>${__MAKE_CONF-/etc/make.conf}
  $ cd /usr/ports/print/harfbuzz-icu
  $ make clean patch
  $ make -V .OBJDIR
  /tmp/usr/ports/print/harfbuzz-icu
  $ make install
  $ pkg info -l harfbuzz-icu
  harfbuzz-icu-1.5.1_2:

  PR:		219008
  Submitted by:	Ilia Skalozubov (based on)
  Approved by:	portmgr blanket
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2017Q4/
  branches/2017Q4/print/harfbuzz-icu/Makefile
  branches/2017Q4/science/gnudatalanguage/Makefile
  branches/2017Q4/security/ossec-hids-client/Makefile
Comment 23 Jan Beich freebsd_committer 2018-02-13 01:15:27 UTC
*** Bug 222381 has been marked as a duplicate of this bug. ***