After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696730 - Compile failure with 1.14.0 due to extra arg in bitmap functions
Compile failure with 1.14.0 due to extra arg in bitmap functions
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: general
1.14.x
Other Mac OS
: Normal normal
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-03-27 20:21 UTC by Craig Hughes
Modified: 2013-04-04 15:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix broken build (1.22 KB, patch)
2013-03-27 20:21 UTC, Craig Hughes
reviewed Details | Review
quartz-image: Pass a CoglError argument to the bitmap functions (1.79 KB, patch)
2013-03-28 16:45 UTC, Neil Roberts
committed Details | Review
quartz-image: Pass -framework ApplicationServices in the linker flags (1000 bytes, patch)
2013-03-28 16:45 UTC, Neil Roberts
committed Details | Review

Description Craig Hughes 2013-03-27 20:21:36 UTC
Created attachment 239987 [details] [review]
Patch to fix broken build

Compilation fails with 1.14.0 using configure flags:

--enable-introspection=no --enable-gdk-pixbuf=no --enable-quartz-image=yes --without-x --enable-glx=no

This is because cogl-bitmap.c has added an "error" parameter to some functions, but that error parameter is not being passed in calls from cogl-bitmap-pixbuf.c

The attached patch passes a "NULL" for the error parameter (ie ignores errors).  Better would be to actually check for errors and do something appropriate probably...
Comment 1 Emmanuele Bassi (:ebassi) 2013-03-27 20:36:22 UTC
Review of attachment 239987 [details] [review]:

looks good to me.
Comment 2 Neil Roberts 2013-03-28 16:44:15 UTC
Thanks for the patch. I'm about to attach another version of the patch which propagates the error out of the function. I also ran into a problem while testing it where it wouldn't compile because the quartz image functions are unresolved. I'm attaching a second patch which addresses this. I'm not sure why no-one has complained about this before so I don't know if it's something specific with my setup.
Comment 3 Neil Roberts 2013-03-28 16:45:10 UTC
Created attachment 240069 [details] [review]
quartz-image: Pass a CoglError argument to the bitmap functions

Since 67cad9c0 and f7735e141a the bitmap allocation and mapping
functions now take an extra error argument. The quartz image backend
was missed in this update so Cogl would fail to compile if
--enable-quartz-image is used.
Comment 4 Neil Roberts 2013-03-28 16:45:13 UTC
Created attachment 240070 [details] [review]
quartz-image: Pass -framework ApplicationServices in the linker flags

The quartz image backend is using functions from the
ApplicationServices framework and I was getting linker errors if I
didn't use this option. I'm not sure how anyone managed to build it
before without this.
Comment 5 Craig Hughes 2013-03-28 17:08:54 UTC
I use --enable-quartz-backend but not --enable-quartz-image, so that's how I guess I missed your problem :)

I actually add all these to LDFLAGS to get cogl to link correctly:

-framework AppKit -framework CoreFoundation -framework CoreGraphics
Comment 6 Craig Hughes 2013-03-28 17:09:27 UTC
I'm sorry, ignore that part about no quartz image; I am using that :)
Comment 7 Craig Hughes 2013-03-28 17:13:20 UTC
Review of attachment 240069 [details] [review]:

That *partially* propagates the error out.  It'd probably be best to at least log the error with a g_warning or g_error.  Freeing the image is definitely a good thing to do :)
Comment 8 Craig Hughes 2013-03-28 17:16:21 UTC
Review of attachment 240070 [details] [review]:

Yes, this seems to work.  Does not need the other frameworks I specified if this one is included.
Comment 9 Neil Roberts 2013-03-28 18:02:03 UTC
(In reply to comment #7)

> That *partially* propagates the error out.  It'd probably be best to at least
> log the error with a g_warning or g_error.  Freeing the image is definitely a
> good thing to do :)

The error is passed up outside of _cogl_bitmap_from_file using the **error argument so it will be passed right out to the application. That way the application has an opportunity to recover from the error or it can print its own warning. The application can also pass in NULL for the error parameter which will cause it to print a warning and abort. I don't think there's any need to use g_warning directly here because that will be annoying for applications that can recover.
Comment 10 Craig Hughes 2013-03-28 18:10:39 UTC
Review of attachment 240069 [details] [review]:

Doh!  Never mind, this is why I shouldn't review bugs before my morning coffee.  I thought you'd created a local error instead of using one that was already passed in.
Comment 11 Robert Bragg 2013-04-04 14:35:29 UTC
Neil, these patches look good to land to me
Comment 12 Neil Roberts 2013-04-04 15:32:00 UTC
Thanks, I've pushed them to master and the cogl-1.14 branch.