Opened 6 years ago

Closed 6 years ago

#58412 closed defect (fixed)

gexiv2 @0.10.9 +python27+python36: Failed to build -- possible type error 'Error'/'GError' in namespace 'Exiv2'

Reported by: willpush (Will Coulter) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: willpush (Will Coulter), Russell-Jones-OxPhys (Russell Jones), majoc-at-astro (majoc-at-astro), Blokkendoos (Johan)
Port: gexiv2

Description

I cannot build gimp-app due to gexiv2 not building.

I tried all of:

# port clean gexiv2
# port clean --dist gexiv2
# port clean rdepof:gexiv2

But to no avail. It looks like there is an error in the type definitions that keeps recurring. main.log is attached.

Here is a typical error:

:info:build gexiv2/gexiv2-metadata-exif.cpp:114:14: error: no type named 'Error' in namespace 'Exiv2'; did you mean 'GError'?
:info:build     } catch (Exiv2::Error& e) {
:info:build              ^~~~~~~~~~~~
:info:build              GError
:info:build /opt/local/include/glib-2.0/glib/gerror.h:41:24: note: 'GError' declared here
:info:build typedef struct _GError GError;
:info:build                        ^

I'm on Mojave (10.14.4).

Attachments (3)

main.log (50.0 KB) - added by willpush (Will Coulter) 6 years ago.
build log
main.2.log (188.7 KB) - added by ballen4705 6 years ago.
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gnome_gexiv2/gexiv2/main.log
patch-gexiv2-Portfile.diff (1.9 KB) - added by kencu (Ken) 6 years ago.
new patch that changes the version to 3.0.0

Download all attachments as: .zip

Change History (32)

Changed 6 years ago by willpush (Will Coulter)

Attachment: main.log added

build log

comment:1 Changed 6 years ago by kencu (Ken)

gexiv2 has been updated to 0.12.0 upstream, I note...

comment:2 Changed 6 years ago by kencu (Ken)

Something's not right with the meson build though. The new gexiv2's library has an older compatibility version somehow, and everything fails in the rev-upgrade.

$ sudo port activate gexiv2
The following versions of gexiv2 are currently installed:
 1) gexiv2 @0.10.9_1+python27+python36
 2) gexiv2 @0.12.0_0+python27+python36 (active)
Enter a number to select an option: 1
--->  Deactivating gexiv2 @0.12.0_0+python27+python36
--->  Cleaning gexiv2
--->  Activating gexiv2 @0.10.9_1+python27+python36

$ otool -L /opt/local/lib/libgexiv2.2.dylib
/opt/local/lib/libgexiv2.2.dylib:
	/opt/local/lib/libgexiv2.2.dylib (compatibility version 3.0.0, current version 3.0.0)

$ sudo port activate gexiv2
The following versions of gexiv2 are currently installed:
 1) gexiv2 @0.10.9_1+python27+python36 (active)
 2) gexiv2 @0.12.0_0+python27+python36
Enter a number to select an option: 2
--->  Deactivating gexiv2 @0.10.9_1+python27+python36
--->  Cleaning gexiv2
--->  Activating gexiv2 @0.12.0_0+python27+python36

$ otool -L /opt/local/lib/libgexiv2.2.dylib
/opt/local/lib/libgexiv2.2.dylib:
	/opt/local/lib/libgexiv2.2.dylib (compatibility version 2.0.0, current version 2.0.0)

comment:3 Changed 6 years ago by kencu (Ken)

There's a possible Portfile diff, but the compatibility version 3.0.0 vs 2.0.0 issue needs to be pondered.

It should be 2.0.0? In which case everything that links against it will need a revbump -- which may be needed anyway, I guess...

Leave this for Dave to consider...

comment:4 Changed 6 years ago by jmroot (Joshua Root)

It's upstream's responsibility to version the libs correctly. They may need to be educated about what the Mach-O version fields mean (the current version getting smaller is also wrong BTW). If the soname has not changed then I doubt they meant to break backward compatibility.

comment:5 Changed 6 years ago by willpush (Will Coulter)

Cc: willpush added

comment:6 Changed 6 years ago by kencu (Ken)

I suspect the previous release's 3.0.0 versioning was wrong, but now that's out in the wild, so can't fix it. Have to move ahead...

comment:7 Changed 6 years ago by jmroot (Joshua Root)

There are no "wrong" current/compatibility versions except ones that don't increase when they should. They don't need to have any relation to the version number of the software; the current version just needs to go up whenever any change is made, and the compatibility version just needs to increase to match the current version whenever new symbols are added.

comment:8 Changed 6 years ago by ballen4705

I just wanted to comment that I am seeing the same problem on my Macports installation on MacOS 10.3.16. gexiv2/main.log shows an identical error, "no type named 'Error' in namespace 'Exiv2'; did you mean 'GError'?"

Last edited 6 years ago by ballen4705 (previous) (diff)

comment:9 Changed 6 years ago by fgdb (Fico)

I got to the same problem installing gimp2 (MacPorts 2.5.4, Mojave 10.4.4, Xcode 10.2.1 Build version 10E1001)

First: gexiv2 @0.12.0_0+python27+python36 (patch https://trac.macports.org/attachment/ticket/58412/patch-gexiv2-Portfile.diff worked)

Last one: gegl-0.4 @0.4.14 +x11 Stuck here.

comment:10 Changed 6 years ago by Russell-Jones-OxPhys (Russell Jones)

Cc: Russell-Jones-OxPhys added

comment:11 Changed 6 years ago by majoc-at-astro (majoc-at-astro)

Cc: majoc-at-astro added

comment:12 Changed 6 years ago by kencu (Ken)

We just need to decide if we're going to hack in a new version number to the gexiv2 source to 3.0.0, and hope that upstream will change it to that (this is the right thing to do) -- or if we're going to leave it at 2.0.0 and rebuild everything against that new lower version number (which is not the right thing to do, but upstream is in charge). And this is Dave's port, so it's his call.

For anyone who is desperate for this right now, use the patch I added above to get started, and hack the version to 3.0.0 while it gets sorted out.

comment:13 Changed 6 years ago by willpush (Will Coulter)

For people who are as rusty as I am with patching, here's what I did.

First, get the diff file as unified (there is a little link at the bottom of the page) and then apply it, although you might want to do this not as root:

$ cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/gnome/gexiv2
$ sudo patch < patch-gexiv2-Portfile.diff

I had to install meson before gexiv2:

$ sudo port install meson
$ sudo port install gexiv2

I am now compiling gimp2, which I hope will work!

@fgbd: I had gegl-0.4 @0.4.14_0+x11 installed already, so not sure what to say there. Maybe remove gexiv2 and try gegl first?

comment:14 in reply to:  13 Changed 6 years ago by willpush (Will Coulter)

Replying to willpush:

I am now compiling gimp2, which I hope will work!

@fgbd: I had gegl-0.4 @0.4.14_0+x11 installed already, so not sure what to say there. Maybe remove gexiv2 and try gegl first?

FYI, I tried getting an old rrdtool @1.5.5_1 version to get ntop and now I'm stuck on port rev-upgrade too. At least I got past the installs ... :-/

comment:15 Changed 6 years ago by fgdb (Fico)

I confirm gimp2 compiled and running. Though, port rev-upgrade still tries to rebuild gegl-0.4 @0.4.14_0+x11 and fails on the reason of this ticket.

Changed 6 years ago by ballen4705

Attachment: main.2.log added

/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gnome_gexiv2/gexiv2/main.log

comment:16 Changed 6 years ago by ballen4705

I followed the instructions from willpush (Will Coulter)

(a) Downloaded patch from https://trac.macports.org/attachment/ticket/58412/patch-gexiv2-Portfile.diff

(b) Applied patch:

cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/gnome/gexiv2
sudo patch < patch-gexiv2-Portfile.diff

The patch applied cleanly

(c) Installed meson and tried to reinstall gexiv2:

sudo port install meson
sudo port install gexiv2

This failed with

--->  Building gexiv2
Error: Failed to build gexiv2: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gnome_gexiv2/gexiv2/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gexiv2 failed

I have attached the main.log file just above this comment. The error message in main.log is a different one than before, concerning a library incompatibility. I am not sure if this is a local issue or more general problem, and would be grateful for any advice.

comment:17 Changed 6 years ago by ballen4705

The problem I reported above was most likely "local" because a library version for exiv which was expected to be there did not exist. I did a simple "hack" solution by creating a symbolic link for the desired library version which points to the current library version. Fortunately the symbol tables are compatible, so for me the problem is now "fixed". The command I used is below, in case others come across this issue.

sudo ln -s /opt/local/lib/libexiv2.dylib  /opt/local/lib/libexiv2.26.dylib

So I am currently stuck at the same point as fgdb was stuck four days ago, with: gegl-0.4 @0.4.14 +x11.

Last edited 6 years ago by ballen4705 (previous) (diff)

comment:18 in reply to:  17 Changed 6 years ago by willpush (Will Coulter)

Replying to ballen4705:

The problem I reported above was most likely "local" because a library version for exiv which was expected to be there did not exist.

Probably true ... I have such a link (to 2.27). So we're all at the same point...

comment:19 Changed 6 years ago by Blokkendoos (Johan)

Cc: Blokkendoos added

comment:20 Changed 6 years ago by ballen4705

The problem I am now seeing is the following:

--->  Configuring gimp2
--->  Building gimp2
Error: Failed to build gimp2: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_gimp2/gimp2/main.log for details.

From gimp2/main.log:

:info:build     ../../tools/invert-svg ../../icons/Symbolic/24/gimp-wilber.svg 24/gimp-wilber.svg
:info:build mkdir -p `dirname 64/gimp-error.png`; GEGL_USE_OPENCL=no GEGL_SWAP=ram /opt/local/bin/gegl-0.4 ../../icons/Symbolic/64/gimp-error.png -o 64/gimp-error.png -- gegl:invert-gamma
:info:build dyld: Library not loaded: /opt/local/lib/libgexiv2.2.dylib
:info:build   Referenced from: /opt/local/bin/gegl-0.4
:info:build   Reason: Incompatible library version: gegl-0.4 requires version 3.0.0 or later, but libgexiv2.2.dylib provides version 2.0.0

Is there a simple way to modify libgexiv2.2.dylib so that it will internally say that it supports 3.0.0? If so I would be grateful for instructions about how to do this.

comment:21 Changed 6 years ago by ballen4705

OK, after looking above I saw that there is a simple solution. This worked on my system, so I can now move on again.

sudo port activate gexiv2

The following versions of gexiv2 are currently installed:
 1) gexiv2 @0.10.8_1+python27+python36
 2) gexiv2 @0.12.0_0+python27+python36 (active)

Enter a number to select an option: 1

--->  Deactivating gexiv2 @0.12.0_0+python27+python36
--->  Cleaning gexiv2
--->  Activating gexiv2 @0.10.8_1+python27+python36

sudo port install gimp2

comment:22 Changed 6 years ago by kencu (Ken)

Ping to Dave... what would you like to do here? Patching the version takes 2 seconds...

comment:23 Changed 6 years ago by ballen4705

I would be grateful if you could patch the version. My port upgrade stalled again due to exiv2 problems with:

--->  Computing dependencies for ufraw
--->  Building ufraw
Error: Failed to build ufraw: command execution failed

Again this was due to namespace/version conflicts. Here is the first error from ufraw/main.log:

:info:build make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_ufraw/ufraw/work/ufraw-0.22'
:info:build   CXX      ufraw_exiv2.o
:info:build ufraw_exiv2.cc:47:37: error: no member named 'cerr' in namespace 'std'
:info:build     std::streambuf *savecerr = std::cerr.rdbuf();
:info:build                                ~~~~~^
:info:build ufraw_exiv2.cc:48:10: error: no member named 'cerr' in namespace 'std'
:info:build     std::cerr.rdbuf(stderror.rdbuf());

comment:24 Changed 6 years ago by kencu (Ken)

I sent an email to Dave about gexiv2. This most recent error in comment23 might be something different, though.

comment:25 Changed 6 years ago by ballen4705

Thanks. I am fairly confident that the problem in #23 is related (it's from exiv2 which is wrapped by gexiv2). Yes, it might arise because I have been trying to hack a workaround, but fundamentally it's arising from the original gexiv2 versioning issue.

comment:26 Changed 6 years ago by kencu (Ken)

has duplicate 58463

comment:27 Changed 6 years ago by kencu (Ken)

versioning fix:

post-extract {
    reinplace "s|2\.0\.0|3\.0\.0|g" gexiv2/meson.build
}

Changed 6 years ago by kencu (Ken)

Attachment: patch-gexiv2-Portfile.diff added

new patch that changes the version to 3.0.0

comment:28 Changed 6 years ago by kencu (Ken)

you can use this patch if you like, while waiting for Dave. It works, but two ports, including gimp, will rebuild. Up to you.

comment:29 Changed 6 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.