Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#54019 closed defect (fixed)

ghostscript @9.21: install_name of libgs.9.21.dylib is wrong

Reported by: papachoco (Carlos Sanchez) Owned by: neverpanic (Clemens Lang)
Priority: Normal Milestone:
Component: ports Version: 2.4.1
Keywords: Cc: nortcele, michaellass (Michael Lass), Behinder (behinder), breiter (Brian Reiter), parafin, Polyergic (Shad Sterling), kateyalatalo (Dr. Katherine Alatalo), fmw42 (Fred Weinhaus)
Port: ghostscript

Description

I tried to ghostscript from 9.19_0 to 9.21_0 ; however after installation the port remained broken

Attachments (2)

log.txt (64.1 KB) - added by papachoco (Carlos Sanchez) 7 years ago.
rev-upgrade_output.txt (61.5 KB) - added by JacquesLB 7 years ago.

Download all attachments as: .zip

Change History (38)

Changed 7 years ago by papachoco (Carlos Sanchez)

Attachment: log.txt added

comment:1 Changed 7 years ago by papachoco (Carlos Sanchez)

I am running MacOS Sierra 10.12.4; Xcode 8.3.2

Thanks a lot

Carlos

comment:2 Changed 7 years ago by papachoco (Carlos Sanchez)

--->  Scanning binaries for linking errors
Could not open libgs.9.21.dylib: Error opening or reading file (referenced from /opt/local/bin/gsc)
libgs.9.21.dylib seems to be referenced using a relative path. This may be a problem with its canonical library name and require the use of install_name_tool(1) to fix.
--->  Found 4 broken files, matching files to ports
--->  Found 2 broken ports, determining rebuild order
Last edited 7 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 7 years ago by seanfarley (Sean Farley)

Yep, I'm seeing this too. For what it's worth, I had to manually fix this by using,

$ sudo install_name_tool -id /opt/local/lib/libgs.9.21.dylib /opt/local/lib/libgs.9.21.dylib
$ sudo install_name_tool -change libgs.9.21.dylib /opt/local/lib/libgs.9.21.dylib /opt/local/bin/gsc
$ sudo install_name_tool -change libgs.9.21.dylib /opt/local/lib/libgs.9.21.dylib /opt/local/bin/gsx
$ sudo install_name_tool -change libgs.9.21.dylib /opt/local/lib/libgs.9.21.dylib /opt/local/lib/ImageMagick-6.9.8/modules-Q16/coders/pdf.so
$ sudo install_name_tool -change libgs.9.21.dylib /opt/local/lib/libgs.9.21.dylib /opt/local/lib/ImageMagick-6.9.8/modules-Q16/coders/ps.so

comment:4 Changed 7 years ago by nortcele

Cc: nortcele added

comment:5 Changed 7 years ago by nortcele

I have the same problem. At the end of the installation of a port that depends on ghostscript and ImageMagick I got the following alert.

--->  Updating database of binaries
--->  Scanning binaries for linking errors               
--->  Found 4 broken files, matching files to ports
--->  Found 2 broken ports, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt:
 ghostscript @9.21+x11
 ImageMagick @6.9.8-3+x11
Continue? [Y/n]: n

Then if I try to rebuilt, the build fails after three attemps.

sudo port rev-upgrade
Password:
--->  Scanning binaries for linking errors
--->  Found 4 broken files, matching files to ports
--->  Found 2 broken ports, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt:
 ghostscript @9.21+x11
 ImageMagick @6.9.8-3+x11
Continue? [Y/n]: y
--->  Computing dependencies for ghostscript
--->  Cleaning ghostscript
--->  Computing dependencies for ImageMagick
--->  Cleaning ImageMagick
--->  Scanning binaries for linking errors
--->  Found 4 broken files, matching files to ports
--->  Found 2 broken ports, determining rebuild order
--->  Rebuilding in order
     ghostscript @9.21 +x11
     ImageMagick @6.9.8-3 +x11
--->  Computing dependencies for ghostscript
--->  Fetching distfiles for ghostscript
--->  Verifying checksums for ghostscript
--->  Extracting ghostscript
--->  Applying patches to ghostscript
Warning: reinplace s|#!/usr/bin/perl|#!/opt/local/bin/perl| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_print_ghostscript/ghostscript/work/ghostscript-9.21/freetype_local/src/tools/afblue.pl
--->  Configuring ghostscript
--->  Building ghostscript
--->  Staging ghostscript into destroot
--->  Unable to uninstall ghostscript @9.21_0+x11, the following ports depend on it:
--->  	ImageMagick @6.9.8-3_0+x11
--->  	texlive-bin @2016_5+x11
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating ghostscript @9.21_0+x11
--->  Cleaning ghostscript
--->  Uninstalling ghostscript @9.21_0+x11
--->  Cleaning ghostscript
--->  Computing dependencies for ghostscript
--->  Installing ghostscript @9.21_0+x11
--->  Activating ghostscript @9.21_0+x11
--->  Cleaning ghostscript
--->  Computing dependencies for ImageMagick
--->  Fetching distfiles for ImageMagick
--->  Verifying checksums for ImageMagick
--->  Extracting ImageMagick
--->  Configuring ImageMagick
--->  Building ImageMagick
--->  Staging ImageMagick into destroot
--->  Unable to uninstall ImageMagick @6.9.8-3_0+x11, the following ports depend on it:
--->  	dblatex @0.3.10_1+latex
--->  	p5.24-perlmagick @6.9.8-3_0
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating ImageMagick @6.9.8-3_0+x11
--->  Cleaning ImageMagick
--->  Uninstalling ImageMagick @6.9.8-3_0+x11
--->  Cleaning ImageMagick
--->  Computing dependencies for ImageMagick
--->  Installing ImageMagick @6.9.8-3_0+x11
--->  Activating ImageMagick @6.9.8-3_0+x11
--->  Cleaning ImageMagick
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  Found 4 broken files, matching files to ports
--->  Found 2 broken ports, determining rebuild order
--->  Rebuilding in order
     ghostscript @9.21 +x11
     ImageMagick @6.9.8-3 +x11
--->  Computing dependencies for ghostscript
--->  Fetching distfiles for ghostscript
--->  Verifying checksums for ghostscript
--->  Extracting ghostscript
--->  Applying patches to ghostscript
Warning: reinplace s|#!/usr/bin/perl|#!/opt/local/bin/perl| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_print_ghostscript/ghostscript/work/ghostscript-9.21/freetype_local/src/tools/afblue.pl
--->  Configuring ghostscript
--->  Building ghostscript
--->  Staging ghostscript into destroot
--->  Unable to uninstall ghostscript @9.21_0+x11, the following ports depend on it:
--->  	texlive-bin @2016_5+x11
--->  	ImageMagick @6.9.8-3_0+x11
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating ghostscript @9.21_0+x11
--->  Cleaning ghostscript
--->  Uninstalling ghostscript @9.21_0+x11
--->  Cleaning ghostscript
--->  Computing dependencies for ghostscript
--->  Installing ghostscript @9.21_0+x11
--->  Activating ghostscript @9.21_0+x11
--->  Cleaning ghostscript
--->  Computing dependencies for ImageMagick
--->  Fetching distfiles for ImageMagick
--->  Verifying checksums for ImageMagick
--->  Extracting ImageMagick
--->  Configuring ImageMagick
--->  Building ImageMagick
--->  Staging ImageMagick into destroot
--->  Unable to uninstall ImageMagick @6.9.8-3_0+x11, the following ports depend on it:
--->  	dblatex @0.3.10_1+latex
--->  	p5.24-perlmagick @6.9.8-3_0
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating ImageMagick @6.9.8-3_0+x11
--->  Cleaning ImageMagick
--->  Uninstalling ImageMagick @6.9.8-3_0+x11
--->  Cleaning ImageMagick
--->  Computing dependencies for ImageMagick
--->  Installing ImageMagick @6.9.8-3_0+x11
--->  Activating ImageMagick @6.9.8-3_0+x11
--->  Cleaning ImageMagick
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  Found 4 broken files, matching files to ports
Error: Port ghostscript is still broken after rebuilding it more than 3 times.
Error: Please run port -d -y rev-upgrade and use the output to report a bug.
Error: rev-upgrade failed: Port ghostscript still broken after rebuilding 3 times
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Last edited 7 years ago by nortcele (previous) (diff)

comment:6 Changed 7 years ago by JacquesLB

Same here.

I tried: "port clean", and "port uninstall" without success.

It is very annoying, since I can not compile LaTeX files anymore (loads of errors in image conversions to produce the final PDF).

Jacques

PS: see file rev-upgrade_output.txt below for details

Last edited 7 years ago by JacquesLB (previous) (diff)

Changed 7 years ago by JacquesLB

Attachment: rev-upgrade_output.txt added

comment:7 Changed 7 years ago by JacquesLB

Many thanks to seanfarley !

The "install_name_tool" trick worked, although I do not understand why.

Jacques

comment:8 Changed 7 years ago by michaellass (Michael Lass)

Cc: michaellass added

comment:9 Changed 7 years ago by mf2k (Frank Schima)

Keywords: upgrade failure removed

comment:10 Changed 7 years ago by mf2k (Frank Schima)

Owner: set to ryandesign
Port: ImageMagick added
Status: newassigned

comment:11 Changed 7 years ago by mf2k (Frank Schima)

Cc: Behinder added

has duplicate #54024.

comment:12 Changed 7 years ago by mf2k (Frank Schima)

Cc: Polyergic added

has duplicate #54025.

comment:13 Changed 7 years ago by breiter (Brian Reiter)

Cc: breiter added

comment:14 Changed 7 years ago by mf2k (Frank Schima)

Cc: dyne2meter added

has duplicate #54027.

comment:15 in reply to:  3 Changed 7 years ago by yukonjack11

Replying to seanfarley:

Yep, I'm seeing this too. For what it's worth, I had to manually fix this by using,

$ sudo install_name_tool -id /opt/local/lib/libgs.9.21.dylib /opt/local/lib/libgs.9.21.dylib
$ sudo install_name_tool -change libgs.9.21.dylib /opt/local/lib/libgs.9.21.dylib /opt/local/bin/gsc
$ sudo install_name_tool -change libgs.9.21.dylib /opt/local/lib/libgs.9.21.dylib /opt/local/bin/gsx
$ sudo install_name_tool -change libgs.9.21.dylib /opt/local/lib/libgs.9.21.dylib /opt/local/lib/ImageMagick-6.9.8/modules-Q16/coders/pdf.so
$ sudo install_name_tool -change libgs.9.21.dylib /opt/local/lib/libgs.9.21.dylib /opt/local/lib/ImageMagick-6.9.8/modules-Q16/coders/ps.so

This worked for me! Thanks!

comment:16 Changed 7 years ago by mf2k (Frank Schima)

Summary: ghostscript, ImageMagick broke after upgradeghostscript ImageMagick: Could not open libgs.9.21.dylib: Error opening or reading file (referenced from /opt/local/bin/gsc)

comment:17 Changed 7 years ago by mf2k (Frank Schima)

Summary: ghostscript ImageMagick: Could not open libgs.9.21.dylib: Error opening or reading file (referenced from /opt/local/bin/gsc)ghostscript ImageMagick rebuild error: Could not open libgs.9.21.dylib: Error opening or reading file (referenced from /opt/local/bin/gsc)

comment:18 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Port: ImageMagick removed
Summary: ghostscript ImageMagick rebuild error: Could not open libgs.9.21.dylib: Error opening or reading file (referenced from /opt/local/bin/gsc)ghostscript @9.21: install_name of libgs.9.21.dylib is wrong

Confirmed, the install_name of libgs.9.21.dylib is wrong (is missing the full path to the library). This is a regression from version 9.19.

comment:19 Changed 7 years ago by parafin

Cc: parafin added

comment:20 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Has duplicate #54020.

comment:21 Changed 7 years ago by Polyergic (Shad Sterling)

Cc: Polyergic removed

comment:22 Changed 7 years ago by Polyergic (Shad Sterling)

Cc: Polyergic added

comment:23 Changed 7 years ago by kateyalatalo (Dr. Katherine Alatalo)

Cc: kateyalatalo added

comment:24 Changed 7 years ago by neverpanic (Clemens Lang)

Owner: changed from ryandesign to neverpanic
Status: assignedaccepted

Caused by use of LDFLAGS_SO in a patch where GS_LDFLAGS_SO should be used, working on a fixed patch.

comment:25 Changed 7 years ago by neverpanic (Clemens Lang)

Resolution: fixed
Status: acceptedclosed

comment:26 Changed 7 years ago by neverpanic (Clemens Lang)

In fd91a5d970954bd66ae88e47adeb8d1daa8cfbe5/macports-ports:

Revbump library users of ghostscript

After the ghostscript update in 947d9823ca, the install name of the
ghostscript library changed. All dependents need to be rebuilt against
the new libgs.dylib, so revbump them.

This list has been generated using 'port echo depends:ghostscript'.
I have manually excluded ports that only had a runtime dependency (as
opposed to a library dependency), assuming they would only need the
binary. I have also excluded ports with library dependencies that only
seem to use the 'gs' binary (e.g. because they declare
depends_skip_archcheck for ghostscript).

See: #53805
See: #54019

comment:27 Changed 7 years ago by mf2k (Frank Schima)

Cc: fmw42 added

has duplicate #54030.

comment:28 Changed 7 years ago by nortcele

All is fine with the new portfile. Thanks.

comment:29 in reply to:  28 ; Changed 7 years ago by fmw42 (Fred Weinhaus)

Replying to nortcele:

All is fine with the new portfile. Thanks.

I tried to install again this morning and am getting similar errors as before. The port seems to be there and active.

ghostscript @9.21_0+x11 (active)

However when I try to launch it, it fails

gs --version
dyld: Library not loaded: libgs.9.21.dylib
  Referenced from: /opt/local/bin/gs
  Reason: image not found
Abort trap: 6

I am attaching my session log. It shows the same messages about 2 files broken.

DEBUG: Marking /opt/local/bin/gsc as broken
DEBUG: Marking /opt/local/bin/gsx as broken
--->  Found 2 broken files, matching files to ports
--->  Found 1 broken port, determining rebuild order
DEBUG: Broken: ghostscript

comment:30 in reply to:  29 Changed 7 years ago by michaellass (Michael Lass)

Replying to fmw42:

I tried to install again this morning and am getting similar errors as before. The port seems to be there and active.

ghostscript @9.21_0+x11 (active)

That's still the old (unfixed) version. The fixed one is 9.21_1.

comment:31 Changed 7 years ago by fmw42 (Fred Weinhaus)

I simply used

 sudo port install ghostscript

And that is what it said it would install --- ghostscript @9.21_0+x11 (active)

The Macports web site only shows ghostscript 9.19, even though it installs 9.21

How do I tell it to install the updated one? Do I just do

sudo port install ghostscript @9.21_1+x11
Last edited 7 years ago by fmw42 (Fred Weinhaus) (previous) (diff)

comment:32 Changed 7 years ago by fmw42 (Fred Weinhaus)

I tried

sudo port install ghostscript @9.21_1+x11

But it is still installing 9.21_0+x11

comment:33 Changed 7 years ago by kencu (Ken)

Fred, what do you see with this

$ port info ghostscript

you should see this on the first line

ghostscript @9.21_1 (print)

if you don't see that, your ports must be outdated. do sudo port sync.

Ken

comment:34 Changed 7 years ago by nortcele

To install:

sudo port clean ghostscript
sudo port selfupdate
sudo port install ghostscript

comment:35 Changed 7 years ago by fmw42 (Fred Weinhaus)

I see

ghostscript @9.21

But I realized that I had forgotten to do

sudo port selfupdate

After doing that, it says

ghostscript @9.21_1

Then I did the install and it worked fine.

Thanks you all for the fast response to this bug and for the great help in suggestions just now to get over my ignorance in dealing with the fix. You guys are great!

Last edited 7 years ago by fmw42 (Fred Weinhaus) (previous) (diff)

comment:36 Changed 7 years ago by dyne2meter

Cc: dyne2meter removed
Note: See TracTickets for help on using tickets.