Bug 274748 - net/mpd5: revision bump to unbreak ssl=openssl111 consumers on pkg-upgrade
Summary: net/mpd5: revision bump to unbreak ssl=openssl111 consumers on pkg-upgrade
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Eugene Grosbein
URL: https://bugs.freebsd.org/bugzilla/sho...
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-27 07:40 UTC by Franco Fichtner
Modified: 2023-10-27 09:33 UTC (History)
0 users

See Also:
eugen: maintainer-feedback+


Attachments
revision (735 bytes, application/mbox)
2023-10-27 07:40 UTC, Franco Fichtner
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franco Fichtner 2023-10-27 07:40:12 UTC
Created attachment 245908 [details]
revision

Hi,

I've mentioned it in 273970 but let's make it clear by adding a ticket and a trivial patch for it.

++++
While the commit states "The change does not affect build, so PORTREVISION not bumped." it does affect runtime with pkg-upgrade and openssl/openssl111 port shift resulting in a spurious conflict:

openssl111-1.1.1w conflicts with openssl-1.1.1w,1 on /usr/local/bin/c_rehash
Cannot solve problem using SAT solver, trying another plan

You can read more about the observed pkg-upgrade behaviour here:

https://github.com/opnsense/core/issues/6959

The obvious fix for us was to issue a revision bump.  It would probably be safer to have it in the FreBSD ports too since otherwise this may lead pkg-upgrade into the conflict state and it can't resolve it automatically.
++++


Cheers,
Franco
Comment 1 Eugene Grosbein freebsd_committer freebsd_triage 2023-10-27 08:07:04 UTC
net/mpd5 does not require nor use any of *ssl ports/packages as it links with libfetch from base system that links with base openssl libraries. Hence, build system of mpd5 does not refer to any of ${LOCALBASE} paths for includes and libraries despite of possible presence of some *ssl package and despite of non-base choice for DEFAULT_VERSION=ssl=something_but_not_base.

You cannot link mpd5 with non-base openssl, period.
Comment 2 Franco Fichtner 2023-10-27 08:09:05 UTC
What is wrong with you?

I showed you this is an issue with ssl=openssl111 users and pkg-upgrade behaviour now and you reject it?

How much work is it to add a revision bump?

I'm frankly fed up with arguing about such simple things that make life better for other people, but are ignored or refused.


Cheers,
Franco
Comment 3 Eugene Grosbein freebsd_committer freebsd_triage 2023-10-27 08:15:19 UTC
(In reply to Franco Fichtner from comment #2)

Not meant to be rude.

mpd5 package does NOT depend on openssl in FreeBSD. If it does in opnsense then it is a bug, so package build system of opnsense should be fixed and package rebuilt.
Comment 4 Franco Fichtner 2023-10-27 08:16:32 UTC
Ok, yes, you are right.  Rebuilt with a revision bump.  Otherwise pkg-upgrade will be stuck.  This is what I am saying.  Your analysis was only correct for ssl=base builds.


Cheers,
Franco
Comment 5 Eugene Grosbein freebsd_committer freebsd_triage 2023-10-27 08:28:53 UTC
(In reply to Franco Fichtner from comment #4)

I just did in bhyve guest running FreeBSD:

pkg install openssl111
echo 'DEFAULT_VERSIONS+=ssl=openssl111' > /etc/make.conf # did not exist previously
make -C /usr/ports/net/mpd5 clean all install

And still:

# pkg info -d mpd5
mpd5-5.9_16:

No dependency on openssl. In fact, /usr/ports/net/mpd5/Makefile has no references to any of *ssl:

# fgrep -ic ssl /usr/ports/net/mpd5/Makefile
0

If you have mpd5-5.9_16 package that depends on any of *ssl packages, your building system has a bug and needs to be fixed. Maybe, it adds USES=openssl111 unconditionally via /etc/make.conf or some other way. It should not.
Comment 6 Franco Fichtner 2023-10-27 08:32:08 UTC
Ok, from the top:

ssl=openssl bakes a dependency on openssl package into mpd5 from the time USES=ssl was set.

removing the USES=ssl removes the dependency from openssl package, but the previous package remains installed.

Now if you do pkg-upgrade all packages still dependent on ssl=openssl will move to ssl=openssl111, but pkg fails to do this because it doesn't know mpd5 needs an update so it leaves it alone, but then has to stop because mpd5 installed depends on openssl while it has to install openssl111 for everything else.

The solution is to add the revision bump to force pkg-upgrade to pick up the mpd5 change.


Cheers,
Franco
Comment 7 Franco Fichtner 2023-10-27 08:32:14 UTC
Ok, from the top:

ssl=openssl bakes a dependency on openssl package into mpd5 from the time USES=ssl was set.

removing the USES=ssl removes the dependency from openssl package, but the previous package remains installed.

Now if you do pkg-upgrade all packages still dependent on ssl=openssl will move to ssl=openssl111, but pkg fails to do this because it doesn't know mpd5 needs an update so it leaves it alone, but then has to stop because mpd5 installed depends on openssl while it has to install openssl111 for everything else.

The solution is to add the revision bump to force pkg-upgrade to pick up the mpd5 change.


Cheers,
Franco
Comment 8 Franco Fichtner 2023-10-27 08:37:14 UTC
FWIW, this is likely a bug in pkg-upgrade shared library management change detection, but the workaround is simple and effective.  Thanks for the consideration.
Comment 9 Eugene Grosbein freebsd_committer freebsd_triage 2023-10-27 08:40:47 UTC
Yes, you are right. Will do shortly. Thanks for clarification, ENOSLEEP.
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-10-27 09:32:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3671e9d239628d5f25b282255e4d864cf7536614

commit 3671e9d239628d5f25b282255e4d864cf7536614
Author:     Eugene Grosbein <eugen@FreeBSD.org>
AuthorDate: 2023-10-27 09:18:09 +0000
Commit:     Eugene Grosbein <eugen@FreeBSD.org>
CommitDate: 2023-10-27 09:32:10 +0000

    net/mpd5: minor improvements

    (1) Import r2512 and r2529 from upstream:

    * optimize CCP logging a bit: no string copying for known CCP names;
    * use right name for HP-PPC.

    Bump PORTREVISION.

    (2) Also, this commit fixes upgrade problem for package users
    introduced with previous commit that removed USES=ssl
    not bumping PORTREVISION and following rename of openssl package
    to openssl111. For details, refer to:

    https://github.com/opnsense/core/issues/6959

    PR:             274748 (2)
    Reported by:    Franco Fichtner (2)
    Fixes:          87e2681289fc1eb5fda22e4072aca1e7943af25e

 net/mpd5/Makefile              |   2 +-
 net/mpd5/files/patch-ccp (new) | 107 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 108 insertions(+), 1 deletion(-)
Comment 11 Franco Fichtner 2023-10-27 09:33:16 UTC
Thanks a lot!