Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 687940 - media-gfx/imagemagick-7.0.8.46 needs to be rebuilt by perl-cleaner
Summary: media-gfx/imagemagick-7.0.8.46 needs to be rebuilt by perl-cleaner
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: perl-cleaner-rebuild
  Show dependency tree
 
Reported: 2019-06-12 13:17 UTC by Pacho Ramos
Modified: 2021-05-15 15:38 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2019-06-12 13:17:54 UTC
I don't know why perl-cleaner --all rebuilds imagemagick even if it seems it has the correct dependencies in the ebuild for getting rebuilt if needed:
[ebuild   R    ] media-gfx/imagemagick-7.0.8.46:0/7.0.8.46::gentoo  USE="X bzip2 cxx djvu heif jpeg lcms lzma openmp pango perl png postscript raw svg tiff truetype webp wmf xml zlib -corefonts -fftw -fontconfig -fpx -graphviz -hdri -jbig -jpeg2k -lqr (-opencl) -openexr -q32 -q8 -static-libs -test" 0 KiB

# perl-cleaner --all
 * Removing perl-core packages from world file
 *    emerge --deselect  perl-core/File-Temp 
>>> No matching atoms found in "world" favorites file...
 * Updating installed Perl virtuals
 *    emerge -u1  virtual/perl-Carp virtual/perl-Compress-Raw-Bzip2 virtual/perl-Compress-Raw-Zlib virtual/perl-CPAN-Meta virtual/perl-CPAN-Meta-YAML virtual/perl-Data-Dumper virtual/perl-Digest virtual/perl-Digest-MD5 virtual/perl-Digest-SHA virtual/perl-Encode virtual/perl-Exporter virtual/perl-ExtUtils-CBuilder virtual/perl-ExtUtils-Install virtual/perl-ExtUtils-MakeMaker virtual/perl-ExtUtils-Manifest virtual/perl-ExtUtils-ParseXS virtual/perl-File-Path virtual/perl-File-Spec virtual/perl-File-Temp virtual/perl-Getopt-Long virtual/perl-if virtual/perl-IO virtual/perl-IO-Compress virtual/perl-IO-Socket-IP virtual/perl-JSON-PP virtual/perl-libnet virtual/perl-MIME-Base64 virtual/perl-Module-Metadata virtual/perl-parent virtual/perl-Parse-CPAN-Meta virtual/perl-Perl-OSType virtual/perl-podlators virtual/perl-Pod-Parser virtual/perl-Scalar-List-Utils virtual/perl-Storable virtual/perl-Sys-Syslog virtual/perl-Test-Harness virtual/perl-Text-ParseWords virtual/perl-Time-HiRes virtual/perl-Time-Local virtual/perl-Time-Piece virtual/perl-version virtual/perl-XSLoader 

 * IMPORTANT: 1 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

Calculating dependencies... done!
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * Beginning a clean up of .ph files
 * Excluding files for 5.28.2 and 5.28.2/x86_64-linux from cleaning

 * Locating ph files for removal

 * Locating packages for an update
 * Locating ebuilds linked against libperl
 *   Adding to list: media-gfx/imagemagick:0
 * emerge -v1 --backtrack=200 --selective=n media-gfx/imagemagick:0
Comment 1 Garri 2019-09-03 15:55:55 UTC
I believe I faced exactly the same issue. I noticed that perl-cleaner tries to rebuild net-analyzer/net-snmp every time I run it.

I've spent some time investigating the problem and found that SONAME variable does not get a value in the following code:

    226             SONAME="$(${scanelf} -qBS "$(realpath ""/usr/lib/libperl.{so,dylib} 2>/dev/null )" | awk '{ print $1 }')"


The problem is related to the quoted command substitution for 'realpath' command. In particular, 'scanelf' sees the following two paths as one string (file):

$ scanelf -qvvvBS "$(realpath ""/usr/lib/libperl.{so,dylib} 2>/dev/null )"
Format: %S 
/usr/lib64/libperl.so.5.30.0
/usr/lib64/libperl.dylib: does not exist


Removing the quotes around the command substitution solved the problem for me:

=================
--- perl-cleaner	2019-01-26 01:23:13.546389953 +0500
+++ perl-cleaner	2019-09-03 20:51:04.812857646 +0500
@@ -223,7 +223,7 @@
             ewarn "--libperl is disbled."
             LIBPERL=false
         else
-            SONAME="$(${scanelf} -qBS "$(realpath ""/usr/lib/libperl.{so,dylib} 2>/dev/null )" | awk '{ print $1 }')"
+            SONAME="$(${scanelf} -qBS $(realpath ""/usr/lib/libperl.{so,dylib} 2>/dev/null ) | awk '{ print $1 }')"
             veinfo 4 SONAME="${SONAME}"
         fi
     fi
==================
Comment 2 Garri 2019-09-04 17:00:59 UTC
The problem was introduced 3 years ago as part of a commit adding prefix and Darwin support [1]. Before that, only one path had been returned by the command substitution, so the double quotes around the construction was not a problem. However, after involving Bash globbing in the construction, the double quotes have become a problem:

- SONAME="$(scanelf -qBS "$(realpath /usr/lib/libperl.so 2>/dev/null )" | awk '{ print $1 }')"
+ SONAME="$(${scanelf} -qBS "$(realpath "@GENTOO_PORTAGE_EPREFIX@"/usr/lib/libperl.{so,dylib} 2>/dev/null )" | awk '{ print $1 }')"


Because of that, soname has never matched and perl-cleaner has been rebuilding every binary compiled against libperl on every run.


[1] https://github.com/gentoo-perl/perl-cleaner/commit/2734c97095ba55635c4d389e95908153bb45b5f2
Comment 3 Andreas K. Hüttel archtester gentoo-dev 2021-05-15 15:38:14 UTC
Please reopen if you still have problems with perl-cleaner 2.30 or later.