Bug 205161 - cad/qcad: install error due to conflict with archivers/quazip
Summary: cad/qcad: install error due to conflict with archivers/quazip
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: Michael Reifenberger
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-12-09 16:45 UTC by Arrigo Marchiori
Modified: 2016-01-15 18:31 UTC (History)
3 users (show)

See Also:
mr: maintainer-feedback+
koobs: maintainer-feedback-
koobs: merge-quarterly?


Attachments
Patch to add CONFLICTS lines to cad/qcad and archivers/quazip Makefile's (700 bytes, patch)
2015-12-22 15:01 UTC, Arrigo Marchiori
no flags Details | Diff
Proposed patch to disable builtin quazip and use archivers/quazip instead (2.05 KB, patch)
2015-12-23 11:46 UTC, Arrigo Marchiori
no flags Details | Diff
Proposed patch to disable builtin quazip and use archivers/quazip instead (2.03 KB, patch)
2015-12-29 10:10 UTC, Arrigo Marchiori
no flags Details | Diff
Patch to ports r404790 that has archivers/quazip as LIB_DEPENDS instead of BUILD_DEPENDS (536 bytes, patch)
2015-12-30 13:46 UTC, Arrigo Marchiori
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arrigo Marchiori 2015-12-09 16:45:12 UTC
The port cad/qcad does not install itself, due to a conflict with archivers/quazip on file /usr/local/lib/libquazip.so

My system is 9-STABLE, with src tree at SVN revision 291928 and ports tree at SVN revision 403185.

# uname -a
FreeBSD myhost 9.3-STABLE FreeBSD 9.3-STABLE #136 r291928M: Mon Dec  7 09:44:23 CET 2015     root@myhost:/usr/obj/usr/src/sys/GENERIC  i386

qcad builds successfully (make with no parameters). After that:

# cd /usr/ports/cad/qcad && make install
===>  Installing for qcad-3.12.3.0_4
[...]
===>  Checking if qcad already installed
===>   Registering installation for qcad-3.12.3.0_4
Installing qcad-3.12.3.0_4...
pkg-static: qcad-3.12.3.0_4 conflicts with quazip-0.7.1 (installs files into the same place).  Problematic file: /usr/local/lib/libquazip.so
Comment 1 John Marino freebsd_committer freebsd_triage 2015-12-14 18:22:40 UTC
ALL you are doing is stating a fact.  Clearly, I can infer you think this is wrong, but I don't know what you think is correct.

For example,
Are you saying there should be a CONFLICTS set?

Or are you saying that the conflict should be resolved so both ports can be installed?  If the latter, how do you propose that happens?  Also, which maintainer should be responsible since there are two involved?

Is there a patch coming?
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2015-12-15 02:06:30 UTC
nivit@'s port is indicated as well, maintain CC.
Comment 3 Arrigo Marchiori 2015-12-22 14:58:34 UTC
(In reply to John Marino from comment #1)
Hello John,

thank you for your reply.

You infer correctly. After all, this is Bugzilla... ;-)

I am not sure about how to solve this problem. I believe that adding a CONFLICTS entries in the Makefile should be the quickest way to save users a somewhat lengthy build that eventually fails to install.

Today I built cad/qcad, then deinstalled archivers/quazip, and then installed cad/qcad. Result: the program does not _run_, because it relied on the quazip library that it had available system-wide during the build process:

# make install
[snip]
===>  Checking if qcad already installed
===>   Registering installation for qcad-3.12.3.0_4
(qcad-3.12.3.0_4) /usr/ports/cad/qcad/work/stage//usr/local/bin/qcad-bin - required shared library libquazip.so.1 not found
(qcad-3.12.3.0_4) /usr/ports/cad/qcad/work/stage//usr/local/lib/libqcadecmaapi.so.0 - required shared library libquazip.so.1 not found
(qcad-3.12.3.0_4) /usr/ports/cad/qcad/work/stage//usr/local/lib/libqcadzip.so.0 - required shared library libquazip.so.1 not found
Installing qcad-3.12.3.0_4...

And in fact:

$ qcad
Shared object "libquazip.so.1" not found, required by "qcad"

This leads me to think that we need a build-time conflict between qcad and quazip.
Comment 4 Arrigo Marchiori 2015-12-22 15:01:05 UTC
Created attachment 164499 [details]
Patch to add CONFLICTS lines to cad/qcad and archivers/quazip Makefile's

The Makefile of cad/qcad has a CONFLICTS entry because the presence of archivers/quazip seems to lead to a wrong build.

The Makefile of archivers/quazip only has a CONFLICTS_INSTALL entry because there is no other evidence at the moment.
Comment 5 VK 2015-12-22 15:34:54 UTC
Is this the same libquazip.so? Or functionally something else but named the same? Because if it's the former, wouldn't it make more sense to patch out installation of the lib from cad/qcad and make the port depend on archivers/quazip?
Comment 6 Arrigo Marchiori 2015-12-22 16:08:20 UTC
(In reply to Vladimir Krstulja from comment #5)
Hello Vladimir,

cad/qcad contains its own version of archivers/quazip. I could not find any pointers to the version, but the source tree is _very_ similar to the current version of archivers/quazip, i.e. 0.7.1.

I hope this helps.
Comment 7 Arrigo Marchiori 2015-12-22 16:11:00 UTC
(In reply to Vladimir Krstulja from comment #5)
Sorry, I only replied to the first part of your comment.

I believe that yes, it would be much better to patch out the compilation and installation of the embedded quazip.
But I have no clue about how to do it. I am sorry.
Comment 8 John Marino freebsd_committer freebsd_triage 2015-12-22 16:11:15 UTC
ports policy is to avoid using bundled versions when there's a port version available.

cad/qcad should be modified to use quazip from ports.
Comment 9 Arrigo Marchiori 2015-12-23 11:46:57 UTC
Created attachment 164542 [details]
Proposed patch to disable builtin quazip and use archivers/quazip instead

Following John's advice, here is a proposal for a patch that disables compilation and installation of the built-in quazip, and adds a dependency on archivers/quazip instead.
Could anyone with a good understanding of QMake and the ports system kindly review it?
Comment 10 Raphael Kubo da Costa freebsd_committer freebsd_triage 2015-12-28 17:09:03 UTC
> +		${LOCALBASE}/lib/libquazip.so:${PORTSDIR}/archivers/quazip

You can leave out the "${LOCALBASE}/lib" part here and say "libquazip.so:${PORTSDIR}/archivers/quazip" instead.

Other than that, the change looks sensible to me from a QMake perspective.
Comment 11 Arrigo Marchiori 2015-12-29 10:10:42 UTC
Created attachment 164813 [details]
Proposed patch to disable builtin quazip and use archivers/quazip instead

This patch includes Raphael's suggestion from comment #10.
(Thank you, Raphael!)
Comment 12 Raphael Kubo da Costa freebsd_committer freebsd_triage 2015-12-29 14:07:14 UTC
Arrigo's patch looks sane to me, ack from my side. I guess we need to wait for mr@'s feedback a little longer before calling it a maintainer timeout?
Comment 13 Michael Reifenberger freebsd_committer freebsd_triage 2015-12-29 14:26:51 UTC
Hi,
I'll test the patch in my poudriere env. for FreeBSD-9 and FreeBSD-10 first
before commiting.
Thanks for your investigations!

greetings
---
mike
Comment 14 commit-hook freebsd_committer freebsd_triage 2015-12-30 00:01:30 UTC
A commit references this bug:

Author: mr
Date: Wed Dec 30 00:00:45 UTC 2015
New revision: 404790
URL: https://svnweb.freebsd.org/changeset/ports/404790

Log:
  Try to resolve conflict with archivers/quazip by disabling the internal one from qcad.

  PR:		205161
  Submitted by:	Arrigo Marchiori

Changes:
  head/cad/qcad/Makefile
  head/cad/qcad/files/patch-src_3rdparty_3rdparty.pro
  head/cad/qcad/pkg-plist
Comment 15 Michael Reifenberger freebsd_committer freebsd_triage 2015-12-30 00:17:14 UTC
Hi,
I committed the patch after compile testing.
(Had to prefix ${LOCALBASE}/lib again since otherwise it didn't work
on poudriere at least)...

Please test.

Greetings
---
Mike
Comment 16 Raphael Kubo da Costa freebsd_committer freebsd_triage 2015-12-30 10:00:59 UTC
(In reply to Michael Reifenberger from comment #15)
> Hi,
> I committed the patch after compile testing.
> (Had to prefix ${LOCALBASE}/lib again since otherwise it didn't work
> on poudriere at least)...

Sorry for the brain fart during the review... The problem's that this should be a LIB_DEPENDS, not a BUILD_DEPENDS. I think you'll need another PORTREVISION bump :-(
Comment 17 Kubilay Kocak freebsd_committer freebsd_triage 2015-12-30 10:45:47 UTC
Assign to committer that is resolving the issue
Comment 18 Arrigo Marchiori 2015-12-30 13:46:03 UTC
Created attachment 164862 [details]
Patch to ports r404790 that has archivers/quazip as LIB_DEPENDS instead of BUILD_DEPENDS

I apologize for having set quazip.so as BUILD_DEPENDS in the first place.
Comment 19 Raphael Kubo da Costa freebsd_committer freebsd_triage 2015-12-30 13:58:45 UTC
(In reply to Arrigo Marchiori from comment #18)
> Created attachment 164862 [details]
> Patch to ports r404790 that has archivers/quazip as LIB_DEPENDS instead of
> BUILD_DEPENDS
> 
> I apologize for having set quazip.so as BUILD_DEPENDS in the first place.

The change looks sane, with a few nitpicks:
- There's usually no empty line between BUILD_DEPENDS and LIB_DEPENDS.
- There needs to be a PORTREVISION bump again, since the port's dependency list has changed (it only depended on quazip for building, and now it is a dependency for the installed package too).
Comment 20 commit-hook freebsd_committer freebsd_triage 2015-12-30 16:30:50 UTC
A commit references this bug:

Author: mr
Date: Wed Dec 30 16:30:10 UTC 2015
New revision: 404871
URL: https://svnweb.freebsd.org/changeset/ports/404871

Log:
  Use LIB_DEPENDS for the quazip dependency.

  PR:		205161
  Submitted by:	Arrigo Marchiori

Changes:
  head/cad/qcad/Makefile
Comment 21 Arrigo Marchiori 2016-01-08 13:26:00 UTC
Michael, the problem looks solved to me.
Thank you for taking care of this!
Comment 22 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-01-08 14:57:44 UTC
Michael: do you intend to MFH the commits mentioned in this bug?
Comment 23 Michael Reifenberger freebsd_committer freebsd_triage 2016-01-15 18:31:42 UTC
(In reply to Raphael Kubo da Costa from comment #22)

Not immediately.

Besides a MFH the problem should be solved now.

Greetings
---
Michael