Bug 204397 - PATH variable not used for running programs (like pdflatex)
Summary: PATH variable not used for running programs (like pdflatex)
Status: RESOLVED FIXED
Alias: None
Product: kile
Classification: Applications
Component: general (show other bugs)
Version: 2.0.82
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Michel Ludwig
URL:
Keywords:
: 244727 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-19 13:24 UTC by ocarsten
Modified: 2010-07-16 09:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ocarsten 2009-08-19 13:24:03 UTC
Version:           2.0.82 (using Devel)
OS:                Linux
Installed from:    Compiled sources

Hi.

I'm running OpenSuse 11.0 with the KDE4.3.

For some reasons I have installed TexLive2007 from the repository. Additionally I have an installation (not by rpm) of TexLive2008, which I do prefer to use.

When choosing 'compile with pdflatex' in kile (v2.0.82), by default the TexLive2007 is used and I get errors like "xxx.sty not found". 
But running  pdflatex from console everything is fine, because here TexLive2008 is used and all packages are found.

My Path setting is: PATH="....:/usr/data/TexLive/2008/bin/i386-linux:....:/usr/bin:/usr/bin/X11:....."

The only solution I have, set explicitly the path to pdflatex (and all the other programs) in the kile-settings dialog.
But exists there an other solution?

Cheers,
Carsten
Comment 1 Thomas Braun 2009-08-19 21:45:00 UTC
Can you give the exact kile version you are using?

Is there a differnce between starting kile from F2 or a konsole?
Comment 2 ocarsten 2009-08-20 09:23:12 UTC
(In reply to comment #1)
> Can you give the exact kile version you are using?

rpm -qa | grep kile -->  kile-2.0.81.svn1010674-6.1

> 
> Is there a difference between starting kile from F2 or a konsole?

No.
But when starting kile from konsole, the without a "&" an closing it
again, the konsole is still blocked. But this certainly an other problem.
Comment 3 Thomas Braun 2009-08-20 09:27:30 UTC
What kile version do you have?
Either kile-2.0.81.svn1010674-6.1 or 2.0.82 (as given in the first comment)?

In the former case please upgarde to 2.1 beta1. We fixed this bug there.
Comment 4 ocarsten 2009-08-20 09:33:29 UTC
(In reply to comment #3)
> What kile version do you have?
> Either kile-2.0.81.svn1010674-6.1 or 2.0.82 (as given in the first comment)?
> 
> In the former case please upgarde to 2.1 beta1. We fixed this bug there.

The About dialog says 2.0.82 - the rpm version kile-2.0.81.svn1010674-6.1 instead.
But thanks for for your comments.
Comment 5 Thomas Braun 2009-08-20 09:41:31 UTC
If About says 2.0.82 you have the most current version :)
Could you try the procedure described in https://bugs.kde.org/show_bug.cgi?id=191090#c3 and give the output?
Comment 6 ocarsten 2009-08-20 11:04:48 UTC
(In reply to comment #5)
> If About says 2.0.82 you have the most current version :)
> Could you try the procedure described in
> https://bugs.kde.org/show_bug.cgi?id=191090#c3 and give the output?

I made a scipt to "echo $PATH":
running it from konsole EchoPath.sh  shows:
/home/user/colbrich/bin:/usr/local/Gromacs/i686-pc-linux-gnu/bin:/usr/data/TexLive/2008/bin/i386-linux:/usr/data/CopSoft/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/X11R6/bin:/usr/bin/X11:/opt/bin:/opt/kde3/bin

Running it from Kile  (Build->Other->EchoPathTool):
*****
*****     EchoPathTool output: 
*****     cd "/home/user/colbrich/toSomeWhere"
*****     sh /home/user/colbrich/EchoPath.sh
*****
/home/user/colbrich/bin:/usr/local/Gromacs/i686-pc-linux-gnu/bin:/usr/data/TexLive/2008/bin/i386-linux:/usr/data/CopSoft/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/X11R6/bin:/usr/bin/X11:/opt/bin:/opt/kde3/bin
Comment 7 Thomas Braun 2009-08-20 11:29:01 UTC
Well I don't understand atm why you get different results in kile and with the konsole while having the same $PATH variable.
Comment 8 ocarsten 2009-08-20 12:31:59 UTC
Maybe following might help:
Running the "System Check" each test is passed,
but there the correct pdflatex is used (at least it is stated with the correct path: /usr/data/TexLive/2008/bin/i386-linux/pdflatex)
/usr/data/TexLive/2008/bin/i386-linux/pdflatex --version | head -n 1 :
  pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6)
/usr/bin/pdflatex --version | head - n 1 : 
  pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6)

Output from kile:
*****
*****     PDFLaTeX output: 
*****     cd "/home/user/colbrich/toSomeWhere"
*****     pdflatex -interaction=nonstopmode 'poster.tex'
*****
This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6)
....
! LaTeX Error: File `beamerposter.sty' not found.
...
Comment 9 ocarsten 2009-08-20 12:34:01 UTC
SORRY - I copied the wrong verion:

Maybe following might help:
Running the "System Check" each test is passed,
but there the correct pdflatex is used (at least it is stated with the correct path: /usr/data/TexLive/2008/bin/i386-linux/pdflatex)
/usr/data/TexLive/2008/bin/i386-linux/pdflatex --version | head -n 1 :
  pdfTeX 3.1415926-1.40.9-2.2 (Web2C 7.5.7)
/usr/bin/pdflatex --version | head - n 1 : 
  pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6)

Output from kile:
*****
*****     PDFLaTeX output: 
*****     cd "/home/user/colbrich/toSomeWhere"
*****     pdflatex -interaction=nonstopmode 'poster.tex'
*****
This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6)
....
! LaTeX Error: File `beamerposter.sty' not found.
...
Comment 10 Thomas Braun 2009-08-21 00:22:42 UTC
I just tried to reproduce your problem and I didn't suceed.
If I add an executable file called pdflatex in a folder in front of my PATH directories, this modified pdflatex file is executed instead of the one in /usr/bin.
Comment 11 ocarsten 2009-08-21 08:48:05 UTC
(In reply to comment #10)
> I just tried to reproduce your problem and I didn't suceed.
> If I add an executable file called pdflatex in a folder in front of my PATH
> directories, this modified pdflatex file is executed instead of the one in
> /usr/bin.

Strange...
OK, I will follow the development of kile ...
Nevertheless, if you have some ideas for testing some issues, don't hesitate to contact me
Comment 12 deroshkin 2010-03-14 01:23:13 UTC
I'd like to confirm the presence of this bug, both in Kile 2.1 beta 3 shipped with Mandriva 2010.0 and in SVN revision 1102925.

Some details of my setup/situation:

I have texlive 2009 installed manually in /usr/local/texlive and texlive 2007 installed in /usr from Mandriva repositories.

My PATH variable begins with: /usr/local/texlive/2009/bin/x86_64-linux:/usr/bin:...

When pdflatex is run in konsole, the following line is output first:
"This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009)"

When run in kile, the following line is output instead:
"This is pdfTeXk, Version 3.141592-1.40.5 (Web2C 7.5.6)"
This line is identical to the line output by running /usr/bin/pdflatex.

However, when I run a system check inside kile, it indicates the use of /usr/local/texlive/2009/... version of pdflatex.
Comment 13 Michel Ludwig 2010-05-22 17:03:20 UTC
(In reply to comment #12)
> I'd like to confirm the presence of this bug, both in Kile 2.1 beta 3 shipped
> with Mandriva 2010.0 and in SVN revision 1102925.
> 

Which version of kdelibs are you using (Help / About KDE)?
Comment 14 mi 2010-06-04 20:16:28 UTC
I can confirm that behavior with the current svn version.

Although echoPath prints the correct path information ...
/home/mi/opt/texlive/texlive2007/2007/bin/i386-linux:/home/mi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

... kile uses the pdflatex which is shipped with the distribution.

If I change the the command to "`which pdflatex`" it works like it should.


I'm using kdelibs5 4.4.4.
Comment 15 Michel Ludwig 2010-06-04 23:07:06 UTC
SVN commit 1134664 by mludwig:

Don't use 'KProcess::setShellCommand' as that method uses 'KStandardDirs::findExe'
which doesn't respect the path preferences given by the user. 'KStandardDirs::findExe' is happy
to return the first executable it finds, for example, in '/usr/bin' although the user maybe didn't
want to use that directory and he/she had changed the $PATH variable accordingly.

BUG: 204397


 M  +28 -4     kilelauncher.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1134664
Comment 16 Michel Ludwig 2010-06-04 23:09:27 UTC
Can someone please try out the latest SVN version and check whether the commit above also fixes the problem for his/her setup? Thanks.
Comment 17 mi 2010-06-06 23:12:31 UTC
works for me. Thanks.

By the way. This was my patch suggestion:

142a143,152
>               /* prevent setShellCommand/findExe searching for the standard executables paths in the first place by giving the absolute path */
>               /* bug 204397 */
>               QStringList qstrlist;
>               int ret = 0;
>               retnr = KStandardDirs::findAllExe(qstrlist, m_cmd);
>               if(ret == 0) {
>                       return false;
>               }
>               m_cmd = qstrlist.takeFirst();
>
Comment 18 schloenvogt 2010-07-16 09:51:03 UTC
*** Bug 244727 has been marked as a duplicate of this bug. ***