Opened 13 years ago

Closed 13 years ago

#32260 closed defect (fixed)

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

Reported by: brian@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: schwern@…, gary.verhaegen@…, kurtjaeke@…, jeremyhu (Jeremy Huddleston Sequoia)
Port: libpixman

Description (last modified by ryandesign (Ryan Carsten Schmidt))

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 (1)

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

Download all attachments as: .zip

Change History (10)

Changed 13 years ago by brian@…

Attachment: main.log added

comment:1 Changed 13 years ago by brian@…

Cc: brian@… added

Cc Me!

comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

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

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 13 years ago by schwern@…

Resolution: invalid
Status: closedreopened

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 Changed 13 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 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: schwern@… gary.verhaegen@… added; ryandesign@… removed
Owner: changed from macports-tickets@… to ryandesign@…
Status: reopenednew

Has duplicate #32929.

comment:6 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: kurtjaeke@… added

Has duplicate #33510.

comment:7 in reply to:  4 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

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 13 years ago by ryandesign (Ryan Carsten Schmidt)

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 13 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

In r90567 I added the patch to libpixman.

Note: See TracTickets for help on using tickets.