I sat down to have a look at this, and struggled to figure out what the
package is actually trying to do in its build.

There's some wacky stuff going on, which isn't actually working, so I
started by trimming that out, and enabling set -e.

> dh_missing: warning: lib/python3.9/libpyferret.so exists in debian/tmp but is 
> not installed to anywhere (related file: 
> "debian/tmp/lib/python3.8/libpyferret.so")

From what I can see, this library is a symlink, created for other
libraries to link to, but not installing under that name, only as a
Python C extension.

With the attached patchset, I can get it to build with 3.8 and 3.9,
which gets us to the same state as unstable, which is totally broken:

$ pyferret3
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/pyferret/__init__.py", line 75, in 
<module>
    from pyferret import libpyferret
ImportError: 
/usr/lib/python3/dist-packages/pyferret/libpyferret.cpython-38-x86_64-linux-gnu.so:
 undefined symbol: load_dsg_mask_ftrset_var_
>>>

Then there's all the shared libraries in
/usr/lib/ferret-vis/external_functions/pylibs that want to link to
libpyferret:

$ ldd /usr/lib/ferret-vis/external_functions/pylibs/subtract.so
        linux-vdso.so.1 (0x00007ffdd76ad000)
        libeatmydata.so => /usr/lib/x86_64-linux-gnu/libeatmydata.so 
(0x00007f30e9d3d000)
        libpyferret.so => not found
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f30e9d37000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f30e9b72000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f30e9d4f000)

I don't know what's supposed to use those, but they probably shouldn't
be linking to a library that isn't installed.

If there are plugins like this that need to link to C Python Extensions,
I don't know if it makes any sense to build pyferret for multiple Python
versions. But I don't know enough about the package, to understand
exactly what they are for, and how they're meant to be linked.

So... Some patches attached that get us to the broken status-quo of
unstable, but not sure that that's a useful place to be. I'm certainly
not going to NMU them.

I'd have filed an MR, but the git repo is out of date...

SR

-- 
Stefano Rivera
  http://tumbleweed.org.za/
  +1 415 683 3272
From e6f7f375be676af36ce19c0e2e2057ba55d84094 Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stef...@rivera.za.net>
Date: Fri, 16 Oct 2020 23:01:16 -0700
Subject: [PATCH 1/4] debian/rules: set -e; before any multi-command lines.

---
 debian/changelog | 7 +++++++
 debian/rules     | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 7c959ea..977e734 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+pyferret (7.6.3-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * debian/rules: set -e; before any multi-command lines.
+
+ -- Stefano Rivera <stefa...@debian.org>  Fri, 16 Oct 2020 23:00:38 -0700
+
 pyferret (7.6.3-1) unstable; urgency=medium
 
   * New upstream release
diff --git a/debian/rules b/debian/rules
index 5ba46b2..5c7c0f2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -41,6 +41,7 @@ override_dh_auto_install:
 	# Horrible hack breaks The Debian Way. I'm doing the build in the 'install' phase, as i'm installing into debian/tmp
 	# Doing it any earlier, and dh_prep will remove debian/tmp. 
 	# This means I'm also doing 'test' after the Install, not between during make & install. gack.
+	set -e; \
 	for p in $(PY3) ; do \
 		mkdir -p $(INSTALLDIR)/lib/$$p ; \
 		cp $(CURDIR)/install/lib/$$p/site-packages//pyferret/libpyferret.cpython-$$l-$(ARCH).so \
@@ -57,6 +58,7 @@ override_dh_auto_install:
 	@echo "Now doing bench tests"
 	ln -s debian/pyferret3  $(INSTALLDIR)/lib/$(shell py3versions -d)/pyferret
 	# First build necessary files
+	set -e; \
 	for p in  $(PY3) ; do \
 		sed -e 's%@ARCH@%${ARCH}%' \
                 -e 's%@LIBDIR@%${LIBDIR}%' \
-- 
2.28.0

From 626a273af6853f66e5e989df539e53dcd31a3e7f Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stef...@rivera.za.net>
Date: Fri, 16 Oct 2020 23:01:53 -0700
Subject: [PATCH 2/4] debian/rules: Drop cp that wasn't executing, because
 there is no "l" variable.

---
 debian/changelog | 2 ++
 debian/rules     | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 977e734..79073a0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ pyferret (7.6.3-1.1) UNRELEASED; urgency=medium
 
   * Non-maintainer upload.
   * debian/rules: set -e; before any multi-command lines.
+  * debian/rules: Drop cp that wasn't executing, because there is no "l"
+    variable.
 
  -- Stefano Rivera <stefa...@debian.org>  Fri, 16 Oct 2020 23:00:38 -0700
 
diff --git a/debian/rules b/debian/rules
index 5c7c0f2..75b0854 100755
--- a/debian/rules
+++ b/debian/rules
@@ -44,8 +44,6 @@ override_dh_auto_install:
 	set -e; \
 	for p in $(PY3) ; do \
 		mkdir -p $(INSTALLDIR)/lib/$$p ; \
-		cp $(CURDIR)/install/lib/$$p/site-packages//pyferret/libpyferret.cpython-$$l-$(ARCH).so \
-			$(INSTALLDIR)/lib/$$p ; \
 		n=`echo $$p | tr -d 'python' | tr -d '.' ` ; \
                 ln -s  $(CURDIR)/install/lib/$$p/site-packages//pyferret/libpyferret.cpython-$$n-$(ARCH).so \
                    $(INSTALLDIR)/lib/$$p/libpyferret.so ; \
-- 
2.28.0

From 8260df7d9aaa7742e3ed87656e177fecf121bbd1 Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stef...@rivera.za.net>
Date: Fri, 16 Oct 2020 23:03:15 -0700
Subject: [PATCH 3/4] debian/rules: Drop INSTALLDIR, it wasn't understood by
 the Makefile.

---
 debian/changelog | 1 +
 debian/rules     | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 79073a0..4bca304 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ pyferret (7.6.3-1.1) UNRELEASED; urgency=medium
   * debian/rules: set -e; before any multi-command lines.
   * debian/rules: Drop cp that wasn't executing, because there is no "l"
     variable.
+  * debian/rules: Drop INSTALLDIR, it wasn't understood by the Makefile.
 
  -- Stefano Rivera <stefa...@debian.org>  Fri, 16 Oct 2020 23:00:38 -0700
 
diff --git a/debian/rules b/debian/rules
index 75b0854..cce933f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -47,8 +47,7 @@ override_dh_auto_install:
 		n=`echo $$p | tr -d 'python' | tr -d '.' ` ; \
                 ln -s  $(CURDIR)/install/lib/$$p/site-packages//pyferret/libpyferret.cpython-$$n-$(ARCH).so \
                    $(INSTALLDIR)/lib/$$p/libpyferret.so ; \
-		mkdir -p debian/tmp-$$p ; \
-		$(MAKE) HOSTTYPE=debian PYTHON_EXE=$$p INSTALLDIR=debian/tmp-$$p clean all install ; \
+		$(MAKE) HOSTTYPE=debian PYTHON_EXE=$$p clean all install ; \
 		done
 	find debian \( -name '*.pyo' -o -name '*.pyc' \) -delete
 	find debian -type d -name __pycache__ -delete
-- 
2.28.0

From 7c0fed016238f94ee9f42a25adf0f05a10106dce Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stef...@rivera.za.net>
Date: Fri, 16 Oct 2020 23:23:59 -0700
Subject: [PATCH 4/4] debian/rules: Remove unversionsed symlink libpyferret.so
 after building the extensions that link to it. (Closes: #972340)

---
 debian/changelog | 2 ++
 debian/rules     | 1 +
 2 files changed, 3 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 4bca304..2af894a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ pyferret (7.6.3-1.1) UNRELEASED; urgency=medium
   * debian/rules: Drop cp that wasn't executing, because there is no "l"
     variable.
   * debian/rules: Drop INSTALLDIR, it wasn't understood by the Makefile.
+  * debian/rules: Remove unversionsed symlink libpyferret.so after building
+    the extensions that link to it. (Closes: #972340)
 
  -- Stefano Rivera <stefa...@debian.org>  Fri, 16 Oct 2020 23:00:38 -0700
 
diff --git a/debian/rules b/debian/rules
index cce933f..a41265b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -48,6 +48,7 @@ override_dh_auto_install:
                 ln -s  $(CURDIR)/install/lib/$$p/site-packages//pyferret/libpyferret.cpython-$$n-$(ARCH).so \
                    $(INSTALLDIR)/lib/$$p/libpyferret.so ; \
 		$(MAKE) HOSTTYPE=debian PYTHON_EXE=$$p clean all install ; \
+		rm $(INSTALLDIR)/lib/$$p/libpyferret.so; \
 		done
 	find debian \( -name '*.pyo' -o -name '*.pyc' \) -delete
 	find debian -type d -name __pycache__ -delete
-- 
2.28.0

Reply via email to