Bug#911965: kicad: Add libngspice to dependancy list

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#911965: kicad: Add libngspice to dependancy list

Matsievskiy S.V.
Package: kicad
Version: 5.0.1+dfsg1-2
Severity: normal

Dear Maintainer,

Circuit simulator depends on libngspice.so, provided by a libngspice0-dev
package but it's not in the dependency list. So, libngspice0-dev it should be
included in it. Or, better yet, libngspice0 should be fixed to symlink its
libngspice.so.0 file to libngspice.so and be added to dependency list instead
of the development package.



-- System Information:
Debian Release: buster/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'stable-updates'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.18.9-custom (SMP w/8 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8), LANGUAGE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages kicad depends on:
ii  libc6                   2.27-6
ii  libcairo2               1.16.0-1
ii  libcurl4                7.61.0-1
ii  libfreeimage3           3.17.0+ds1-5+b5
ii  libfreetype6            2.8.1-2
ii  libgcc1                 1:8.2.0-8
ii  libgl1                  1.1.0-1
ii  libglew2.0              2.0.0-6
ii  libglu1-mesa [libglu1]  9.0.0-2.1
ii  libice6                 2:1.0.9-2
ii  liboce-foundation11     0.18.2-3
ii  liboce-modeling11       0.18.2-3
ii  liboce-ocaf-lite11      0.18.2-3
ii  liboce-ocaf11           0.18.2-3
ii  liboce-visualization11  0.18.2-3
ii  libpixman-1-0           0.34.0-2
ii  libpython2.7            2.7.15-4
ii  libsm6                  2:1.2.2-1+b3
ii  libssl1.1               1.1.0h-4
ii  libstdc++6              8.2.0-8
ii  libwxbase3.0-0v5        3.0.4+dfsg-4
ii  libwxgtk3.0-0v5         3.0.4+dfsg-4
ii  libx11-6                2:1.6.7-1
ii  libxext6                2:1.3.3-1+b2
ii  python                  2.7.15-3
ii  python-wxgtk3.0         3.0.2.0+dfsg-8

Versions of packages kicad recommends:
ii  kicad-demos      5.0.1+dfsg1-2
ii  kicad-libraries  5.0.1+dfsg1-2
ii  xsltproc         1.1.32-2

Versions of packages kicad suggests:
ii  extra-xdg-menus                                                      1.0-4
pn  kicad-doc-ca | kicad-doc-de | kicad-doc-en | kicad-doc-es | kicad-d  <none>
pn  kicad-packages3d                                                     <none>

-- no debconf information

Reply | Threaded
Open this post in threaded view
|

Bug#911965: kicad: Add libngspice to dependancy list

Carsten Schoenert
Hello Matsievskiy,

Am 26.10.18 um 20:07 schrieb Matsievskiy S.V.:
> Circuit simulator depends on libngspice.so, provided by a libngspice0-dev
> package but it's not in the dependency list. So, libngspice0-dev it should be
> included in it. Or, better yet, libngspice0 should be fixed to symlink its
> libngspice.so.0 file to libngspice.so and be added to dependency list instead
> of the development package.

partially correct.
KiCad in Debian now supports ngspice based simulations provided by the
library libngspice.so.0.0.0 from the package libngspice0.

The question is why the packaging doesn't detect this dependency
automatically ... I will have a look.

--
Regards
Carsten Schoenert

Reply | Threaded
Open this post in threaded view
|

Bug#911965: kicad: Add libngspice to dependancy list

Matsievskiy S.V.
It didn't work with libngspice0 package on my machine. Had to install
the development package.


On 26/10/18 21:22, Carsten Schoenert wrote:

> Hello Matsievskiy,
>
> Am 26.10.18 um 20:07 schrieb Matsievskiy S.V.:
>> Circuit simulator depends on libngspice.so, provided by a libngspice0-dev
>> package but it's not in the dependency list. So, libngspice0-dev it should be
>> included in it. Or, better yet, libngspice0 should be fixed to symlink its
>> libngspice.so.0 file to libngspice.so and be added to dependency list instead
>> of the development package.
> partially correct.
> KiCad in Debian now supports ngspice based simulations provided by the
> library libngspice.so.0.0.0 from the package libngspice0.
>
> The question is why the packaging doesn't detect this dependency
> automatically ... I will have a look.
>

Reply | Threaded
Open this post in threaded view
|

Bug#911965: [Pkg-electronics-devel] Bug#911965: kicad: Add libngspice to dependancy list

Felix Salfelder
In reply to this post by Carsten Schoenert
On Fri, Oct 26, 2018 at 08:22:45PM +0200, Carsten Schoenert wrote:
> partially correct.
> KiCad in Debian now supports ngspice based simulations provided by the
> library libngspice.so.0.0.0 from the package libngspice0.
>
> The question is why the packaging doesn't detect this dependency
> automatically ... I will have a look.

Dear Carsten.

It seems to me that kicad does not link against ngspice, but rather
dlopens the shared library on demand.

While the reasons are probably different, this approach is very similar
to how gnucap-python uses libgnucap. The issue is related to the
SONAME and file name used in lib${simulator}0 vs lib${simulator}-dev.

Probably the approach used in gnucap-python will work here as well:
- find the SONAME in ./configure, tweak the dlopen call, see [1],
- tweak d/rules: link a dummy executable, inject shlibdeps [2].

I am curious if there is a better way..

hth
felix

[1] https://salsa.debian.org/electronics-team/Gnucap/gnucap-python/blob/master/configure.ac
[2] https://salsa.debian.org/electronics-team/Gnucap/gnucap-python/blob/master/debian/rules

Reply | Threaded
Open this post in threaded view
|

Bug#911965: kicad: Add libngspice to dependancy list

Carsten Schoenert
In reply to this post by Matsievskiy S.V.
Am 26.10.18 um 20:27 schrieb sergey:
> It didn't work with libngspice0 package on my machine. Had to install
> the development package.

Unfortunately you are right.
The root for this is a hardcoded lookup for the file libngspice.so
instead of libngspice.so.$API_VERSION.
Stefan Brüns provided a patch to fix this on the OpenSUSE build which I
picked up. The fix is on the way.

--
Regards
Carsten Schoenert

Reply | Threaded
Open this post in threaded view
|

Bug#911965: kicad: Add libngspice to dependancy list

Carsten Schoenert
In reply to this post by Felix Salfelder
Hello Felix,

Am 26.10.18 um 21:12 schrieb Felix Salfelder:
> It seems to me that kicad does not link against ngspice, but rather
> dlopens the shared library on demand.

that's correct, so dh_shlibdeps won't detect the needed library
automatically.

> While the reasons are probably different, this approach is very similar
> to how gnucap-python uses libgnucap. The issue is related to the
> SONAME and file name used in lib${simulator}0 vs lib${simulator}-dev.
>
> Probably the approach used in gnucap-python will work here as well:
> - find the SONAME in ./configure, tweak the dlopen call, see [1],
> - tweak d/rules: link a dummy executable, inject shlibdeps [2].
>
> I am curious if there is a better way..

The dlopen call is currently searching for libngspice.so instead of
libngspice.so.0 so your suggestion would not solve all problems. As
Stefan Brüns has the same problem within the OBS he provided a small fix
up patch which I just did picked up. So now eeschema is looking for
libngspice.so.0. For now I can live with a manually adjusted Depends
field for the kicad package. I believe upstream will fix this all so the
dlopen call can get removed at least for the Linux builds in the future,
but maybe not not for the 5.x series.

--
Regards
Carsten Schoenert

Reply | Threaded
Open this post in threaded view
|

Bug#911965: kicad: Add libngspice to dependancy list

Felix Salfelder
On Sat, Oct 27, 2018 at 10:01:29AM +0200, Carsten Schoenert wrote:
> > Probably the approach used in gnucap-python will work here as well:
> > - find the SONAME in ./configure, tweak the dlopen call, see [1],
> > - tweak d/rules: link a dummy executable, inject shlibdeps [2].
>
> The dlopen call is currently searching for libngspice.so instead of
> libngspice.so.0 so your suggestion would not solve all problems.

Hi Carsten.

I suggested to dlopen libngspice.so.0. the point is, that you need to
resolve it during configure time.

$ readelf -d /usr/lib/x86_64-linux-gnu/libngspice.so |grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libngspice.so.0]

also, the package name libngspice0-dev seems to be wrong. that should
have produced a lintian warning...?

cheers
felix

Reply | Threaded
Open this post in threaded view
|

Bug#911965: kicad: Add libngspice to dependancy list

Carsten Schoenert
Am 27.10.18 um 10:21 schrieb Felix Salfelder:

> On Sat, Oct 27, 2018 at 10:01:29AM +0200, Carsten Schoenert wrote:
>>> Probably the approach used in gnucap-python will work here as well:
>>> - find the SONAME in ./configure, tweak the dlopen call, see [1],
>>> - tweak d/rules: link a dummy executable, inject shlibdeps [2].
>>
>> The dlopen call is currently searching for libngspice.so instead of
>> libngspice.so.0 so your suggestion would not solve all problems.
>
> Hi Carsten.
>
> I suggested to dlopen libngspice.so.0. the point is, that you need to
> resolve it during configure time.
>
> $ readelf -d /usr/lib/x86_64-linux-gnu/libngspice.so |grep SONAME
>  0x000000000000000e (SONAME)             Library soname: [libngspice.so.0]

That's all correct, but right now upstream is opening libngspice.so,
*not* libngspice.so.0!
So yes, I could get the library name with the API version but this all
wouldn't create the correct depended library if we don't patch the
source. And dlopen isn't the solution we want in the end. Upstream
stated they had problems to get this working correctly (while this
feature was added in 2016) and they did the fallback to use dlopen
globally here. In the past this all doesn't really matter because
ngspice was in non-free. This has changed and I'm pretty sure this all
will get solved in the near future to a "correct" implementation.
Because of this I won't invest more time here, there is no real gain on
doing this.

> also, the package name libngspice0-dev seems to be wrong. that should
> have produced a lintian warning...?

No and it never did.

https://lintian.debian.org/full/pkg-electronics-devel@...#ngspice

Once we have a ngspice package with a API version 1 or greater we can
switch over to libngspice-dev which would be a virtual package and
depending on the most recent version of libngspice$(API_VERSION)-dev.
But I've selected this package name for reasons, it's a bit unusual,
yes. I've worked on ngspice I guess for other one year, I posted
sometimes my work here on the list but no one has raised hands. So
that's why the situation is what we see in the archive today.

Policy has no hard requirements on this.

https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#development-files

We can find various versions of package names for -dev packages.

$ grep Package:
/var/lib/apt/lists/*_debian_dists_testing_main_binary-amd64_Packages |
grep "\-dev$"

Hmm, might I change this before the final freeze of buster.

--
Regards
Carsten Schoenert

Reply | Threaded
Open this post in threaded view
|

Bug#911965: kicad: Add libngspice to dependancy list

Felix Salfelder
On Sat, Oct 27, 2018 at 11:09:47AM +0200, Carsten Schoenert wrote:
> That's all correct, but right now upstream is opening libngspice.so,
> *not* libngspice.so.0!

which i suggested to fix. in the package and (also) upstream.

> Upstream
> stated they had problems to get this working correctly (while this
> feature was added in 2016) and they did the fallback to use dlopen
> globally here.

To me, it looked more like they had good reasons not to link. and i can't
see anything wrong with calling dlopen in that situation. I did not know
anybody is even trying to change it. YMMV.

> Because of this I won't invest more time here, there is no real gain on
> doing this.

fair enough.

> > also, the package name libngspice0-dev seems to be wrong. that should
> > have produced a lintian warning...?
>
> No and it never did.
> [..]
> $ grep Package:
> /var/lib/apt/lists/*_debian_dists_testing_main_binary-amd64_Packages |
> grep "\-dev$"

My memory was corrupted on this, thanks for the clarification!

best
felix

Reply | Threaded
Open this post in threaded view
|

Bug#911965: kicad: Add libngspice to dependancy list

Carsten Schoenert
Am 27.10.18 um 11:36 schrieb Felix Salfelder:
> On Sat, Oct 27, 2018 at 11:09:47AM +0200, Carsten Schoenert wrote:
>> That's all correct, but right now upstream is opening libngspice.so,
>> *not* libngspice.so.0!
>
> which i suggested to fix. in the package and (also) upstream.

Hehe, yes I too.

Upstream has picked a patch from Stefan Brüns so this is fixed upstream.
I already have cherry-picked this into 5.0.1+dfsg1-3. The buildd's are
working ...

--
Regards
Carsten Schoenert