.mod file doesn't show parts

Bug #1752719 reported by Dave Vandenbout
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
High
Jeff Young

Bug Description

I'm using KiCad Windows nightly on Windows 7 Professional:

Application: kicad
Version: (5.0.0-rc2-dev-40-gfef1ba999), release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.60.0
    Curl: 7.54.1
    Compiler: GCC 7.1.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=ON

I've downloaded a footprint for an HDMI socket from SnapEDA. The footprint is stored in a .mod file. I added the .mod file to my footprint table both manually and using the footprint library wizard. When I select the library to browse the footprints, none are shown. No error messages are displayed.

I retried this using an Eagle .lbr file. Same result: library shows no parts.

I looked in both the .mod and .lbr files and there does appear to be a part stored in there.

Revision history for this message
Dave Vandenbout (devb) wrote :
Revision history for this message
Seth Hillbrand (sethh) wrote :

You will need to rename the file to have extension ".emp"

Then, in the footprint editor, import the footprint (This is the icon with the light blue arrow pointing into the footprint icon).

Once you have imported it, you can save it into a library and add the library to your footprint library table.

Let us know if this procedure does not work for you.

Changed in kicad:
status: New → Incomplete
Revision history for this message
Dave Vandenbout (devb) wrote :

Thanks, that worked.

Revision history for this message
Seth Hillbrand (sethh) wrote :

Glad to hear. Also good to know that SnapEDA is serving legacy footprints. Did they give you the .mod extension?

Changed in kicad:
status: Incomplete → Invalid
Revision history for this message
Dave Vandenbout (devb) wrote :

Yes, they provided the HDMI socket as a .mod file. I don't know if that was an aberration or not.

Changed in kicad:
status: Invalid → Triaged
importance: Undecided → High
Revision history for this message
Seth Hillbrand (sethh) wrote :

@Wayne- What did I miss here? Would you like to add .mod to the recognized extensions for legacy footprints?

Revision history for this message
Nick Østergaard (nickoe) wrote :

Mmm, hasn't the .mod used for the legacy forever? What is that .emp then?

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1752719] Re: .mod file doesn't show parts

Every plugin supported by fp-lib-table should be honored not just kicad
libraries. This *is* the whole point of the board plugins. Who ever
broke this, please fix it. You can no longer open, legacy, eagle, or
geda footprint libraries. Also, fp-lib-table is designed for lazy
loading. The only time every footprint library needs to be loaded is in
the symbol chooser when the the footprint viewer is enable. There is no
reason to load every footprint elsewhere so if that has changed as well
it needs to be fixed.

On 03/02/2018 11:55 AM, Seth Hillbrand wrote:
> @Wayne- What did I miss here? Would you like to add .mod to the
> recognized extensions for legacy footprints?
>

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

FYI, I'm in the process of doing a git bisect to figure out where all
this go broken but I would rather be working on my bugs for rc2 rather
than fixing something that got broke.

On 03/02/2018 11:55 AM, Seth Hillbrand wrote:
> @Wayne- What did I miss here? Would you like to add .mod to the
> recognized extensions for legacy footprints?
>

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

.mod is the legacy kicad footprint library file format. I believe .emp
is the same format but only contains a single footprint. I was used for
export and import of footprints.

On 03/02/2018 12:15 PM, Nick Østergaard wrote:
> Mmm, hasn't the .mod used for the legacy forever? What is that .emp
> then?
>

Revision history for this message
Jeff Young (jeyjey) wrote :

@Wayne, this probably got broken in the performance stuff. I can take a look at it soon.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Yet another data point. If I intentionally create an invalid file path in the footprint library table, I get no indication that the file is invalid in the viewer when I click on broken library link.

Jeff Young (jeyjey)
Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
Jeff Young (jeyjey)
Changed in kicad:
status: Triaged → In Progress
Revision history for this message
Jeff Young (jeyjey) wrote :

The default timestamp for plugins that didn't implement timestamping was backwards (it always looked fresh rather than always stale).

I then discovered that an always-stale library anywhere in your table will defeat the second-level caching (at the FOOTPRINT_LIST level), so I went ahead and implemented timestamping for all the plugins.

Changed in kicad:
milestone: none → 5.0.0-rc2
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

FYI, the .mod file supplied with this bug report works just fine. Git bisect shows the commit that broke this was 7bd2f1434.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

On my todo list for v6 is factor out the common library caching code so
the can be reused. If you notice, it's pretty much the same code for
the two types of caching. There is the one file with multiple items
cache and the one item per file in a folder cache. It's pretty much
been a copy and paste exercise to create the various library caches.

On 03/02/2018 03:45 PM, Jeff Young wrote:
> The default timestamp for plugins that didn't implement timestamping was
> backwards (it always looked fresh rather than always stale).
>
> I then discovered that an always-stale library anywhere in your table
> will defeat the second-level caching (at the FOOTPRINT_LIST level), so I
> went ahead and implemented timestamping for all the plugins.
>
> ** Changed in: kicad
> Milestone: None => 5.0.0-rc2
>

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 33d925f631c6f5a1c551e404dfacf0bbd08ba971
https://git.launchpad.net/kicad/patch/?id=33d925f631c6f5a1c551e404dfacf0bbd08ba971

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Jeff Young (jeyjey) wrote :

BTW, I tested with the provided .mod file, but I don't have any gEDA or Eagle files. If someone could post some (or run a quick test themselves), that would be great.

Revision history for this message
Seth Hillbrand (sethh) wrote :

Segfault on Eagle library. Attached.

Revision history for this message
Seth Hillbrand (sethh) wrote :
Download full text (11.7 KiB)

The library is added to my project symbol library table using the wizard. I then open the footprint editor and browse to the library.

Backtrace (other threads follow):

#0 0x00007ffff29ef678 in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#1 0x00007ffff29f8bdc in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#2 0x00007ffff29f8fbf in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#3 0x00007ffff302ca60 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#4 0x00007ffff29e2c05 in g_object_unref () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5 0x00007ffff6c6cbfa in wxWindow::~wxWindow() () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#6 0x00007ffff6d00327 in ?? () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#7 0x00007ffff6e564d7 in wxWindowBase::Destroy() () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#8 0x00007ffff6e56515 in wxWindowBase::DestroyChildren() () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#9 0x00007ffff6c6cb67 in wxWindow::~wxWindow() () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#10 0x00007fffcf40f1ea in DIALOG_SHIM::~DIALOG_SHIM (this=0x7fffffffbcf0, __in_chrg=<optimized out>) at /home/seth/code/kicad/kicad-launchpad/common/dialog_shim.cpp:93
#11 0x00007fffcf3b5d7d in DIALOG_GET_COMPONENT_BASE::~DIALOG_GET_COMPONENT_BASE (this=0x7fffffffbcf0, __in_chrg=<optimized out>)
    at /home/seth/code/kicad/kicad-launchpad/common/dialogs/dialog_get_component_base.cpp:90
#12 0x00007fffced2f48e in DIALOG_GET_COMPONENT::~DIALOG_GET_COMPONENT (this=0x7fffffffbcf0, __in_chrg=<optimized out>) at /home/seth/code/kicad/kicad-launchpad/include/dialog_get_component.h:54
#13 0x00007fffced2cc96 in PCB_BASE_FRAME::LoadModuleFromLibrary (this=0x5555574b4820, aLibrary=..., aTable=0x55555abd1030, aUseFootprintViewer=true, aDC=0x0)
    at /home/seth/code/kicad/kicad-launchpad/pcbnew/load_select_footprint.cpp:178
#14 0x00007fffcecff4aa in FOOTPRINT_EDIT_FRAME::Process_Special_Functions (this=0x5555574b4820, event=...) at /home/seth/code/kicad/kicad-launchpad/pcbnew/footprint_editor_utils.cpp:527
#15 0x00007ffff634440e in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#16 0x00007ffff64c9ea5 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#17 0x00007ffff64c9f9b in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#18 0x00007ffff64ca34b in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#19 0x00007fffcf435ca4 in EDA_BASE_FRAME::ProcessEvent (this=0x5555574b4820, aEvent=...) at /home/seth/code/kicad/kicad-launchpad/common/eda_base_frame.cpp:191
#20 0x00007ffff64ca153 in wxEvtHandler::DoTryChain(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#21 0x00007ffff64ca435 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#22 0x00007ffff6e562f8 in wxWindowBase::TryAf...

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Here are all of the the geda libraries that I have.

Revision history for this message
Jeff Young (jeyjey) wrote :

When I ran the Footprint Table Wizard on the Eagle file it auto-recognised it (ie: set the plugin type correctly).

When I loaded the gEDA files it didn't. (It defaulted to the Kicad plugin.)

Is this expected?

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 8e1d397587776901bdd2d86953a5575943308144
https://git.launchpad.net/kicad/patch/?id=8e1d397587776901bdd2d86953a5575943308144

Revision history for this message
Seth Hillbrand (sethh) wrote :

Looks good Jeff, that fixed it for me. Thanks!

Changed in kicad:
status: Fix Committed → New
Revision history for this message
jean-pierre charras (jp-charras) wrote :

I reopen this bug because after this fix (tested on W7 32 bits):
* When trying to add a .mod lib using the wizard, the wizard crashes sometimes as soon as the .mod file is selected (not easy to reproduce).
* Geda files are not listed

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Sorry for the noise:
For the Geda lib, it could be an issue in a footprint that prevent reading the full lib
For the wizrad crash, it happened twice, but I cannot reproduce it.
It could be not related to the commit.

Changed in kicad:
status: New → Fix Committed
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.