Opened 8 weeks ago

Closed 8 weeks ago

Last modified 8 weeks ago

#60500 closed defect (fixed)

freetype @2.10.2_0 opportunistically uses brotli

Reported by: thetrial (alabay) Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc:
Port: freetype

Description

The build failed today; an excerpt from the ending of the log:

:info:build ld: warning: ignoring file /opt/local/lib/libbrotlidec.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libbrotlidec.dylib
:info:build Undefined symbols for architecture i386:
:info:build   "_BrotliDecoderDecompress", referenced from:
:info:build       _sfnt_open_font in sfnt.o
:info:build ld: symbol(s) not found for architecture i386
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make: *** [/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_print_freetype/freetype/work/freetype-2.10.2-i386/objs/libfreetype.la] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_print_freetype/freetype/work/freetype-2.10.2-i386'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_print_freetype/freetype/work/freetype-2.10.2-i386" && /usr/bin/make -j4 -w all 
:info:build Exit code: 2
:error:build Failed to build freetype: command execution failed
:debug:build Error code: NONE
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "$procedure $targetname"

Change History (5)

comment:1 Changed 8 weeks ago by JDLH (Jim DeLaHunt)

I just encountered the same error, building on macOS 10.13.6 High Sierra with MacPorts 2.6.2.

My log file has the same crucial line, "ignoring file /opt/local/lib/libbrotlidec.dylib, file was built for x86_64 which is not the architecture being linked (i386)".

comment:2 Changed 8 weeks ago by thetrial (alabay)

I tried some things:

First I forcibly deinstalled freetype.

MP told me: that following ports will break: fontconfig @2.13.1_0, cairo @1.16.0_0, Xft2 @2.3.3_0, libbluray @1.1.2_0, graphviz @2.40.1_2, qt511-qtbase @5.11.3_4, harfbuzz @2.6.4_0, ffmpeg @4.2.2_0, gd2 @2.3.0_0, webkit2-gtk @2.26.2_1 and wine-devel @4.9_0.

Then I cleaned freetype. After that I reinstalled freetype. That worked.

Then following ports wanted to get rebuilt: fontconfig @2.13.1+universal, cairo @1.16.0+quartz+universal+x11, harfbuzz @2.6.4+universal, Xft2 @2.3.3+universal, pango @1.42.4+quartz+universal+x11 and gtk3 @3.24.20+universal+x11.

Then it started again attempting to fetch freetype-2.10.2_0+universal.darwin_15.i386-x86_64.tbz2 – of course, I had again an Error: Failed to build freetype: command execution failed, several times.

I then tried the trace-mode. That worked with following remarks:

Warning: The following existing files were hidden from the build system by trace mode:
  /opt/local/bin/gmkdir
  /opt/local/lib/pkgconfig/libbrotlidec.pc
Warning: The following files inside the MacPorts prefix not installed by a port were accessed:
  /opt/local/bin/python
  /opt/local/bin/python3
--->  Building freetype
Warning: The following existing file was hidden from the build system by trace mode:
  /opt/local/include/brotli/decode.h

This point makes mey quite wonder: The following files inside the MacPorts prefix not installed by a port.

Well, now my installation seems to work. But this is not a clean way, I guess.

comment:3 Changed 8 weeks ago by ryandesign (Ryan Schmidt)

Keywords: legacy-os elcapitan i386 removed
Status: assignedaccepted
Summary: freetype @ 2.10.2_0+universal.darwin_15.i386-x86_64: Failed to build (El Capitan)freetype @2.10.2_0 opportunistically uses brotli

I didn't realize it when I updated the port, but freetype 2.10.2 introduced optional support for WOFF2 fonts using the brotli library. If you happen to have brotli installed, freetype will use it. If you are trying to build freetype universal but happen to have brotli installed non-universal at the time, that won't work and will result in the errors being reported here. The workarounds are:

  1. reinstall brotli with the +universal variant first (sudo port install brotli +universal), or
  2. uninstall brotli (sudo port uninstall brotli), or
  3. install freetype with trace mode (sudo port clean freetype && sudo port -t install freetype)

I'll resolve the issue either by adding the brotli dependency to freetype or by making it an optional variant; I haven't decided yet.

comment:4 Changed 8 weeks ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: acceptedclosed

In 6821f1020aad1cc44a6e38672a8d2c5def928121/macports-ports (master):

freetype: Use brotli library

This enables support for WOFF2 fonts.

Closes: #60500

comment:5 Changed 8 weeks ago by JDLH (Jim DeLaHunt)

Wow, that was fast! This change succeeded for me, building freetype @2.10.2_1+universal on macOS 10.13.6 High Sierra with MacPorts 2.6.2. Thank you!

Note: See TracTickets for help on using tickets.