Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#54886 closed defect (fixed)

inkscape @0.92.2: error: call to 'abs' is ambiguous

Reported by: tempesti0n1c Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.4.1
Keywords: highsierra sierra xcode9 Cc: EdHarry, ichbindannmalwegmann (Roger Wegmann), randymortensen (Randy Mortensen), MaddTheSane (C.W. Betts), michaellass (Michael Lass), sircrimer, caballerofelipe (Felipe Caballero), jjstickel (Jonathan Stickel), majoc-at-astro (majoc-at-astro), maehne (Torsten Maehne), bakertlh
Port: inkscape

Description

Trying to install inkscape 0.92.2_0 and it wont complete. main.log attached.

Attachments (2)

main.log (1.2 MB) - added by tempesti0n1c 7 years ago.
main high sierra.log (1.3 MB) - added by tempesti0n1c 7 years ago.

Change History (24)

Changed 7 years ago by tempesti0n1c

Attachment: main.log added

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

Owner: set to dbevans
Port: inkscape added; Inkscape removed
Status: newassigned
Summary: Inkscape failed to build on macOS 10.12.6inkscape @0.92.2: error: call to 'abs' is ambiguous

comment:2 Changed 7 years ago by EdHarry

Cc: EdHarry added

comment:3 Changed 7 years ago by ichbindannmalwegmann (Roger Wegmann)

Cc: ichbindannmalwegmann added

comment:4 Changed 7 years ago by ichbindannmalwegmann (Roger Wegmann)

Cc: ichbindannmalwegmann removed

comment:5 Changed 7 years ago by ichbindannmalwegmann (Roger Wegmann)

Cc: ichbindannmalwegmann added

comment:6 Changed 7 years ago by randymortensen (Randy Mortensen)

Cc: randymortensen added

comment:7 Changed 7 years ago by MaddTheSane (C.W. Betts)

Cc: MaddTheSane added

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

Cc: michaellass added

comment:9 Changed 7 years ago by sircrimer

Cc: sircrimer added

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

Looks like id.objID is not of any of the types for which abs() is defined. So genuinely invalid code according to strict C++ rules. Probably just needs a cast to an appropriate type.

Changed 7 years ago by tempesti0n1c

Attachment: main high sierra.log added

comment:11 Changed 7 years ago by tempesti0n1c

main.log of build failure on High Sierra attached, in case it's helpful

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

Indeed, i->pathNext->id.objID is of type unsigned int, for which abs() does not make much sense. Replacing the line by the following should fix the issue and keep the code functional:

COLA_ASSERT(abs((int)i->pathNext->id.objID - (int)i->id.objID) != 2);

If nobody is quicker than me, I will report this upstream and add a corresponding patch to the Portfile.

comment:13 Changed 7 years ago by danchr (Dan Villiom Podlaski Christiansen)

The port isn't openmaintainer, so I posted a PR: https://github.com/macports/macports-ports/pull/895

comment:14 Changed 7 years ago by raimue (Rainer Müller)

Keywords: highsierra sierra xcode9 added

I can reproduce the problem also on macOS 10.12 with Xcode 9. The patch needs to be applied unconditionally.

comment:15 Changed 7 years ago by abgandar (Alexander Wittig)

Just for reference: the same problem also appears in the FreeBSD port for Inkscape (1). Their patch (2) is more or less the same as comment:12 and comment:13 propose.

(1) https://lists.freebsd.org/pipermail/freebsd-gnome/2016-June/034288.html
(2) https://svnweb.freebsd.org/ports/head/graphics/inkscape/files/patch-src_libavoid_connector.cpp?revision=416493&view=markup

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

Cc: caballerofelipe added

Has duplicate #55069.

comment:17 Changed 7 years ago by jjstickel (Jonathan Stickel)

Cc: jjstickel added

comment:18 Changed 7 years ago by majoc-at-astro (majoc-at-astro)

Cc: majoc-at-astro added

comment:19 Changed 7 years ago by maehne (Torsten Maehne)

Cc: maehne added

comment:20 Changed 7 years ago by danchr (Dan Villiom Podlaski Christiansen)

Resolution: fixed
Status: assignedclosed

In 542661ba214f200c67ac40814b3ead3199c94f46/macports-ports:

inkscape: fix build in High Sierra (maintainer timeout)

The current version of Inkscape fails with a build error due to an
ambigious call to abs(). Indeed, i->pathNext->id.objID is of type
unsigned int, for which abs() does not make much sense. Adding a cast
to 'long' fixes it.

The root cause of the bug is likely that the code isn't strictly valid
C++, and so the version of Clang included with Xcode 9 rejects it,
where earlier versions of Clang accepted it. Since this is a build
fix, we don't bump the revision.

PR submitted two weeks ago, but the maintainer didn't respond.

(Based on suggestion by Michael Lass)

Fixes: #54886

comment:21 Changed 7 years ago by danchr (Dan Villiom Podlaski Christiansen)

In 542661ba214f200c67ac40814b3ead3199c94f46/macports-ports:

inkscape: fix build in High Sierra (maintainer timeout)

The current version of Inkscape fails with a build error due to an
ambigious call to abs(). Indeed, i->pathNext->id.objID is of type
unsigned int, for which abs() does not make much sense. Adding a cast
to 'long' fixes it.

The root cause of the bug is likely that the code isn't strictly valid
C++, and so the version of Clang included with Xcode 9 rejects it,
where earlier versions of Clang accepted it. Since this is a build
fix, we don't bump the revision.

PR submitted two weeks ago, but the maintainer didn't respond.

(Based on suggestion by Michael Lass)

Fixes: #54886

comment:22 Changed 7 years ago by bakertlh

Cc: bakertlh added
Note: See TracTickets for help on using tickets.