Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 262177 - dev-texlive/texlive-basic-2008 fails to emerge
Summary: dev-texlive/texlive-basic-2008 fails to emerge
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High critical with 4 votes (vote)
Assignee: Alexis Ballier
URL:
Whiteboard:
Keywords:
: 274509 366593 (view as bug list)
Depends on:
Blocks: 280914
  Show dependency tree
 
Reported: 2009-03-11 19:25 UTC by Dave Bender
Modified: 2011-10-06 21:01 UTC (History)
15 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build output (dev-texlive.texlive-basic.txt,10.63 KB, text/plain)
2009-03-11 19:27 UTC, Dave Bender
Details
emerge output (emerge_texlive-basic-2008.log,11.25 KB, text/plain)
2009-05-30 09:16 UTC, Fredrik Eriksson
Details
emerge --info (emerge_info.txt,4.17 KB, text/plain)
2009-05-30 09:16 UTC, Fredrik Eriksson
Details
Fix the texlive-modules.eclass function texlive-module_src_compile() (texlive_bugid_262177.patch,707 bytes, patch)
2009-08-11 20:38 UTC, Morten Svendsen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Bender 2009-03-11 19:25:25 UTC
dev-texlive/texlive-basic fails to make cmr10 font when emerging.
Comment 1 Dave Bender 2009-03-11 19:27:00 UTC
Created attachment 184726 [details]
build output
Comment 2 John Klehm 2009-04-03 07:56:00 UTC
Fails here for me too.  I followed the upgrade guide as per the elog message on this page:
http://www.gentoo.org/proj/en/tex/texlive-migration-guide.xml

Specifically code listing 1.6:
"rm -rf /var/lib/texmf/web2c"


After having done that and then attempting to reemerge the ebuild fails:


The specific snippet of code:
              TEXMFHOME="${S}/texmf:${S}/texmf-dist" fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all || die "failed to build format ${i}";
 The die message:
  failed to build format texmf/fmtutil/format.metafont.cnf


Looking at the detailed build log it shows that it fails due to the missing web2c directory, which is funny because I guess I had interpreted the guide to remove that dir.

What fixed this problem for me was to hack the textlive-module.eclass:
http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/texlive-module.eclass?rev=1.20&view=markup


texlive-module_src_compile() {
	# Build format files
	for i in texmf/fmtutil/format*.cnf; do
		if [ -f "${i}" ]; then
			einfo "Building format ${i}"
			TEXMFHOME="${S}/texmf:${S}/texmf-dist"\
				fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all\
				|| die "failed to build format ${i}"


Simply removing that  "|| die "  line and the '\' on the line above it allowed the ebuild to finish installing for me.

Comment 3 Voni 2009-04-05 06:00:09 UTC
I think a better solution is to simply create the missing dir:

texlive-module_src_compile() {
	# Build format files
	mkdir -p "${S}/texmf-var/web2c"
	for i in texmf/fmtutil/format*.cnf; do
		if [ -f "${i}" ]; then
			einfo "Building format ${i}"
			TEXMFHOME="${S}/texmf:${S}/texmf-dist"\
				fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all\
				|| die "failed to build format ${i}"
		fi
	done

(add the line below "# Build format files")

Comment 4 Ryan Hope 2009-04-06 19:17:52 UTC
(In reply to comment #3)
> I think a better solution is to simply create the missing dir:
> 
> texlive-module_src_compile() {
>         # Build format files
>         mkdir -p "${S}/texmf-var/web2c"
>         for i in texmf/fmtutil/format*.cnf; do
>                 if [ -f "${i}" ]; then
>                         einfo "Building format ${i}"
>                         TEXMFHOME="${S}/texmf:${S}/texmf-dist"\
>                                 fmtutil --cnffile "${i}" --fmtdir
> "${S}/texmf-var/web2c" --all\
>                                 || die "failed to build format ${i}"
>                 fi
>         done
> 
> (add the line below "# Build format files")
> 

creating this dir did not help for me
Comment 5 Sven Stalinski 2009-04-07 16:14:26 UTC
perhaps it helps if you run 'texmf-update'?
Comment 6 Kostadin Chikov 2009-04-07 19:17:30 UTC
(In reply to comment #5)
> perhaps it helps if you run 'texmf-update'?
> 

That fixed the problem for me.
Comment 7 Robert Wolf 2009-04-08 09:51:36 UTC
(In reply to comment #3)
> I think a better solution is to simply create the missing dir:
> 
> texlive-module_src_compile() {
>         # Build format files
>         mkdir -p "${S}/texmf-var/web2c"
> 
> (add the line below "# Build format files")
> 

*** Adding this mkdir line to eclass file solved this problem on my sys. Please, for the other users, can someone update eclass file?
Comment 8 Dave Bender 2009-04-08 13:43:41 UTC
The eclass fix allowed me to finish the install, but I would not commit fix until the REASON for the missing web2c directory is known.
Comment 9 Alexis Ballier gentoo-dev 2009-04-09 07:08:45 UTC
(In reply to comment #8)
> The eclass fix allowed me to finish the install, but I would not commit fix
> until the REASON for the missing web2c directory is known.

http://www.gentoo.org/proj/en/tex/texlive-migration-guide.xml#doc_chap4
section "Format directory does not exist"

The missing dir doesnt seem related to the original bug report though
Comment 10 Robert Wolf 2009-04-10 10:46:08 UTC
(In reply to comment #9)
> http://www.gentoo.org/proj/en/tex/texlive-migration-guide.xml#doc_chap4
> section "Format directory does not exist"
> 
> The missing dir doesnt seem related to the original bug report though

*** Hi Alexis,

first of all, my problem is the same as comment #2 describe, not original post (and comment #1). I mean error:

fmtutil: format directory `/portage.work/portage/dev-texlive/texlive-basic-2008/work/texmf-var/web2c' does not exist

on my one Gentoo sys, I did the eclass update and installed texlive this way.

But on my second system, I wanted to install it "clean", according to migration guide.

I did no changes to configuration files of tetex. So I unmerged tetex. Then, I wanted to delete 00texmf.cnf, but it has not already been in the /etc/texmf/texmf.d/ directory.

Then I have checked the /usr/bin/pdftex link and it is pdftex-texlive-core-2008. There were some updates on the April 3rd

Fri Apr  3 22:32:08 2009 >>> app-text/texlive-core-2008-r4
Fri Apr  3 22:32:15 2009 >>> virtual/tex-base-0
Fri Apr  3 22:32:34 2009 >>> dev-texlive/texlive-documentation-base-2008

I have removed /var/lib/texmf/web2c too.

Now I have tried to install texlive but dev-texlive/texlive-basic-2008 fails with the error

fmtutil: format directory `/portage.work/portage/dev-texlive/texlive-basic-2008/work/texmf-var/web2c' does not exist.

What package should create this directory? There is a code 

fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all

in ebuild file and ${S} and according to man 5 ebuild $S means S = "${WORKDIR}/${P}" (Contains the path to the temporary build directory). IMHO no texlive configuration should contain this "build" path and therefore no texlive command creates this path. If the ebuild uses this "temporary build directory", the ebuild should create it, should not? Am I right or not? Or did you forget to set $S variable to some other value?



I have check the section "Format directory does not exist" too, but I think this is not the same error, although the check command kpsewhich returns on my system different result.

Command kpsewhich --var-value=TEXMFMAIN writes on my system /var/lib/texmf and this contains only "fonts" and "ls-R". The /usr/share/texmf (as written in migration guide) contains "bibtex  doc  dvipdfmx  dvips  fmtutil  fonts  ls-R  scripts  tex  texconfig  texdoc  texdoctk  web2c".

I have searched the /etc/texmf/texmf.d for the /var/lib/texmf and found it in file 05searchpaths.cnf which belongs to app-text/texlive-core package. I found the /var/lib/texmf directory set in this variable:

TEXMFSYSVAR = $SELFAUTOPARENT/var/lib/texmf

Then I found it in comment at the end of this file

% On some systems, there will be a system tree which contains all the font
% files that may be created as well as the formats.  For example
%   TEXMFVAR = /var/lib/texmf
% is used on many Linux systems.  In this case, set VARTEXFONTS like this
% VARTEXFONTS = $TEXMFVAR/fonts
% and do not mention it in TEXMFDBS (but _do_ mention TEXMFVAR).
Comment 11 Stefan de Konink 2009-04-10 21:52:37 UTC
 * Building format texmf/fmtutil/format.metafont.cnf
fmtutil: format directory `/var/tmp/paludis/dev-texlive-texlive-basic-2008/work/texmf-var/web2c' does not 
exist.

!!! ERROR in dev-texlive/texlive-basic-2008:
!!! In texlive-module_src_compile at line 1525
!!! failed to build format texmf/fmtutil/format.metafont.cnf

!!! Call stack:
!!!    * texlive-module_src_compile (/var/tmp/paludis/dev-texlive-texlive-basic-2008/temp/loadsaveenv:1525
)
!!!    * src_compile (/var/tmp/paludis/dev-texlive-texlive-basic-2008/temp/loadsaveenv:1411)
!!!    * ebuild_f_compile (/usr/libexec/paludis/0/src_compile.bash:49)
!!!    * ebuild_main (/usr/libexec/paludis/ebuild.bash:482)
!!!    * main (/usr/libexec/paludis/ebuild.bash:498)
Comment 12 Graham Russell 2009-04-11 00:01:11 UTC
 * Building format texmf/fmtutil/format.metafont.cnf
fmtutil: format directory `/var/tmp/portage/dev-texlive/texlive-basic-2008/work/texmf-var/web2c' does not exist.
 * 
 * ERROR: dev-texlive/texlive-basic-2008 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line  200:  Called texlive-module_src_compile
 *             environment, line  318:  Called die
 * The specific snippet of code:
 *               TEXMFHOME="${S}/texmf:${S}/texmf-dist" fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all || die "failed to build format ${i}";
 *  The die message:
 *   failed to build format texmf/fmtutil/format.metafont.cnf


# texmf-update
Configuring TeXLive ...
Generating ls-R files
warning: kpathsea: configuration file texmf.cnf not found in these directories: /usr/bin:/usr:/:/usr/bin/share/texmf-local/web2c:/usr/share/texmf-local/web2c://share/texmf-local/web2c:/usr/bin/texmf-local/web2c:/usr/texmf-local/web2c://texmf-local/web2c:/usr/bin/share/texmf/web2c:/usr/share/texmf/web2c://share/texmf/web2c:/usr/bin/texmf/web2c:/usr/texmf/web2c://texmf/web2c.
warning: kpathsea: configuration file texmf.cnf not found in these directories: /usr/bin:/usr:/:/usr/bin/share/texmf-local/web2c:/usr/share/texmf-local/web2c://share/texmf-local/web2c:/usr/bin/texmf-local/web2c:/usr/texmf-local/web2c://texmf-local/web2c:/usr/bin/share/texmf/web2c:/usr/share/texmf/web2c://share/texmf/web2c:/usr/bin/texmf/web2c:/usr/texmf/web2c://texmf/web2c.
warning: kpathsea: configuration file texmf.cnf not found in these directories: /usr/bin:/usr:/:/usr/bin/share/texmf-local/web2c:/usr/share/texmf-local/web2c://share/texmf-local/web2c:/usr/bin/texmf-local/web2c:/usr/texmf-local/web2c://texmf-local/web2c:/usr/bin/share/texmf/web2c:/usr/share/texmf/web2c://share/texmf/web2c:/usr/bin/texmf/web2c:/usr/texmf/web2c://texmf/web2c.
Generating format files ...
Generating font maps...

Use 'texconfig font ro'(rw) to disable (enable) font generation for users


# kpsewhich --var-value=TEXMFMAIN
warning: kpathsea: configuration file texmf.cnf not found in these directories: /usr/bin:/usr:/:/usr/bin/share/texmf-local/web2c:/usr/share/texmf-local/web2c://share/texmf-local/web2c:/usr/bin/texmf-local/web2c:/usr/texmf-local/web2c://texmf-local/web2c:/usr/bin/share/texmf/web2c:/usr/share/texmf/web2c://share/texmf/web2c:/usr/bin/texmf/web2c:/usr/texmf/web2c://texmf/web2c.
Comment 13 Robert Wolf 2009-04-11 10:21:13 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > The eclass fix allowed me to finish the install, but I would not commit fix
> > until the REASON for the missing web2c directory is known.

*** Hey guys, we have three solutions.

The ebuild runs fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all, which uses directory ${S}/texmf-var/web2c, which is temporary build directory. Should fmtutil create this --fmtdir or not? Because of this issue (and the error) I think fmtutil expects this directory to exist.

1) Ebuild should create this directory (using mkdir)

2) Some other tool should create this directory (probably it creates some other directory, doesn't it?)

3) Ebuild should use some other, already created, directory

Can you choose one option and fix the eclass/ebuild? Or can you explain why is this directory used and it does not exist?

IMHO this error is again blocker and should be solved as fast as possible, or at least it should be solved for now with the dirty trick "mkdir" and later as one needs to investigate the problem (but soon) should be solved correctly.
Comment 14 Henrik Grubbström 2009-04-13 17:18:41 UTC
Running texmf-update solved the problem for me. It should probably be added to the upgrade guide at http://www.gentoo.org/proj/en/tex/texlive-migration-guide.xml
.
Comment 15 Graham Russell 2009-04-13 17:33:03 UTC
# texmf-update
Configuring TeXLive ...
Generating ls-R files
Generating format files ...
Generating font maps...

Use 'texconfig font ro'(rw) to disable (enable) font generation for users

but still same error when running emerge texlive as per #12
Comment 16 Alexis Ballier gentoo-dev 2009-04-15 06:08:55 UTC
(In reply to comment #12)
> # kpsewhich --var-value=TEXMFMAIN
> warning: kpathsea: configuration file texmf.cnf not found in these directories:
> /usr/bin:/usr:/:/usr/bin/share/texmf-local/web2c:/usr/share/texmf-local/web2c://share/texmf-local/web2c:/usr/bin/texmf-local/web2c:/usr/texmf-local/web2c://texmf-local/web2c:/usr/bin/share/texmf/web2c:/usr/share/texmf/web2c://share/texmf/web2c:/usr/bin/texmf/web2c:/usr/texmf/web2c://texmf/web2c.


you have a serious problem if you don't have texmf.cnf


(In reply to comment #13)
> 1) Ebuild should create this directory (using mkdir)

no

> 2) Some other tool should create this directory (probably it creates some other
> directory, doesn't it?)

fmtutil already does unless you have a configuration problem

> 3) Ebuild should use some other, already created, directory

no, per my answer to 2

> Can you choose one option and fix the eclass/ebuild? Or can you explain why is
> this directory used and it does not exist?

because it is temporary and automatically created

(In reply to comment #14)
> Running texmf-update solved the problem for me. It should probably be added to
> the upgrade guide at
> http://www.gentoo.org/proj/en/tex/texlive-migration-guide.xml

I've added a note about this as this seems to be a common mistake not to run texmf-update after touching files in /etc/texmf/*.d



(In reply to comment #10)
> I have check the section "Format directory does not exist" too, but I think
> this is not the same error, although the check command kpsewhich returns on my
> system different result.
> 
> Command kpsewhich --var-value=TEXMFMAIN writes on my system /var/lib/texmf and
> this contains only "fonts" and "ls-R". The /usr/share/texmf (as written in
> migration guide) contains "bibtex  doc  dvipdfmx  dvips  fmtutil  fonts  ls-R 
> scripts  tex  texconfig  texdoc  texdoctk  web2c".

This is very likely to be the cause of the problem: TEXMFMAIN must be /usr/share/texmf otherwise it will fail like this (and this is only one among a lot of other breakages thus creating the directory in the eclass just hides the visible part of the iceberg).


Now please stop posting random errors on this bug and open a new one if it is different; we're talking about a texlive-basic failure to generate some font here not anything related to a misconfiguration / migration problem that causes tl-basic issues just because it is the first one that happens to trigger it. This bug is starting to be a real mess and you will not have any other answer from me on unrelated subjects.
Comment 17 Robert Wolf 2009-04-15 20:40:06 UTC
(In reply to comment #16)
> (In reply to comment #10)
> Now please stop posting random errors on this bug and open a new one if it is
> different; we're talking about a texlive-basic failure to generate some font

*** OK, I have created new bug report for people they are looking for a solution as me. https://bugs.gentoo.org/show_bug.cgi?id=266305

I have searched for a problem and (I hope) I found the problem. (see below)

> (In reply to comment #14)
> > Running texmf-update solved the problem for me. It should probably be added to
> > the upgrade guide at
> > http://www.gentoo.org/proj/en/tex/texlive-migration-guide.xml
> 
> I've added a note about this as this seems to be a common mistake not to run
> texmf-update after touching files in /etc/texmf/*.d

*** Could you please update this doc to tell, that users have to run texmf-update even if they did not touch any file in /etc/texmf/*.d (I did neither), but if they installed texlive-core before uninstalling tetex? (see my bug report for explanation)

Thank you for hints.
Comment 18 Fredrik Eriksson 2009-05-30 09:16:12 UTC
Created attachment 192956 [details]
emerge output

I'm also seeing this problem, really troublesome to not being able to install texlive...

I'm not sure what information is needed to track and fix this bug, but I'll attach the emerge output and my emerge --info, if you need anything else please let me know.
Comment 19 Fredrik Eriksson 2009-05-30 09:16:38 UTC
Created attachment 192958 [details]
emerge --info
Comment 20 Gian 2009-05-30 20:05:41 UTC
I have the same problem on a fresh Gentoo installation, though I didn't on either of my two old Gentoo installations. Could that possibly have something to do with tetex not having been installed previously or something like that? 
Comment 21 Alexis Ballier gentoo-dev 2009-06-08 10:06:44 UTC
(In reply to comment #20)
> I have the same problem on a fresh Gentoo installation, though I didn't on
> either of my two old Gentoo installations. Could that possibly have something
> to do with tetex not having been installed previously or something like that? 


thats weird, I cant reproduce it on a fresh chroot; i've changed a little bit the eclass so that it should at least find mf.base (though it shouldnt be needed), could you please retest after syncing in a couple of hours?
Comment 22 Fredrik Eriksson 2009-06-08 23:16:17 UTC
(In reply to comment #21)
> thats weird, I cant reproduce it on a fresh chroot; i've changed a little bit
> the eclass so that it should at least find mf.base (though it shouldnt be
> needed), could you please retest after syncing in a couple of hours?
> 

I don't know why you can't reproduce the bug... For me this appears on a clean install on a x86-computer, my two old gentoo installations on x86_64 can emerge just fine.
With the changes you did it at least doesn't fail on mf.base anymore, though this time it's 'cmr10' it doesn't find:


(/var/tmp/portage/dev-texlive/texlive-basic-2008/work/texmf-dist/tex/plain/conf
ig/tex.ini
(/var/tmp/portage/dev-texlive/texlive-basic-2008/work/texmf-dist/tex/plain/base
/plain.tex Preloading the plain format: codes, registers, parameters, fonts,
kpathsea: Running mktextfm cmr10
/usr/share/texmf/web2c/mktexnam: Could not map source abbreviation  for cmr10.
/usr/share/texmf/web2c/mktexnam: Need to update ?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cmr10
This is METAFONT, Version 2.718281 (Web2C 7.5.7)


kpathsea: Running mktexmf cmr10
! I can't find file `cmr10'.
<*> ...e:=ljfour; mag:=1; nonstopmode; input cmr10
                                                  
Please type another input file name
! Emergency stop.
<*> ...e:=ljfour; mag:=1; nonstopmode; input cmr10
                                                  
Transcript written on mfput.log.
grep: cmr10.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cmr10' failed to make cmr10.tfm.
kpathsea: Appending font creation commands to missfont.log.

! Font \tenrm=cmr10 not loadable: Metric (TFM) file not found.
<to be read again> 
                   \font 
l.401 \font
           \preloaded=cmr9
? 
! Emergency stop.
<to be read again> 
                   \font 
l.401 \font
           \preloaded=cmr9
No pages of output.
Transcript written on tex.log.
Error: `tex -ini  -jobname=tex -progname=tex tex.ini' failed

###############################################################################
fmtutil: Error! Not all formats have been built successfully.
Visit the log files in directory
  /var/tmp/portage/dev-texlive/texlive-basic-2008/work/texmf-var/web2c
for details.
###############################################################################

This is a summary of all `failed' messages and warnings:
`tex -ini  -jobname=tex -progname=tex tex.ini' failed
Comment 23 Jeroen Roovers (RETIRED) gentoo-dev 2009-06-17 13:43:23 UTC
*** Bug 274509 has been marked as a duplicate of this bug. ***
Comment 24 Jeroen Roovers (RETIRED) gentoo-dev 2009-06-17 13:44:04 UTC
Not a blocker.
Comment 25 Fredrik Eriksson 2009-07-11 07:49:17 UTC
This bug should really be re-opened, it isn't fixed and it is a rather major bug; making it impossible to emerge some packages with the doc flag and create tex-documents.
Comment 26 Morten Svendsen 2009-08-10 20:45:58 UTC
I made two fresh installs of gentoo in a chroot based on stage3-i686-20090804 and stage3-i686-20090623.

Procedure to reproduce is simple:

in the chroot based on stage3-i686-2009**** run emerge --update --deep --newuse --emptytree world, this completes completely without problems. Then run emerge texlive-basic. When reaching emerge of texlive-basic, build fails with the same error as listed in Comment #22 (emerge_texlive-basic-2008.log). Running texmf-update does nothing to resolve this problem.

Please reopen this bug
Comment 27 Morten Svendsen 2009-08-11 20:35:27 UTC
(fixing texlive-module.eclass)
Emerging texlive-basic starts the function texlive-module_src_compile() from  texlive-module.eclass. The function calls fmtutil which at some point calls mktexnam which at some point calls kpsewhich.

kpsewhich seems to be unable to locate the mf and tfm files.

To help kpsewhich find the font files I made the following change to the texlive-module.eclass file, and now the merge of texlive-basic complete without warnings and errors.

If you have previously emerged texlive-basic or for some other reason already have the mf and tfm files somewhere in /usr/share/texmf-dist/ (e.g. /usr/share/texmf-dist/fonts/source/public/cm/cmr10.mf and /usr/share/texmf-dist/fonts/tfm/public/cm/cmr10.tfm) re-emerging the texlive-basic will complete, but using the currently installed mf and tfm files. emerge -C texlive-basic will delete the files (if your packet database is correct). After the emerge -C, emerging texlive-basic will fail to complete without this change.

--- texlive-module.eclass.old	2009-08-11 22:03:21.943157356 +0200
+++ texlive-module.eclass	2009-08-11 22:09:22.727159404 +0200
@@ -141,9 +141,16 @@
 	for i in texmf/fmtutil/format*.cnf; do
 		if [ -f "${i}" ]; then
 			einfo "Building format ${i}"
+			mktexlsr ${S}/texmf
+			mktexlsr ${S}/texmf-var
+			mktexlsr ${S}/texmf-dist
 			VARTEXFONTS="${T}/fonts" TEXMFHOME="${S}/texmf:${S}/texmf-dist:${S}/texmf-var"\
+                                TEXMFLOCAL="${S}/texmf:${S}/texmf-dist:${S}/texmf-var"\
 				fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all\
 				|| die "failed to build format ${i}"
+			rm ${S}/texmf-dist/ls-R
+			rm ${S}/texmf-var/ls-R
+			rm ${S}/texmf/ls-R
 		fi
 	done

Comment 28 Morten Svendsen 2009-08-11 20:38:52 UTC
Created attachment 200965 [details, diff]
Fix the texlive-modules.eclass function texlive-module_src_compile()
Comment 29 Alexis Ballier gentoo-dev 2009-08-11 20:52:11 UTC
(In reply to comment #27)
> kpsewhich seems to be unable to locate the mf and tfm files.

If creating the ls-R files fixes the problem then we should investigate why it doesn't find the files without.

> If you have previously emerged texlive-basic or for some other reason already
> have the mf and tfm files somewhere in /usr/share/texmf-dist/ (e.g.
> /usr/share/texmf-dist/fonts/source/public/cm/cmr10.mf and
> /usr/share/texmf-dist/fonts/tfm/public/cm/cmr10.tfm) re-emerging the
> texlive-basic will complete, but using the currently installed mf and tfm
> files. emerge -C texlive-basic will delete the files (if your packet database
> is correct). After the emerge -C, emerging texlive-basic will fail to complete
> without this change.

This isn't true, otherwise nobody will be able to install texlive.
See the small example here:

alexis@geryon /tmp/toto $ mkdir tex
alexis@geryon /tmp/toto $ touch tex/toto.tex
alexis@geryon /tmp/toto $ ls
total 0
drwxr-xr-x 2 alexis users 72 2009-08-11 22:49 tex
alexis@geryon /tmp/toto $ TEXMFHOME=/tmp/toto kpsewhich toto.tex
/tmp/toto/tex/toto.tex

There is no ls-R file and it finds it anyway...


Please try this at home and tell me if it works the same way.

Ps: you don't need to CC me while i'm the bug assignee...
Comment 30 Morten Svendsen 2009-08-12 00:07:21 UTC
(In reply to comment #29)
> alexis@geryon /tmp/toto $ mkdir tex
> alexis@geryon /tmp/toto $ touch tex/toto.tex
> alexis@geryon /tmp/toto $ ls
> drwxr-xr-x 2 alexis users 72 2009-08-11 22:49 tex
> alexis@geryon /tmp/toto $ TEXMFHOME=/tmp/toto kpsewhich toto.tex
> /tmp/toto/tex/toto.tex
> 
> There is no ls-R file and it finds it anyway... 
> Please try this at home and tell me if it works the same way.

Yes it is true that kpsewhich finds files if you put them in dirs with specific names.
/tmp/toto $ mkdir tex
/tmp/toto $ mkdir texx
/tmp/toto $ touch tex/toto.tex
/tmp/toto $ touch texx/totox.tex
/tmp/toto $ TEXMFHOME=/tmp/toto kpsewhich toto.tex
/tmp/toto/tex/toto.tex
/tmp/toto $ TEXMFHOME=/tmp/toto kpsewhich totox.tex
Do not find totox.tex

Lets see what happend
/tmp/tete $ TEXMFHOME=/tmp/toto kpsewhich --debug=9 totox.tex
<snip>
kdebug:Search path for ovf files (from texmf.cnf)
kdebug:  = /tmp/toto/fonts/ofm:.....
kdebug:Search path for tex files (from TEXINPUTS environment variable)
kdebug:  = /tmp/toto/tex:.....
<snip>
So kpsewhich is looking in hardcoded paths and therefore do not see files in toto/texx/ or files in ${S}/texmf-dist/fonts/source/public/cm/

How to make it, I can not see, right now, but one way was to create the ls-R files, but it should of course be fixed differently.

> Ps: you don't need to CC me while i'm the bug assignee...
sorry, I did not see you.

Comment 31 Morten Svendsen 2009-08-12 12:02:13 UTC
(In reply to comment #30)
> So kpsewhich is looking in hardcoded paths and therefore do not see files in
> toto/texx/ or files in ${S}/texmf-dist/fonts/source/public/cm/
> 
> How to make it, I can not see, right now, but one way was to create the ls-R
> files, but it should of course be fixed differently.
OK, I look in the manual http://www.pd.infn.it/TeX/doc/html/kpathsea/kpathsea_3.html#SEC58 and it mentions using // to do recursive search. I tried that before in TEXMFHOME and TEXMFLOCAL but it did not work. Using TEXINPUTS works so adding TEXINPUTS="${S}/texmf//:${S}/texmf-dist//:${S}/texmf-var//" to line 144 in texlive-module.eclass fixes the problem.

Also just replacing the TEXMFHOME with TEXMF fixes the problem.

If I add the // to TEXMFHOME, kpsewhich still do not want to do recursive search? This could be related to the !! switch that can be placed in front of the var, but it is not used in front of TEXMFHOME in texmf.cnf


I found another possible bug in ocaml-**.ebuild. It creates a file /etc/env.d/99ocamldoc with "TEXINPUTS=/usr/lib/ocaml/ocamldoc:". 

This esentialy owerwrite TEXINPUTS. See for example:
 # kpsewhich -expand-path=\$TEXINPUTS
/usr/lib/ocaml/ocamldoc
 # unset $TEXINPUTS
 # kpsewhich -expand-path=\$TEXINPUTS
.:/usr/share/texmf/tex/generic:/usr/share/texmf/tex/generic/config:/usr/share/texmf/tex/generic/hyphen:/usr/share/texmf/tex/generic/pdftex:<snip>
 #
Comment 32 Alexis Ballier gentoo-dev 2009-08-12 12:44:07 UTC
(In reply to comment #31)
> I found another possible bug in ocaml-**.ebuild. It creates a file
> /etc/env.d/99ocamldoc with "TEXINPUTS=/usr/lib/ocaml/ocamldoc:". 

Hmm indeed; TEXINPUTS seems to affect how its built. Just in case, what package manager are you using? I'll probably commit a change to the eclass that'll call fmtutil prepended with 'env -u TEXINPUTS'.
Comment 33 Alexis Ballier gentoo-dev 2009-08-12 12:44:33 UTC
reopening while at it
Comment 34 Morten Svendsen 2009-08-13 10:16:11 UTC
(In reply to comment #32)
> (In reply to comment #31)
> > I found another possible bug in ocaml-**.ebuild. It creates a file
> > /etc/env.d/99ocamldoc with "TEXINPUTS=/usr/lib/ocaml/ocamldoc:". 
> 
> Hmm indeed; TEXINPUTS seems to affect how its built. Just in case, what package
> manager are you using? I'll probably commit a change to the eclass that'll call
> fmtutil prepended with 'env -u TEXINPUTS'.
> 
I'm using Portage
Comment 35 Alexis Ballier gentoo-dev 2009-08-14 11:53:18 UTC
I've checked in the env -u change; now it ignores TEXINPUTS from the environment -> fixed; reopen if the issue still happens.
Comment 36 Andreas Nüßlein 2009-10-08 23:07:22 UTC
i was actually having the same problems Morten Svendsen had (on a fresh amd64 setup).
however once i got texlive-basic build wit the .eclass-hack ( remove "||die"), i changed the eclass back to it's original state, let the rest of "app-text/texlive" emerge and re-emerged texlive-basic again. it ran through without errors this time. i really think some of the latter packages installs something vital to texlive-basic.
Comment 37 Ryan Hope 2009-10-13 17:38:19 UTC
(In reply to comment #36)
> i was actually having the same problems Morten Svendsen had (on a fresh amd64
> setup).
> however once i got texlive-basic build wit the .eclass-hack ( remove "||die"),
> i changed the eclass back to it's original state, let the rest of
> "app-text/texlive" emerge and re-emerged texlive-basic again. it ran through
> without errors this time. i really think some of the latter packages installs
> something vital to texlive-basic.
> 

yeah just did a fresh install of gentoo and STILL get this error!
Comment 38 goffrie 2009-12-02 23:36:56 UTC
I got the same error as the above two posters on my ~amd64 system. Removing the || die, emerging texlive-basic, adding the '|| die' back, and then remerging texlive-basic works.
Comment 39 Markus Luisser 2010-02-11 17:35:11 UTC
I can confirm the bug and that the '|| die' hack works on amd64. For me it happened during an upgrade not a fresh install.
Comment 40 matthias.grobarek 2010-03-11 16:56:29 UTC
I request re-opening this bug because it still remains bothersome. Users that had tetex or a working texlive installation before will never encounter this bug. But for any new Gentoo installation this problem blocks the build, resulting in subsequent blockings of packages depending on texlive (mftrace, kopete with latex support etc.).

I can also confirm that the eclass hack works, obviously as some kind of bootstrapping for texlive. It’s only needed for building texlive-basic and texlive-latex.

As far as I see this, I think it should reported to upstream because it’s their build process that fails. If texlive 2009 fixes the problem, I think it should be stabilized soon, along with making virtual/latex-base allow 2009, too (currently it demands <2009).
Comment 41 Georgi Georgiev 2010-05-10 01:37:11 UTC
I am also still getting an error that $T/.../texmf-var/web2c does not exist even with version 2009. As there are a few ideas in this bugreport I decided to look at how other distros package texlive so I checked the Fedora spec file. In there they have a "mkdir -p %{buildroot}%{_texmf_var}/web2c" (look at line 565 of http://cvs.fedoraproject.org/viewvc/rpms/texlive/F-13/texlive.spec?revision=1.61&view=markup).

So I added mkdir -p "${S}/texmf-var/web2c" to the eclass and everything worked fine.
Comment 43 oopojo 2010-06-26 17:57:03 UTC
Still broken as of today on a fresh amd64 install.
Comment 44 Felix Schuster 2010-08-30 19:09:13 UTC
(In reply to comment #43)
> Still broken as of today on a fresh amd64 install.

I can confirm this. This bug should be reopened.
Comment 45 Jeroen Roovers (RETIRED) gentoo-dev 2011-05-16 11:16:14 UTC
*** Bug 366593 has been marked as a duplicate of this bug. ***
Comment 46 Fabian Köster 2011-06-04 17:17:36 UTC
I can confirm the bug with texlive-basic-2008.

Texlive-2009 fixes the problem for me.
Comment 47 Andreas K. Hüttel archtester gentoo-dev 2011-06-05 14:26:51 UTC
Raising importance since the only stable version of texlive does not emerge at the moment (which means this pops up as a problem in all sorte of stablerequests, KDE comes to my mind...)
Comment 48 Michael 2011-06-10 16:20:48 UTC
Does anyone have a keyword file to unmask latex-2009 and its dependencies? Unable to emerge world since two weeks =S
Comment 49 Lori 2011-06-10 16:26:38 UTC
(In reply to comment #48)
> Does anyone have a keyword file to unmask latex-2009 and its dependencies?
> Unable to emerge world since two weeks =S

Another workaround, which I ended up using successfully on a new install, is Comment 27. I had to adjust line numbers in the patch, find the correct place, but it worked like a charm.
Comment 50 gentoo_bugs_collector 2011-08-11 07:36:09 UTC
Since yesterday "update world" now wants to update to texlive-2010.
I'm coming from -2008 and I failed emerge with both texlive-basic-2010 and -2009
Even a complete texlive wipe and built from scratch did not help.

However, after upgrading dev-tex/luatex first from 0.63.0 to 0.70.1
all of texlive-2010 built successfully.

So my wild guess would be to add a dependency to texlive-basic that a
minimum version of luatex is needed....
Comment 51 Krzysztof Nowicki 2011-09-23 22:40:59 UTC
It looks like the problem occurs when /usr/share/texmf/web2c/mktexdir is not executable, which can easily occur when the /usr/share partition is mounted as noexec.

On my system I don't have /usr/share mounted separately and it works. However when I removed the executable permission from that file the ebuild failed in the same way. A friend of mine also hit this problem and he confirmed that his /usr/share is mounted separately with the noexec option. After removing it the ebuild works fine.

The main issue seems to be the lack of any message indicating the true cause of the problem.
Comment 52 Alexis Ballier gentoo-dev 2011-10-06 21:01:52 UTC
(In reply to comment #51)
> It looks like the problem occurs when /usr/share/texmf/web2c/mktexdir is not
> executable, which can easily occur when the /usr/share partition is mounted as
> noexec.

well, this is true, if /usr/share/texmf is noexec, this will fail, along with a lot of other (la)tex utilities.
closing as worksforme as texlive 2010 is now stable