Bug 270289 - databases/mysql80-server: pkg check shows missing libprotobuf.so.3.19.4
Summary: databases/mysql80-server: pkg check shows missing libprotobuf.so.3.19.4
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: Jochen Neumeister
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-18 01:48 UTC by Ting-Wei Lan
Modified: 2023-12-14 17:04 UTC (History)
8 users (show)

See Also:
bugzilla: maintainer-feedback? (joneum)


Attachments
[patch] Resolve libprotobuf issues (2.25 KB, patch)
2023-04-28 15:47 UTC, Toshimichi Masubuchi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ting-Wei Lan 2023-03-18 01:48:03 UTC
After installing the port, pkg check shows following messages:

# pkg check -dna
Checking all packages: 100%
mysql80-server is missing a required shared library: libprotobuf.so.3.19.4

It seems there is no port providing the libprotobuf.so.3.19.4 file, so the dependency may be wrong here.
Comment 1 Tomoaki AOKI 2023-03-22 22:44:17 UTC
Looking into port Makefile, maybe because
  having "libprotobuf.so:devel/protobuf \" in LIB_DEPENDS
but also
  having "-DWITH_PROTOBUF=bundled \" in CMAKE_ARGS
thus conflicting.

Not sure which is correct, but there seems to be 2 options.
  Drop "libprotobuf.so:devel/protobuf \" in LIB_DEPENDS
or
  Change "-DWITH_PROTOBUF=bundled \" to "-DWITH_PROTOBUF=system \" in CMAKE_ARGS.
Comment 2 Ting-Wei Lan 2023-03-26 14:12:28 UTC
The commit which changed WITH_PROTOBUF=system to WITH_PROTOBUF=bundled said it is needed to fix i386 build: https://cgit.freebsd.org/ports/commit/?id=6498bc6381cc493b38ff7d1ab6087a66f0ec238f

However, removing libprotobuf.so:devel/protobuf from LIB_DEPENDS doesn't fix the issue.
Comment 3 Tomoaki AOKI 2023-04-02 06:57:51 UTC
(In reply to Ting-Wei Lan from comment #2)

Digging into a bit further and coming to think that bundled protobuf may be insufficient, so depending on ports devel/protobuf is required to get missing pieces.

And also found that there are
 databases/mysql80-server/work/.build/lib/libprotoc.so.3.19.4
and
 databases/mysql80-server/work/stage/usr/local/lib/private/libprotobuf.so.3.19.4
built.

In pkg-plist, there is @comment lib/private/libprotobuf.so.3.19.4 line, but no lib/mysql/libprotobuf.so.3.19.4 line.

Just adding lib/mysql/libprotobuf.so.3.19.4 line to pkg-plist caused build error (staging phase).

I tried to find the way how lib/mysql/libprotobuf-lite.so.3.19.4 is created from databases/mysql80-server/work/stage/usr/local/lib/private/libprotobuf-lite.so.3.19.4, but unfortunately, it was beyond my hand. Giving up.
Comment 4 Maxim 2023-04-05 20:37:17 UTC
Yes, I have the same problem, which is not fixed in any way.
Comment 5 Joel Rodriguez 2023-04-15 15:07:06 UTC
The change in the Makefile from system to bundled for PROTOBUF breaks the build with an undefined symbol:

ld-elf.so.1: /usr/ports/databases/mysql80-server/work/.build/library_output_directory/libprotoc.so.3.19.4: Undefined symbol "\
_ZN6google8protobuf7Message17CopyWithSizeCheckEPS1_RKS1_"

Changing the Makefile back to system results in a clean build, but then you get the linking error upon install which can be fixed up with a link.

This is a serious issue that need immediate attention for FreeBSD 12.4-RELEASE.
Comment 6 Joel Rodriguez 2023-04-25 17:17:39 UTC
Silence is not golden.

This bug affects anyone using MySql on FreeBSD release 12.

I have used MySql for over 2 decades on FreeBSD and this is the first issue I have ever had.

And indeed, there are many ports that rely on MySql.

Please advise.

Thanks
Joel
Comment 7 Maxim 2023-04-26 18:48:24 UTC
Why only on FreeBSD release 12? I have this problem on FreeBSD release 13.1
Comment 8 Aaron Lopez 2023-04-27 12:14:00 UTC
Hi, I am affected by this issue as well and I am using FreeBSD 13.1. If there is any information which I can provide for further analysis I would be pleased to do so.
Comment 9 Henk Miltenburg 2023-04-27 12:44:53 UTC
I use FreeBSD 13.2 with the same issue.
Comment 10 Christos Chatzaras 2023-04-27 20:33:58 UTC
Did you notice any issue with this library missing?

My system is affected but didn't notice any issue with MySQL 8.0.
Comment 11 Joel Rodriguez 2023-04-27 20:38:05 UTC
(In reply to Maxim from comment #7)
sry, I am not yet running release 13 so I could not testify to it.

But good to know!
Comment 12 Maxim 2023-04-27 21:14:39 UTC
(In reply to Christos Chatzaras from comment #10)

No, there are no visible issues. But it's not a fact that they suddenly will not appear in the future.
Comment 13 Toshimichi Masubuchi 2023-04-28 15:47:04 UTC
Created attachment 241827 [details]
[patch] Resolve libprotobuf issues

To include libprotobuf.so.3.19.4 in the package,
CMake option INSTALL_PRIV_LIBDIR must be specified.

The attached patch does the following:
- Remove dependency on devel/protobuf
- Add INSTALL_PRIV_LIBDIR to CMake options
- Install libprotobuf*.so.3.19.4 to lib/mysql/private

[Example]
# freebsd-version && uname -m
13.1-RELEASE-p7
amd64
# pkg search -Q depends-on -Q shared-libs-provided databases/mysql80-server
databases/mysql80-server
Comment        : Multithreaded SQL database (server)
Shared Libs provided:
        libprotobuf.so.3.19.4
        libprotobuf-lite.so.3.19.4
        libmysqlrouter_routing.so.1
        libmysqlrouter_mysqlxmessages.so.1
        libmysqlrouter_metadata_cache.so.1
        libmysqlrouter_io_component.so.1
        libmysqlrouter_http_auth_realm.so.1
        libmysqlrouter_http_auth_backend.so.1
        libmysqlrouter_http.so.1
        libmysqlrouter_destination_status.so.1
        libmysqlrouter_connection_pool.so.1
        libmysqlrouter.so.1
        libmysqlharness_tls.so.1
        libmysqlharness_stdx.so.1
        libmysqlharness.so.1
Depends on     :
        groff-1.22.4_4
        openssl-1.1.1t_2,1
        libfido2-1.13.0
        perl5-5.34.1_2
        curl-8.0.1
        libunwind-20211201_2
        libevent-2.1.12
        libedit-3.1.20221030,1
        icu-73.1,1
        mysql80-client-8.0.32_2
        hidapi-0.13.1
        zstd-1.5.4_2
        liblz4-1.9.4,1
# pkg install -y databases/mysql80-server
# pkg check -dna
Checking all packages: 100%
Comment 14 Ting-Wei Lan 2023-04-29 08:18:29 UTC
(In reply to Toshimichi Masubuchi from comment #13)
The patch fixes the pkg check issue for me.
Comment 15 commit-hook freebsd_committer freebsd_triage 2023-04-30 18:20:00 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=567557abbfc0a4deec492983ffc01da78c62bae4

commit 567557abbfc0a4deec492983ffc01da78c62bae4
Author:     Toshimichi Masubuchi <t.masub@gmail.com>
AuthorDate: 2023-04-30 18:13:17 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2023-04-30 18:18:32 +0000

    databases/mysql80-server: fix a issue with protobuf

    PR:     270289
    Reported by: Ting-Wei Lan <lantw44@gmail.com>
    Sponsored by:   Netzkommune GmbH

 databases/mysql80-client/Makefile  | 2 +-
 databases/mysql80-server/Makefile  | 4 ++--
 databases/mysql80-server/pkg-plist | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)
Comment 16 Aaron Lopez 2023-05-19 21:36:16 UTC
(In reply to Toshimichi Masubuchi from comment #13)

The patch worked for me as well. Thank you Toshimichi Masubuchi!
It took me a while though to use it because I wasn't familiar with the whole patching from ports process on a system which relies on packages (in my case Quarterly).
Would it be possible for you to please do a MFH since this issue affects basic upgrades from Quarterly?
Thanks once again and in advance in any case.
Comment 17 commit-hook freebsd_committer freebsd_triage 2023-12-14 17:04:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6e980054b5f371e5d5512613fa79445863e90f68

commit 6e980054b5f371e5d5512613fa79445863e90f68
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-12-14 16:22:25 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-12-14 17:03:03 +0000

    databases/mysql57-{client,server}: Use bundled protobuf

    - Bump PORTREVISION for dependency and package change

    mysql57 failed to build with protobuf 22+. Since the maintainer already committed
    a fix [1] on mysql80 to use bundled protobuf, we take the same approach to avoid
    build error with protobuf 22+ from ports tree and potential issue.

    PR:             270289
    Reference:      https://cgit.freebsd.org/ports/commit/?id=567557abbfc0a4deec492983ffc01da78c62bae4 [1]

 databases/mysql57-client/Makefile                  |  2 +-
 databases/mysql57-server/Makefile                  |  8 +++---
 .../mysql57-server/files/patch-protobuf (gone)     | 32 ----------------------
 3 files changed, 5 insertions(+), 37 deletions(-)