Bug 280756 - graphics/pecl-imagick needs a version bump
Summary: graphics/pecl-imagick needs a version bump
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: Zsolt Udvari
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-11 17:35 UTC by Dave Hayes
Modified: 2025-01-17 12:30 UTC (History)
5 users (show)

See Also:
000.fbsd: maintainer-feedback+
000.fbsd: maintainer-feedback+
000.fbsd: merge-quarterly?


Attachments
bump PORTREVISION=4 (332 bytes, patch)
2024-08-23 12:25 UTC, Miroslav Lachman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hayes 2024-08-11 17:35:40 UTC
I did a simple "pkg upgrade" and this happened:

  ImageMagick7 upgraded: 7.1.1.26_3 -> 7.1.1.26_4

but pecl-imagick did -not- upgrade, staying at PORTREVISION 3 ... which is what was previously installed.

Thus when restarting php-fpm, this happened:
  
   PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/local/lib/php/20210902/imagick.so (/usr/local/lib/libMagickWand-7.so.10: version VERS_10.0 required by /usr/local/lib/php/20210902/imagick.so not defined), /usr/local/lib/php/20210902/imagick.so.so (Cannot open "/usr/local/lib/php/20210902/imagick.so.so")) in Unknown on line 0


So I suspect a simple PORTREVISION bump is all that is needed to fix this issue in the ports tree. For those coming from a search engine, I fixed this by uninstalling and reinstalling the pecl-imagick package.
Comment 1 Miroslav Lachman 2024-08-13 08:58:49 UTC
(In reply to Dave Hayes from comment #0)
If the version of ImageMagick remains the same (7.1.1.26) and only PORTREVISION has changed, then I think the version number of the library /usr/local/lib/libMagickWand-7.so.10 should remain the same on a filesystem.
Can you send the output of
ls -l /usr/local/lib/libMagick*

I am short on time at this moment so if anybody else can check / test this and confirm PORTREVISION bump of pecl-imagick is required please do it!
Comment 2 Dave Hayes 2024-08-13 16:22:10 UTC
From the VERS_10.0, I presume that this value is received from inside the shared library, not from the filename. 

Here is the output you requested:

> ls -l /usr/local/lib/libMagick*
-rw-r--r--  1 root  wheel  1142932 Jul 21 12:49 /usr/local/lib/libMagick++-7.a
-rwxr-xr-x  1 root  wheel      976 Jul 21 12:49 /usr/local/lib/libMagick++-7.la*
lrwxr-xr-x  1 root  wheel       22 Jul 21 12:49 /usr/local/lib/libMagick++-7.so@ -> libMagick++-7.so.5.0.0
lrwxr-xr-x  1 root  wheel       22 Jul 21 12:49 /usr/local/lib/libMagick++-7.so.5@ -> libMagick++-7.so.5.0.0
-rwxr-xr-x  1 root  wheel   673656 Jul 21 12:49 /usr/local/lib/libMagick++-7.so.5.0.0*
-rw-r--r--  1 root  wheel  5295388 Jul 21 12:49 /usr/local/lib/libMagickCore-7.a
-rwxr-xr-x  1 root  wheel      994 Jul 21 12:49 /usr/local/lib/libMagickCore-7.la*
lrwxr-xr-x  1 root  wheel       25 Jul 21 12:49 /usr/local/lib/libMagickCore-7.so@ -> libMagickCore-7.so.10.0.1
lrwxr-xr-x  1 root  wheel       25 Jul 21 12:49 /usr/local/lib/libMagickCore-7.so.10@ -> libMagickCore-7.so.10.0.1
-rwxr-xr-x  1 root  wheel  2950680 Jul 21 12:49 /usr/local/lib/libMagickCore-7.so.10.0.1*
-rw-r--r--  1 root  wheel  2543478 Jul 21 12:49 /usr/local/lib/libMagickWand-7.a
-rwxr-xr-x  1 root  wheel      994 Jul 21 12:49 /usr/local/lib/libMagickWand-7.la*
lrwxr-xr-x  1 root  wheel       25 Jul 21 12:49 /usr/local/lib/libMagickWand-7.so@ -> libMagickWand-7.so.10.0.1
lrwxr-xr-x  1 root  wheel       25 Jul 21 12:49 /usr/local/lib/libMagickWand-7.so.10@ -> libMagickWand-7.so.10.0.1
-rwxr-xr-x  1 root  wheel  1323448 Jul 21 12:49 /usr/local/lib/libMagickWand-7.so.10.0.1*
Comment 3 FiLiS 2024-08-14 08:09:17 UTC
since `pkg install -f php81-pecl-imagick-3.7.0_3` fixes the issue, I would assume that the problem would go away with a portrevision bump, because that would let pkg take care of the pseudo-upgrade/reinstall.
Comment 4 Miroslav Lachman 2024-08-16 14:27:02 UTC
(In reply to FiLiS from comment #3)
I would really like to understand more about the root cause of the problem. If reinstalling solved the problem, what changed? The file names of the installed libraries remained the same. The versions remain the same. How about "service ldconfig restart" instead of reinstalling?
Comment 5 Dave Hayes 2024-08-16 23:27:31 UTC
So to be clear:

- The ImageMagick7 package did get upgraded, which means "built" (via poudriere) and "reinstalled" (via package upgrade)

- The pecl-imagick package got built, but my theory is that because PORTREVISION didn't change, pkg did not upgrade it. The evidence to support this theory is that  there is no log of it being upgraded when I upgraded everything else.

- When I bumped PORTREVISION by one, and rebuilt just pecl-imagick, then pkg upgrade found the new package and installed it.

I do not believe "service ldconfig restart" would work in this case, because the old pecl-imagick package expected one version of ImageMagick7 which was de-installed   due to the pkg upgrade. The newer version of ImageMagick7 got installed, which was incompatible with the old version of pecl-imagick.

Does this help? :)
Comment 6 Miroslav Lachman 2024-08-23 12:25:34 UTC
Created attachment 253036 [details]
bump PORTREVISION=4

I am sorry for the delay. I can finally confirm the problem in my test environment. Attached is the patch with bumped PORTREVISION.

Thank you for the detailed bug report.
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-09-03 05:37:37 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7407e38cec60a15d8f6254f5e9aeae7450eb19ee

commit 7407e38cec60a15d8f6254f5e9aeae7450eb19ee
Author:     Miroslav Lachman <000.fbsd@quip.cz>
AuthorDate: 2024-09-03 05:34:46 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2024-09-03 05:36:47 +0000

    graphics/pecl-imagick: bump PORTREVISION

    Bump PORTREVISION after ImageMagick7 upgrade.

    PR:             280756
    Reported by:    Dave Hayes <dave@jetcafe.org>
    Approved by:    submitter is maintainer

 graphics/pecl-imagick/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 8 Miroslav Lachman 2024-09-05 09:10:31 UTC
(In reply to commit-hook from comment #7)
Merge to Quarterly needed! 
2024Q3 has ImageMagick7 7.1.1.26_4 - the same as in HEAD, which required revision bump in pecl-imagick.
Merge was requested by Flags.
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-09-05 18:16:57 UTC
A commit in branch 2024Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=55fa942c3b87670d48214091615a3554fbe939c1

commit 55fa942c3b87670d48214091615a3554fbe939c1
Author:     Miroslav Lachman <000.fbsd@quip.cz>
AuthorDate: 2024-09-03 05:34:46 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2024-09-05 18:15:04 +0000

    graphics/pecl-imagick: bump PORTREVISION

    Bump PORTREVISION after ImageMagick7 upgrade.

    PR:             280756
    Reported by:    Dave Hayes <dave@jetcafe.org>
    Approved by:    submitter is maintainer

    (cherry picked from commit 7407e38cec60a15d8f6254f5e9aeae7450eb19ee)

 graphics/pecl-imagick/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 10 Zsolt Udvari freebsd_committer freebsd_triage 2024-09-05 18:17:31 UTC
(In reply to Miroslav Lachman from comment #8)
Sorry, I forgot it.
Comment 11 Miroslav Lachman 2024-09-05 19:23:01 UTC
(In reply to Zsolt Udvari from comment #10)
Thank you for the quick fix.
Comment 12 Michel Le Cocq 2024-10-19 04:41:49 UTC
Hi, for Nextcloud I need this package :
php83-pecl-imagick-3.7.0_4 

Nextcloud seems not happy :
php occ update:check

PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/local/lib/php/20230831/imagick.so (/usr/local/lib/libMagickWand-7.so.10: version VERS_10.0 required by /usr/local/lib/php/20230831/imagick.so not defined), /usr/local/lib/php/20230831/imagick.so.so (Cannot open "/usr/local/lib/php/20230831/imagick.so.so")) in Unknown on line 0
Comment 13 Zsolt Udvari freebsd_committer freebsd_triage 2024-10-21 12:48:41 UTC
(In reply to Michel Le Cocq from comment #12)
@Miroslav?
Comment 14 Miroslav Lachman 2024-11-06 22:18:28 UTC
(In reply to Michel Le Cocq from comment #12)
I am sorry I was out of computer for a few weeks.
What was installed / updated that caused this error? Did you somehow upgraded ImageMagick? 
Your error looks the same as was before the last portrevision bump.
Comment 15 Gleb Popov freebsd_committer freebsd_triage 2025-01-17 12:30:50 UTC
The root cause of this problem is still unclear. As Miroslav correctly noticed, a mere PORTREVISION bump on ImageMagick should not break its ABI.