New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #32260 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

libpixman: libpng14.dylib, file was built for unsupported file format which is not the architecture being linked

Reported by: brian@… Owned by: ryandesign@…
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: schwern@…, gary.verhaegen@…, kurtjaeke@…, jeremyhu@…
Port: libpixman

Description (last modified by ryandesign@…) (diff)

I'm upgrading ports (port upgrade --enforce-variants gtk2 +universal) and I get the following error when it attempts to build libpixman.

--->  Building libpixman
Error: Target org.macports.build returned: shell command failed (see log for details)
Log for libpixman is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_libpixman/libpixman/main.log
Error: Unable to upgrade port: 1

Attachments

main.log (12.6 KB) - added by brian@… 2 years ago.

Change History

Changed 2 years ago by brian@…

comment:1 Changed 2 years ago by brian@…

  • Cc brian@… added

Cc Me!

comment:2 Changed 2 years ago by ryandesign@…

  • Status changed from new to closed
  • Description modified (diff)
  • Cc ryandesign@… added; brian@… removed
  • Summary changed from libpixman-0.24.0_0+universal.darwin_10.i386-x86_64 - shell command failed to libpixman: libpng14.dylib, file was built for unsupported file format which is not the architecture being linked
  • Resolution set to invalid
  • Port set to libpixman

Please remember to preview before submitting so you can ensure you got the WikiFormatting right, to fill in the Port field, and to Cc the maintainer of that port.

The log says:

:info:build ld: warning: in /opt/local/lib/libpng14.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

This means your libpng is not installed universal; reinstall it universal.

sudo port -n upgrade --force libpng +universal

If you need further help, write to the macports-users mailing list; there is no bug here.

comment:3 Changed 2 years ago by schwern@…

  • Status changed from closed to reopened
  • Resolution invalid deleted

I ran across this problem on StackOverflow and came to a different conclusion. libpixman depends on libpng but the port does not declare that dependency. It has no dependencies. This is a bug in and of itself. If it were fixed, I presume Macports could then rebuild libpng for 32 bit as needed rather than have the user manually rebuild.

comment:4 follow-up: ↓ 7 Changed 2 years ago by schwern@…

Upon further investigation it appears that libpng is an optional dependency of libpixman. libpixman itself will try to use it if it is installed, detected by autoconf. This is a problem as Macports doesn't appear to have a way to declare an optional dependency. This bug breaks automated +universal installs of any of libpixman's dependents, which leads all the way up to gtk2.

I can suggest a few of solutions. First is to just declare libpng as a dependency. Lots of stuff already depend on libpng, including cairo and gtk2, and it's pretty small.

Second is to include custom code in the libpixman portfile to rebuild libpng if necessary. At this point I wave my hands for lack of knowledge.

Finally, the libpixman portfile could pass in an option to configure to disable PNG support if it detects an unsuitable libpng install. This would probably require patching configure. Again, I must wave my hands.

comment:5 Changed 2 years ago by ryandesign@…

  • Owner changed from macports-tickets@… to ryandesign@…
  • Status changed from reopened to new
  • Cc schwern@…, gary.verhaegen@… added; ryandesign@… removed

Has duplicate #32929.

comment:6 Changed 2 years ago by ryandesign@…

  • Cc kurtjaeke@… added

Has duplicate #33510.

comment:7 in reply to: ↑ 4 Changed 2 years ago by ryandesign@…

  • Cc jeremyhu@… added

Replying to schwern@…:

Upon further investigation it appears that libpng is an optional dependency of libpixman. libpixman itself will try to use it if it is installed, detected by autoconf. This is a problem as Macports doesn't appear to have a way to declare an optional dependency. This bug breaks automated +universal installs of any of libpixman's dependents

Only if you don't already have libpng installed universal.

libpixman appears to use libpng to do some tests at build time, but does not need libpng at runtime time. A developer of libpixman confirmed libpixman will not behave any better at runtime if libpng is there:

On Feb 13, 2012, at 14:36, Søren Sandmann wrote:

> libpng is only used in the test and demo
> programs and doesn't improve pixman itself.

So I would prefer not to add a libpng dependency.

Finally, the libpixman portfile could pass in an option to configure to disable PNG support if it detects an unsuitable libpng install. This would probably require patching configure. Again, I must wave my hands.

Jeremy Huddleston implemented such a configure option, and sent a patch to me and the aforementioned libpixman developer by private email. The developer requested that the discussion be moved to the pixman mailing list, but I don't think that happened; I cannot find a discussion about this in the pixman mailing list archives in February or March.

comment:8 Changed 2 years ago by ryandesign@…

Jeremy's patch appears to have made it into libpixman after all. In r90566 I updated libpixman-devel to version 0.25.2 which includes it.

comment:9 Changed 2 years ago by ryandesign@…

  • Status changed from new to closed
  • Resolution set to fixed

In r90567 I added the patch to libpixman.

Note: See TracTickets for help on using tickets.