Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#18232 closed defect (fixed)

freetype build fails if flow-tools is active

Reported by: fantunes@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: Cc: peter@…, atomist@…, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: freetype

Description (last modified by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez))

--->  Fetching freetype
--->  Verifying checksum(s) for freetype
--->  Extracting freetype
--->  Applying patches to freetype
--->  Configuring freetype
--->  Building freetype
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_print_freetype/work/freetype-2.3.8" && make all " returned error 2
Command output: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_print_freetype/work/freetype-2.3.8/include/freetype/internal/ftstream.h:488: error: syntax error before 'FT_Stream_ReadFields'
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_print_freetype/work/freetype-2.3.8/include/freetype/internal/ftstream.h:490: warning: data definition has no type or storage class
builds/unix/ftsystem.c:97: error: syntax error before 'ft_alloc'
builds/unix/ftsystem.c: In function 'ft_alloc':
builds/unix/ftsystem.c:102: warning: return makes integer from pointer without a cast
builds/unix/ftsystem.c: At top level:
builds/unix/ftsystem.c:127: error: syntax error before 'ft_realloc'
builds/unix/ftsystem.c: In function 'ft_realloc':
builds/unix/ftsystem.c:135: warning: return makes integer from pointer without a cast
builds/unix/ftsystem.c: At top level:
builds/unix/ftsystem.c:153: error: syntax error before 'ft_free'
builds/unix/ftsystem.c:195: error: syntax error before 'ft_close_stream_by_munmap'
builds/unix/ftsystem.c:217: error: syntax error before 'ft_close_stream_by_free'
builds/unix/ftsystem.c:230: error: syntax error before 'FT_Stream_Open'
builds/unix/ftsystem.c: In function 'FT_Stream_Open':
builds/unix/ftsystem.c:278: error: 'LONG_MAX' undeclared (first use in this function)
builds/unix/ftsystem.c:278: error: (Each undeclared identifier is reported only once
builds/unix/ftsystem.c:278: error: for each function it appears in.)
builds/unix/ftsystem.c:301: warning: assignment from incompatible pointer type
builds/unix/ftsystem.c:342: warning: assignment from incompatible pointer type
builds/unix/ftsystem.c: At top level:
builds/unix/ftsystem.c:386: error: syntax error before 'FT_New_Memory'
builds/unix/ftsystem.c: In function 'FT_New_Memory':
builds/unix/ftsystem.c:395: warning: assignment from incompatible pointer type
builds/unix/ftsystem.c:396: warning: assignment from incompatible pointer type
builds/unix/ftsystem.c:397: warning: assignment from incompatible pointer type
builds/unix/ftsystem.c:403: warning: return makes integer from pointer without a cast
builds/unix/ftsystem.c: At top level:
builds/unix/ftsystem.c:410: error: syntax error before 'FT_Done_Memory'
make: *** [/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_print_freetype/work/freetype-2.3.8/objs/ftsystem.lo] Error 1

Error: Status 1 encountered during processing.

Attachments (7)

freetype.txt (86.4 KB) - added by fantunes@… 15 years ago.
Debugging freetype
freetype.2.txt (86.4 KB) - added by peter@… 15 years ago.
debug freetype on intel 10.5.6
freetype.txt.diff (267 bytes) - added by peter@… 15 years ago.
usr_local_find.txt (451.4 KB) - added by atomist@… 15 years ago.
My content of /usr/local
freetype_fail.txt (86.6 KB) - added by atomist@… 15 years ago.
My port installation log of freetype failing.
freetype_script.txt (90.0 KB) - added by atomist@… 15 years ago.
File is in script format. Renamed local to local-off, cleaned freetype and still failed.
Portfile.diff (662 bytes) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 15 years ago.

Download all attachments as: .zip

Change History (40)

comment:1 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Description: modified (diff)
Owner: changed from macports-tickets@… to ryandesign@…

Please use WikiFormatting for command output.

Assigning to maintainer.

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

Port: freetype added

Duplicate of #17381. I believe you have something in /usr/local which is interfering with the freetype build. If you can identify what specifically in /usr/local is causing this problem and let me know, then I can perhaps do something in the Portfile to better alert users to this danger. Or, if you can attach the full debug output, maybe I can deduce it from that. To get the debug output:

sudo port clean freetype
sudo port -d install freetype 2>&1 | tee ~/Desktop/freetype.txt

Then attach freetype.txt from your desktop to this ticket.

Changed 15 years ago by fantunes@…

Attachment: freetype.txt added

Debugging freetype

comment:3 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Priority: HighNormal

Your output looks very similar to mine, up to the point where it fails, so unfortunately it's not helping me figure out why it's failing for you when it works for me. What did you find out about your /usr/local? What is in it?

Changed 15 years ago by peter@…

Attachment: freetype.2.txt added

debug freetype on intel 10.5.6

comment:4 Changed 15 years ago by peter@…

Experienced same error on 10.5.6 MacPorts 1.700 when installing freetype @2.3.8 with and without bytecode variant.

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

Cc: peter@… added

Replying to peter@…:

Experienced same error on 10.5.6 MacPorts 1.700 when installing freetype @2.3.8 with and without bytecode variant.

And what is in your /usr/local? So far, all I know about this issue is that I believe something in /usr/local interferes with FreeType. The solution is to rename or delete /usr/local. It is not supported to have things in /usr/local while using MacPorts. The best I can do for the freetype port is to add a warning if the specific interfering file is detected. But I can't add that until I know what the interfering file is.

comment:6 Changed 15 years ago by peter@…

There was content in /usr/local. Apologies for not being aware of an empty /usr/local requirement for MacPorts use. I removed the content from /usr/local and attempted to install and received the same error, error diff attached.

Changed 15 years ago by peter@…

Attachment: freetype.txt.diff added

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

I don't think that diff is relevant, and I think you reversed the order of the files. It describes changes around line 15 of your output, which is about the zlib dependency. The zlib port used to use the default universal variant but switched to the muniversal portgroup in r46770. So I presume you synced between last try and this one. The universal variant is not relevant unless you are building universal, and even then it shouldn't matter because zlib should have built properly with either universal variant.

Did you clean freetype before trying again?

sudo port clean freetype

If that now works, then I would still be interested to know what was in /usr/local.

comment:8 Changed 15 years ago by peter@…

Yes I ran clean. I ran clean, ran install and noticed the lines which seemed to be an odd difference so synced, ran clean, ran install and the same diff was produced. I think and agree that the diff is not relevant it is attached for your convenience and to demonstrate that there was little difference between the output with an empty and a non-empty /usr/local.

comment:9 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Ok, what about Xcode version? Are you up to 3.1.2 or still on 3.0?

comment:10 Changed 15 years ago by peter@…

I was using Xcode 3.1.1. I just upgraded to 3.1.2, ran clean, ran install. No change in output.

Changed 15 years ago by atomist@…

Attachment: usr_local_find.txt added

My content of /usr/local

Changed 15 years ago by atomist@…

Attachment: freetype_fail.txt added

My port installation log of freetype failing.

comment:11 Changed 15 years ago by atomist@…

Hey

I'm getting the exact same error. (See attached files). I upgraded to Xcode 3.1.2 from 3.1.1.

I don't think I can remove stuff from /use/local as my mysql is there. I already removed graphviz that seemed to have something freetype related in it but nogo.

I have a bunch of upgrades that are hanging in the queue because of this.

Thanks.

comment:12 Changed 15 years ago by atomist@…

Cc: atomist@… added

Cc Me!

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

If you refer to the MySQL binary provided at mysql.com, then that is not a problem and will not interfere because as I recall it installs into /usr/local/mysql-${version} -- a subdirectory of /usr/local. It is only software that installs directly into /usr/local (puts libraries into /usr/local/lib and headers into /usr/local/include and so on) that can be a problem.

Unfortunately, neither I nor the developers of freetype have the faintest idea why this error is occurring for some people. If you gain any insight into the issue, please let us know.

comment:14 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

I see from your usr_local_find.txt that you do have several items in /usr/local which could interfere, so I must continue to suggest you (at least temporarily) move /usr/local aside (e.g. rename it to /usr/local-off), clean freetype, and try to build it again. If it works, you'll know something in /usr/local interfered. If it doesn't work, we'll know that wasn't relevant. In either case, you can then move /usr/local-off back to /usr/local, if you must.

Changed 15 years ago by atomist@…

Attachment: freetype_script.txt added

File is in script format. Renamed local to local-off, cleaned freetype and still failed.

comment:15 Changed 15 years ago by atomist@…

Yeah looks like it's not /usr/local. But worth a try ;-)

I will keep poking around. Thanks too.

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

I have an idea. Do you have a previous version of freetype installed with MacPorts? If so, which version? The new version of freetype may be trying to include files from the old active version and getting confused. Try deactivating it before installing the new one.

sudo port deactivate freetype
sudo port clean freetype
sudo port install freetype

Please let me know your result.

comment:17 in reply to:  16 Changed 15 years ago by atomist@…

Replying to ryandesign@…:

I have an idea. Do you have a previous version of freetype installed with MacPorts? If so, which version? The new version of freetype may be trying to include files from the old active version and getting confused. Try deactivating it before installing the new one.

sudo port deactivate freetype
sudo port clean freetype
sudo port install freetype

Please let me know your result.

Yeah tried that too.

Just grabbed the previous successfull installed version of freetype (2.3.5) and it now fails to install too.

So it has to be something that got installed after the fact of me putting macports on there and installing freetype the first time.

Exact same error [root@fatbook:~]# sudo port deactivate freetype (03-29 03:18) Error: port deactivate failed: Registry error: freetype not registered as installed & active. sudo port clean freetype sudo port install freetype [root@fatbook:~]# sudo port clean freetype (03-29 03:18) ---> Cleaning freetype [root@fatbook:~]# sudo port install freetype (03-29 03:18) ---> Fetching freetype ---> Verifying checksum(s) for freetype ---> Extracting freetype ---> Applying patches to freetype ---> Configuring freetype ---> Building freetype Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_print_freetype/work/freetype-2.3.9" && make all " returned error 2

2.3.5 manual install (with applied env) (short version) atom@fatbook:src/freetype-2.3.5]$ make (03-29 03:24) ./builds/unix/libtool --mode=compile /usr/bin/gcc-4.0 -I/opt/local/include -I/usr/src/freetype-2.3.5/objs -I./builds/unix -I/usr/src/freetype-2.3.5/include -c -O2 -DFT_CONFIG_OPTION_SYSTEM_ZLIB -DDARWIN_NO_CARBON -DFT_CONFIG_CONFIG_H="<ftconfig.h>" -DFT2_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>" -o /usr/src/freetype-2.3.5/objs/ftsystem.lo builds/unix/ftsystem.c mkdir /usr/src/freetype-2.3.5/objs/.libs

/usr/bin/gcc-4.0 -I/opt/local/include -I/usr/src/freetype-2.3.5/objs -I./builds/unix -I/usr/src/freetype-2.3.5/include -c -O2 -DFT_CONFIG_OPTION_SYSTEM_ZLIB -DDARWIN_NO_CARBON "-DFT_CONFIG_CONFIG_H=<ftconfig.h>" -DFT2_BUILD_LIBRARY "-DFT_CONFIG_MODULES_H=<ftmodule.h>" builds/unix/ftsystem.c -fno-common -DPIC -o /usr/src/freetype-2.3.5/objs/.libs/ftsystem.o

In file included from /usr/src/freetype-2.3.5/include/freetype/freetype.h:43,

from /usr/src/freetype-2.3.5/include/freetype/internal/ftdebug.h:30, from builds/unix/ftsystem.c:22:

/usr/src/freetype-2.3.5/include/freetype/fttypes.h:168: error: syntax error before 'FT_Tag' /usr/src/freetype-2.3.5/include/freetype/fttypes.h:168: warning: data definition has no type or storage class /usr/src/freetype-2.3.5/include/freetype/fttypes.h:329: error: syntax error before 'FT_PtrDist' /usr/src/freetype-2.3.5/include/freetype/fttypes.h:329: warning: data definition has no type or storage class In file included from /usr/src/freetype-2.3.5/include/freetype/internal/ftdebug.h:30,

from builds/unix/ftsystem.c:22:

<<<SNIP>>> /usr/src/freetype-2.3.5/include/freetype/internal/ftstream.h:488: error: syntax error before 'FT_Stream_ReadFields' /usr/src/freetype-2.3.5/include/freetype/internal/ftstream.h:490: warning: data definition has no type or storage class builds/unix/ftsystem.c:97: error: syntax error before 'ft_alloc' builds/unix/ftsystem.c: In function 'ft_alloc': builds/unix/ftsystem.c:102: warning: return makes integer from pointer without a cast builds/unix/ftsystem.c: At top level: builds/unix/ftsystem.c:127: error: syntax error before 'ft_realloc' builds/unix/ftsystem.c: In function 'ft_realloc': builds/unix/ftsystem.c:135: warning: return makes integer from pointer without a cast builds/unix/ftsystem.c: At top level: builds/unix/ftsystem.c:153: error: syntax error before 'ft_free' builds/unix/ftsystem.c:195: error: syntax error before 'ft_close_stream_by_munmap' builds/unix/ftsystem.c:217: error: syntax error before 'ft_close_stream_by_free' builds/unix/ftsystem.c:230: error: syntax error before 'FT_Stream_Open' builds/unix/ftsystem.c: In function 'FT_Stream_Open': builds/unix/ftsystem.c:278: error: 'LONG_MAX' undeclared (first use in this function) builds/unix/ftsystem.c:278: error: (Each undeclared identifier is reported only once builds/unix/ftsystem.c:278: error: for each function it appears in.) builds/unix/ftsystem.c:296: warning: assignment from incompatible pointer type builds/unix/ftsystem.c:337: warning: assignment from incompatible pointer type builds/unix/ftsystem.c: At top level: builds/unix/ftsystem.c:381: error: syntax error before 'FT_New_Memory' builds/unix/ftsystem.c: In function 'FT_New_Memory': builds/unix/ftsystem.c:390: warning: assignment from incompatible pointer type builds/unix/ftsystem.c:391: warning: assignment from incompatible pointer type builds/unix/ftsystem.c:392: warning: assignment from incompatible pointer type builds/unix/ftsystem.c:398: warning: return makes integer from pointer without a cast builds/unix/ftsystem.c: At top level: builds/unix/ftsystem.c:405: error: syntax error before 'FT_Done_Memory' make: * usr/src/freetype-2.3.5/objs/ftsystem.lo Error 1

comment:18 in reply to:  16 Changed 15 years ago by atomist@…

Replying to ryandesign@…:

I have an idea. Do you have a previous version of freetype installed with MacPorts? If so, which version? The new version of freetype may be trying to include files from the old active version and getting confused. Try deactivating it before installing the new one.

sudo port deactivate freetype
sudo port clean freetype
sudo port install freetype

Please let me know your result.

Sorry don't want to hammer you with posts but if I don't apply the environmental variables it builds fine! This is what I did and it failed: export CFLAGS='-O2' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2' MACOSX_DEPLOYMENT_TARGET='10.5' CPP='/usr/bin/cpp-4.0' CXX='/usr/bin/g++-4.0' F90FLAGS='-O2' LDFLAGS='-L/opt/local/lib' FCFLAGS='-O2' OBJC='/usr/bin/gcc-4.0' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2' FFLAGS='-O2' CC='/usr/bin/gcc-4.0'

Then I started a new shell and did ./configure --prefix=/opt/local After that make ran fine!

ranlib /usr/src/freetype-2.3.5/objs/.libs/libfreetype.a creating /usr/src/freetype-2.3.5/objs/libfreetype.la (cd /usr/src/freetype-2.3.5/objs/.libs && rm -f libfreetype.la && ln -s ../libfreetype.la libfreetype.la) [atom@fatbook:src/freetype-2.3.5]$

comment:19 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

The first error that's encountered is:

include/freetype/fttypes.h:172: error: syntax error before 'FT_Tag'

Line 172 of fttypes.h reads:

  typedef FT_UInt32  FT_Tag;

FT_UInt32 should be defined in ftconfig.h. I thought a previous freetype's ftconfig.h might have a different or missing definition of FT_UInt32 causing a problem. Can you please look if there are any other copies of ftconfig.h anywhere on your hard drive? Maybe freetype is findng one of them somehow. Please post the output of:

find / -name ftconfig.h 2>/dev/null

comment:20 Changed 15 years ago by atomist@…

did a locate ftconfig.h: /Applications/Gnuplot.app/Contents/Resources/include/freetype2/freetype/config/ftconfig.h /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include/freetype2/freetype/config/ftconfig.h /Developer/SDKs/MacOSX10.5.sdk/usr/X11/include/freetype2/freetype/config/ftconfig.h /opt/local/include/freetype2/freetype/config/ftconfig.h /opt/local/include/ftconfig.h /opt/local/var/macports/software/flow-tools/0.68_0/opt/local/include/ftconfig.h /opt/local/var/macports/software/freetype/2.3.5_1/opt/local/include/freetype2/freetype/config/ftconfig.h /usr/X11/include/freetype2/freetype/config/ftconfig.h /usr/local/graphviz-2.14/include/freetype2/freetype/config/ftconfig.h

will post the result of find once it's completed ( good old bsd locate ;-) )

comment:21 in reply to:  19 Changed 15 years ago by atomist@…

Replying to ryandesign@…:

The first error that's encountered is:

include/freetype/fttypes.h:172: error: syntax error before 'FT_Tag'

Line 172 of fttypes.h reads:

  typedef FT_UInt32  FT_Tag;

FT_UInt32 should be defined in ftconfig.h. I thought a previous freetype's ftconfig.h might have a different or missing definition of FT_UInt32 causing a problem. Can you please look if there are any other copies of ftconfig.h anywhere on your hard drive? Maybe freetype is findng one of them somehow. Please post the output of:

find / -name ftconfig.h 2>/dev/null

Yes! It was this one

/opt/local/include/ftconfig.h

Now it builds! Great.

comment:22 Changed 15 years ago by blb@…

2.3.5 manual install (with applied env) (short version) atom@fatbook:src/freetype-2.3.5]$ make (03-29 03:24) ./builds/unix/libtool --mode=compile /usr/bin/gcc-4.0 -I/opt/local/include -I/usr/src/freetype-2.3.5/objs -I./builds/unix -I/usr/src/freetype-2.3.5/include -c -O2 -DFT_CONFIG_OPTION_SYSTEM_ZLIB -DDARWIN_NO_CARBON -DFT_CONFIG_CONFIG_H="<ftconfig.h>" -DFT2_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>" -o /usr/src/freetype-2.3.5/objs/ftsystem.lo builds/unix/ftsystem.c mkdir /usr/src/freetype-2.3.5/objs/.libs

It looks like stuff in /usr/src is interfering...

comment:23 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Yes, bingo. /opt/local/include/ftconfig.h provided by the flow-tools port. A completely different ftconfig.h than the one FreeType expected. So the bug is that freetype isn't looking for its own ftconfig.h first. I'll report this to the developers. Thanks so much for helping us isolate the cause of the problem.

comment:24 in reply to:  23 Changed 15 years ago by atomist@…

Replying to ryandesign@…:

Yes, bingo. /opt/local/include/ftconfig.h provided by the flow-tools port. A completely different ftconfig.h than the one FreeType expected. So the bug is that freetype isn't looking for its own ftconfig.h first. I'll report this to the developers. Thanks so much for helping us isolate the cause of the problem.

Thanks again. Glad we figured this one out ;-) Yeah I do have flow-tools installed for working on our cisco's at work a while ago.

comment:25 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Status: newassigned

I confirmed the issue on my system with flow-tools installed. I changed the freetype port in r48805 to bail out with a helpful error message if flow-tools is around.

comment:26 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: freetype 2.3.8 fails mac os x 10.5 intelfreetype build fails if flow-tools is active

comment:27 Changed 15 years ago by peter@…

awesome, yes, works for me. thanks for figuring this out!

Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: Portfile.diff added

comment:28 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: mcalhoun@… added

Cc Me!

comment:29 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attached is an alternative to r48805 which allows flow-tools to be active when installing freetype.

comment:30 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Using -isystem as you suggest does not appear to do anything. I can just as easily clear configure.cppflags and it works too. But I'm worried that it's then using the zlib.h in /usr/include but then still using the zlib.dylib in ${prefix}/lib, and, although these are the same version at present, this could change if a new version of zlib is released. But, I also still do not understand the -isystem option, and would still appreciate a pointer to any documentation explaining its purpose.

I still think it's a bug that freetype looks for ftconfig.h in the path MacPorts indicates in CPPFLAGS, I have reported it to the authors of freetype, and I await their response.

comment:31 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

It seems to me that -isystem is exactly what we want in this situation.
From man gcc:

       -isystem dir
           Search dir for header files, after all directories specified by -I
           but before the standard system directories.  Mark it as a system
           directory, so that it gets the same special treatment as is applied
           to the standard system directories.

The correct ftconfig.h is found because the -I used in the build directory will take precedence over -isystem${prefix}. zlib.h will not be found in /usr/include because -isystem takes precedence over standard system directories.

comment:32 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Thanks, you're right, that does sound perfect. Committed your patch in r49050. Now that you refer me to the gcc manpage, I have the feeling you've shown me that before. Sorry if I'm being dense; eventually I'll get it.

comment:33 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.