gnetlist may not find backends installed by pcb

Bug #700311 reported by Peter TB Brett on 2011-01-08
This bug affects 7 people
Affects Status Importance Assigned to Milestone
gEDA project

Bug Description

 affects pcb

PCB is distributed with a gnetlist backend, 'gnet-pcbfwd.scm'. This
backend is used by PCB's 'Import' action to update a PCB layout from a
set of schematic files.

PCB's build process installs this backend to
'${pcb-prefix}/share/gEDA/scheme'. By default, gnetlist searches
'${geda-prefix}/share/gEDA/scheme' for backends. As long as
'${pcb-prefix}' is the same as '${geda-prefix}', the 'Import' action
will work as expected.

However, if '${pcb-prefix}' is *different* to '${geda-prefix}', gnetlist
can't find the backend. For example, this situation can arise if a user
has installed PCB from a distribution package (to '/usr') and has
installed gEDA from git (to '$HOME/geda', say).

Both 1.6.x and unstable gnetlist will fail with non-zero exit status if
they cannot load the backend.

There are two possible solutions:

 - Develop 'gnet-pcbfwd.scm' as part of gEDA rather than as part of PCB.
   This has the advantage of ensuring that it will be installed to the
   correct place and will be kept up-to-date with changes to gnetlist,
   but has the disadvantage that it may get out of sync with PCB's

 - Assuming the user has a version of gEDA newer than Jan 6 2011, pass
   '-L ${pcb-prefix}/share/gEDA/scheme' to gnetlist to add to the search
   path used to find backends. This has the disadvantage that it
   requires the user to have a very up-to-date version of gEDA. If you
   pass an '-L' option to the gEDA 1.6.x version of gnetlist, it will
   output on stderr:

       gnetlist: invalid option -- 'L'

   and exit with status 0.

There is no workaround for this bug with gEDA 1.6.x or earlier. In
1.6.x, the '(scheme-directory)' configuration option replaces rather
than adds to the path searched for Scheme files, so if a user put

    (scheme-directory "${PCB_PREFIX}/share/gEDA/scheme/")

in one of his gEDA rc files, gnetlist would still fail due to not being
able to load 'gnetlist.scm'.

My preferred solution would be:

 1) Try and run gnetlist without an '-L' option.

 2) If that fails, try and run gnetlist with an -L option, and try and
    detect whether it worked by looking at its stderr output.

 3) If that fails, ask the user to manually install 'gnet-pcbfwd.scm' to
    somewhere gnetlist can find it, or upgrade gnetlist.

It is *not* a solution to assume that the '${geda-prefix}' can be
determined at compile and/or install time.

Peter Clifton (pcjc2) on 2011-01-12
Changed in pcb:
status: New → Confirmed
Peter Clifton (pcjc2) on 2011-01-14
tags: added: core gnetlist
Peter TB Brett (peter-b) wrote :

Since people run into this bug about every 15 minutes (it's turning into a FAQ), I'm bumping it to High importance.

Changed in pcb:
importance: Undecided → High
Traumflug (mah-jump-ing) on 2015-09-27
Changed in geda-project:
importance: Undecided → High
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers