eeschema: ngspice - load versioned library (patch available)

Bug #1785798 reported by Damian Wrobel
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Unassigned

Bug Description

eeschema tries to load on Unix machines "libngspice.so" file:

m_dll.Load( wxDynamicLibrary::CanonicalizeName( "ngspice" ) );

however, this file is usually provided by -devel[1] sub-package and not by the ngspice package. Additionally loading unversioned "libngspice.so" doesn't guarantee that eeschema will load ABI compatible shared library as it might point to "libngspice.so.1" which might not be totally incompatible with .so.0 version.

The attached patch proposes to load versioned "libngspice.so.0" on Unix machines.

[1] https://src.fedoraproject.org/fork/dwrobel/rpms/ngspice/blob/ngspice-shared/f/ngspice.spec#_358

Tags: ngspice fedora
Revision history for this message
Damian Wrobel (dwrobel) wrote :

Patch tested successfully on Fedora 28 with kicad v5.0.0 [2].

[2] https://copr.fedorainfracloud.org/coprs/dwrobel/kicad/build/785261/

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

@Damian, your patch does not solve the issue you reported. By using a hard coded shared object version number (0 in this case), there is no guarantee that when the next version of the shared object is released that this wont break either. The only way I know to guarantee the correct shared object gets loaded at run time is to determine the shared object used during the build configuration and set the shared object name accordingly.

Changed in kicad:
status: New → Triaged
importance: Undecided → Low
tags: added: fedora
Revision history for this message
Damian Wrobel (dwrobel) wrote :

>The only way I know to guarantee...
In practice, this wouldn't prevents you, in any way, from upstream which will break the API without soname bump.

>there is no guarantee that when the next version of the shared object is released that this wont break either.

But with the patch, if it breaks, it means that API (probably) has changed and you simply need to recompile the kicad (or provide appropriate version if kicad is expecting a newer version). On the other hand you will see a popup that you don't have an appropriate library instead of situation in which kicad will blindly try to load e.g. .so.1 via .so symlink and possibly crash.

Revision history for this message
Aimylios (aimylios) wrote :
Changed in kicad:
status: Triaged → Fix Committed
milestone: none → 5.1.0
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.