Build failure: 'errno' undeclared. Missing an include?

Bug #920154 reported by Cafuego on 2012-01-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Critical
Alex Valavanis

Bug Description

I've started getting build failure reports from my daily autobuild scripts for Lucid, Natty, Maveric, Oneiric and Precise. It looks as util/units.cpp needs errno.h included.

  CXX util/units.o
util/units.cpp: In member function 'bool Inkscape::Util::UnitTable::loadText(const Glib::ustring&)':
util/units.cpp:148: error: 'errno' was not declared in this scope
util/units.cpp:216: error: 'errno' was not declared in this scope
util/units.cpp: In member function 'bool Inkscape::Util::UnitTable::save(const Glib::ustring&)':
util/units.cpp:244: error: 'errno' was not declared in this scope
util/units.cpp:263: error: 'errno' was not declared in this scope
make[4]: *** [util/units.o] Error 1
make[4]: Leaving directory `/build/buildd/inkscape-0.49~devel+10918+6~lucid1/src'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/build/buildd/inkscape-0.49~devel+10918+6~lucid1/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/build/buildd/inkscape-0.49~devel+10918+6~lucid1'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/build/buildd/inkscape-0.49~devel+10918+6~lucid1'
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Build logs:

https://launchpad.net/~cafuego/+archive/inkscape/+build/3113028/+files/buildlog_ubuntu-lucid-i386.inkscape_0.49~devel%2B10918%2B6~lucid1_FAILEDTOBUILD.txt.gz
https://launchpad.net/~cafuego/+archive/inkscape/+build/3113029/+files/buildlog_ubuntu-maverick-amd64.inkscape_0.49~devel%2B10918%2B6~maverick1_FAILEDTOBUILD.txt.gz
https://launchpad.net/~cafuego/+archive/inkscape/+build/3113043/+files/buildlog_ubuntu-natty-i386.inkscape_0.49~devel%2B10918%2B6~natty1_FAILEDTOBUILD.txt.gz
https://launchpad.net/~cafuego/+archive/inkscape/+build/3113044/+files/buildlog_ubuntu-oneiric-amd64.inkscape_0.49~devel%2B10918%2B6~oneiric1_FAILEDTOBUILD.txt.gz
https://launchpad.net/~cafuego/+archive/inkscape/+build/3113059/+files/buildlog_ubuntu-precise-amd64.inkscape_0.49~devel%2B10918%2B6~precise1_FAILEDTOBUILD.txt.gz

Cafuego (cafuego) on 2012-01-22
description: updated
Cafuego (cafuego) on 2012-01-22
description: updated
su_v (suv-lp) on 2012-01-22
tags: added: build
Alex Valavanis (valavanisalex) wrote :

Yep, Confirmed in lp:inkscape r10918. Error was introduced in r10917, I think.[1] Fix on its way...

[1] http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/10917

Changed in inkscape:
assignee: nobody → Alex Valavanis (valavanisalex)
importance: Undecided → Critical
status: New → In Progress
su_v (suv-lp) wrote :

@Alex - sorry for the change of status, we commented at the same time ;)

Changed in inkscape:
assignee: Alex Valavanis (valavanisalex) → nobody
importance: Critical → High
status: In Progress → New
importance: High → Critical
assignee: nobody → Alex Valavanis (valavanisalex)
status: New → In Progress
Alex Valavanis (valavanisalex) wrote :

Fixed in lp:inkscape r10919

Changed in inkscape:
status: In Progress → Fix Committed
status: Fix Committed → Fix Released
su_v (suv-lp) wrote :

@Alex - the other change in r10919 breaks building on Lucid (i.e. with GTK 2.20):
gtk_message_dialog_get_message_area() exists only since gtk 2.22
<http://developer.gnome.org/gtk/2.24/GtkMessageDialog.html#gtk-message-dialog-get-message-area>

Build failure:

  CXX widgets/desktop-widget.o
widgets/desktop-widget.cpp: In member function 'bool SPDesktopWidget::shutdown()':
widgets/desktop-widget.cpp:899: error: 'gtk_message_dialog_get_message_area' was not declared in this scope
make[4]: *** [widgets/desktop-widget.o] Error 1
make[4]: Leaving directory `/build/buildd/inkscape-0.49~devel+10919+6~lucid1/src'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/build/buildd/inkscape-0.49~devel+10919+6~lucid1/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/build/buildd/inkscape-0.49~devel+10919+6~lucid1'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/build/buildd/inkscape-0.49~devel+10919+6~lucid1'
make: *** [build] Error 2

<https://launchpad.net/~cafuego/+archive/inkscape/+build/3113279>

Kris (kris-degussem) wrote :

I'm sorry for the issues with cerrno.
I sometimes encounter header includes that are not necessary anymore and so I drop them.
I verified building on windows with btool and it build without an issue ... maybe it is good not to do anything for a while :(

Alex Valavanis (valavanisalex) wrote :

@~suv: Oops... I didn't mean to commit that other change! Reverted in r10920.

su_v (suv-lp) wrote :

Kris wrote:
> (…) maybe it is good not to do anything for a while :(

No, that would be an overreaction IMHO ;)
The issue was easily and quickly solved (thx Alex!), and didn't affect _all_ non-windows build platforms (AFAIU it seems to depend on include policies of certain GCC versions and / or system configs - r10917 and later revisions built equally well (without failure) with an older version of GCC on osx).

@Alex - is there a page summarizing such requirements for include files, e.g. for Ubuntu?

Alex Valavanis (valavanisalex) wrote :

@Kris - I think the code cleanup work is really important... I think most people will happily accept a few easily-corrected build errors in the development trunk as the price of long-term maintainability/stable API compatibility. I've introduced several build errors during my recent GSEAL/Gtk3 hacking, so you're not alone! At worst, it's a case of a bzr revert.

@~suv - I had a very quick check for changes relating to errno.h in the libstdc++ documentation, but couldn't find anything. I guess it's safest to assume that we can't rely on "errno" being defined in any header except for errno.h itself.

ScislaC (scislac) wrote :

Kris: I just want to add a third comment saying please don't let this deter you. You're fighting the good fight and honestly, I can't think of any developer with the project who didn't at least once break compilation on another platform (it's not uncommon to tell you the truth).

Cafuego (cafuego) wrote :

Happily building again (on Lucid) as of at least r10915, thanks Alex!

@Kris: Don't stop working just because different build environments make different assumptions. The problem was found and fixed, which is precisely right. Thanks for helping to make Inkscape better :-)

Cafuego (cafuego) wrote :

Ugh, read my apt line wrong ... working as of r10920.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers