← Back to team overview

kicad-developers team mailing list archive

pcbnew format versioning and broken libraries

 

Hi,

Recently I pointed out that if a library contains broken, or in this case too
recent, footprints, modedit silently fails to load the library. I asked about
preferred ways to handle this, and was going to modify things such that an
actual message is displayed.

Turns out I filed a bug report on that over a year ago:
https://bugs.launchpad.net/kicad/+bug/1416736

And as Wayne points out in that bug report, this is *not* easy to fix due to
the architecture of module loading. I've been trying to come up with a graceful
way to do it all morning.

Because of this, I am going to submit my patch later today *without* addressing
this problem. The most important part of my patch is NOT that it displays
friendly error messages, but 1) that it compares format versions internally,
and 2) that it allows a (version ...) specifier also in footprints. I think it
is critical that we get it into the stable branch soon for that reason - it
makes it so that (version...) itself in a footprint is not a syntax error.

This means that with my patch applied, the user will get a friendly error
message when loading PCBs and single footprints. When loading libraries, they
will continue to fail silently, neither fixing nor adding to the current broken
behavior.

As I've already had a look at what would need to be changed to fix this, I'm
going to rework my current patch slightly to facilitate fixing it in the
future. Currently a PARSE_ERROR is still thrown when the format is too new, and
the code that catches it checks the version detected by the parser and gives
one of two error messages. Instead, I'm going to add a subclass of PARSE_ERROR
called FUTURE_FORMAT_ERROR which is thrown instead of PARSE_ERROR. This way,
when we do fix bug 1416736, we can simply let the error propagate up as far as
we need to, without still keeping a handle to the parser to check its version
number.

I don't mind fixing 1416736 myself, but it's a lot of work, so if I can drum up
a bit of support for fixing it and find someone else willing to spend a bit of
time on that, that would be wonderful.

-- 
Chris