Attempting to compile feynmf as a dependency of texlive fails in my OS X 1.5 prefixed Gentoo installation due to failing a condition possibly based on the length of the style file name. The following URL points to the offending line in makeindex source code, although my message comes from a version prior to this change, as it does not include "name". http://www.tug.org/svn/texlive/trunk/Build/source/texk/makeindexk/mkind.c?r1=5165&r2=5164&pathrev=5165 This may be a problem with the use of a prefix, but as it is the only component that fails to compile for texlive in my prefix it seems important still. Reproducible: Always Steps to Reproduce: 1. Attempt to compile feynmf inside a prefixed Gentoo installation 2. 3. Actual Results: Compile fails due to makeindex falling over Expected Results: Makeindex should process the filename correctly and complete the compile. $ emerge --info Portage 2.2.00.8515-prefix (default-prefix/darwin/macos/10.5/x86, gcc-4.2.2, unavailable, 9.0.0 i386) ================================================================= System uname: 9.0.0 i386 i386 Timestamp of tree: Sun, 18 Nov 2007 20:53:51 +0000 distcc 2.18.3 i686-apple-darwin9 (protocols 1 and 2) (default port 3632) [disabled] app-shells/bash: 3.2_p17-r1 dev-lang/python: 2.5.1-r3 sys-devel/autoconf: 2.13, 2.61-r1 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/gcc-config: 1.3.16 sys-devel/libtool: 1.5.24 ACCEPT_KEYWORDS="x86-macos ~x86-macos" CBUILD="i686-apple-darwin9" CFLAGS="-O2 -pipe -march=prescott" CHOST="i686-apple-darwin9" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-O2 -pipe -march=prescott" DISTDIR="/Users/peter/Library/Gentoo/usr/portage/distfiles" EPREFIX="/Users/peter/Library/Gentoo" FEATURES="collision-protect distlocks metadata-transfer nostrip parallel-fetch sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS=" ftp://mirror.internode.on.net/pub/gentoo ftp://ftp.swin.edu.au/gentoo" LANG="en_AU.UTF-8" PKGDIR="/Users/peter/Library/Gentoo/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*" PORTAGE_TMPDIR="/Users/peter/Library/Gentoo/var/tmp" PORTDIR="/Users/peter/Library/Gentoo/usr/portage" PORTDIR_OVERLAY="/Users/peter/Library/Gentoo/usr/local/portage" SYNC="svn+http://overlays.gentoo.org/svn/proj/alt/trunk/prefix-overlay" USE="aqua coreaudio cracklib midi mmx mmxext ncurses nls objc objc++ prefix readline sse sse2 ssl unicode x86-macos zlib" ELIBC="Darwin" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 136324 [details] emerge log
I compiled it again using the following command, but the resulting log file was too big to attach here. $ KPATHSEA_DEBUG=-1 emerge -1 feynmf I can to provide it by email to anyone who needs it.
The following line in texlive's mkind.c file should possibly be changed: char sty_fn[LINE_MAX]; As LINE_MAX is basically a console/output width measurement, the host filename length is really STRING_MAX according to mkind.h char sty_fn[STRING_MAX]; In the STRING_MAX case, the filename that was given to it would not fail the following condition where found is a string pointer to the name of the style file. if (strlen(found) >= sizeof(sty_fn)) {
Feels more like one should use PATH_MAX, though that may be too small as well, as POSIX defines 256 chars for it.
Sorry, I just suggested STRING_MAX because of the following line in mkind.h #define STRING_MAX 512 /* maximum length of host filename */ I think this is a texlive bug, although it may not ever appear with the standard length of paths in the standard Gentoo layout.
Created attachment 136331 [details, diff] mkind.c patch to make the style file name length the same as the others This is a patch against texlive-core-2007-r8 which makes "STRING_MAX" the length of the style file pointer, inline with the other similar pointers in the same file. Recompiling texlive-core using this patch fixes the issue with compiling feynmf inside my prefix.
I added your patch to the tree. Thanks!