← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Look in PATH for binaries

 

On Sat, Jul 21, 2012 at 11:26:17PM +0300, Denis Kuzmenko wrote:

> when I launch freshly built kicad and try to open schematic it says
> "Command <eeschema> not found".
> With my patch I can avoid that:
> export PATH=$PATH:`pwd`/eeschema/
> kicad/kicad

A more 'correct' way is to do:

PATH=`pwd`/eeschema/:$PATH kicad

because a) it find the local eeschema even if there is another one in the path and b) it doesn't pollute the shell path.

> But I failed how to manage that with ldconfig command. Can you give me
> some hints? Should I add `pwd`/eeschema/ to the library cache?

ldconfig is for .so libs only. For staged binary the usual method is *exactly* that you're doing, i.e. a temporary path (sometimes even whole temporary environments!) usually in a launcher shell script.

For examples look at the launcher for firefox or openoffice, or even at most libtooled stuff before install.

I don't get a thing: your patch looks into the system path, so it does the same thing the system should be doing anyway... *why* it doesn't find it just setting the path env?

Are fork/exec equivalents (wxExecute maybe?) of wx doing thing differently from execvp? *If* wxExecute search in the PATH you patch is not necessary...

Oh and, by the way, wxwidget doesn't correctly release the process leader: if you sigint kicad from a terminal even the spawned eeschema/pcbnew/whatever goes down. It's a posix finesse and you won't notice starting it detached from a terminal.

Maybe wxEXEC_MAKE_GROUP_LEADER in wxExecute could fix it? (assuming wxExecute is used to launch the other programs...)

BTW I also found an old kicad-dev about other problems in wx process spawning (http://osdir.com/ml/kicad-developers-EDA/2012-01/msg00085.html)

-- 
Lorenzo Marcantonio
Logos Srl


Follow ups

References