[Debian-med-packaging] Bug#1153099: canu: Please use Debian packaged libparasail-dev instead of the code copy shipped with canu

Cheng Li shiptux at gmail.com
Mon Nov 9 12:34:41 GMT 2026


Control: tags -1 + patch

Hi Andreas,

Patches below. Smaller than I expected: canu barely uses the code copy.

Only its scalar part is ever built -- the SIMD kernels are commented
out of SOURCES, the sg_*_dispatch.c dispatchers can therefore never be
linked, and the driver passes parasail_sg_qb_de_trace directly. cpuid.c
is compiled but never called, and compiling it is exactly what fails on
architectures that are neither x86, ARM nor PowerPC. So the FTBFS is at
compile time, and dropping the file from SOURCES retires nonx86.patch.

canu uses 16 symbols, all public in parasail.h, and the signatures and
struct layouts it touches are byte-identical between the embedded 2.4.2
and Debian's 2.6.2.

What I checked:

- A behavioural comparison: the same ten-case harness built twice
  against align-parasail-driver, once against libparasail.so.8 and once
  against the embedded 2.4.2 compiled into a static archive the way
  canu does it. Cases cover exact overlaps, mismatches, insertions,
  deletions, homopolymers, no real overlap, and both entry points
  (sg_qb_de and sg_qx). Comparing score, length, matches, mismatches,
  gaps, all four coordinates and the error rate: identical in all ten.

- A full binary build, sbuild in unshare mode against sid. All seven
  patches apply cleanly and the build succeeds.

- That the de-vendoring actually takes effect: dpkg-shlibdeps picks up
  Depends: libparasail8 (>= 2.4.1) on its own, utgcns gains a NEEDED
  entry for libparasail.so.8 and eleven dynamic parasail symbols, and
  it shrinks by 60 KiB against the 2.3+dfsg-2 binary in the archive.
  utgcns is the only binary affected, which matches unitigConsensus.C
  being the only non-test consumer.

Lintian reports unreleased-changes and two NMU warnings, but those come
from my own test changelog entry (UNRELEASED, and I am not the
maintainer), not from the change. The only patch-related tag is an
informational patch-not-forwarded-upstream.

Two things worth noting.

This makes nothing faster -- canu deliberately calls the scalar entry
point and the patch keeps that. The striped kernels do become available
once the system library is used, but that is a separate question.

The patch also drops -DHAVE_ALTIVEC=1 and -DHAVE_NEON=1 from
debian/rules. Those macros have no consumer outside the embedded
parasail and never took effect anyway: config.h redefines both to 0
after the command line and raises them only under MACHINETYPE_arm64 /
MACHINETYPE_pcc64el, which is never defined (src/Makefile:159 is
commented out, and the ppc64el spelling is wrong). Happy to drop that
hunk if you would rather keep it separate.

Upstream this belongs to marbl/meryl-utility rather than canu -- the
code copy is still there, and unlike canu that repository is still
maintained (last push 2026-10-10). I have not forwarded it yet.

What I have not done: no non-x86 build, and no autopkgtest run.

Kind regards,
Cheng Li


debian/patches/libparasail (new; drop debian/patches/nonx86.patch)
==================================================================

Author: Cheng Li <shiptux at gmail.com>
Description: use the system parasail instead of the embedded code copy
 src/utility/ is a copy of marbl/meryl-utility, which embeds a 41-file
 subset of parasail 2.4.2.  Only the scalar part of it is ever built:
 the SIMD kernels (sg_trace_striped_*, memory_{sse,avx2,neon,altivec})
 are commented out of SOURCES, so the sg_*_dispatch.c dispatchers can
 never be linked, and cpuid.c is compiled but never called.  Compiling
 cpuid.c is exactly what breaks the build on architectures that are
 neither x86, ARM nor PowerPC, which is why nonx86.patch existed.
 .
 Debian's parasail 2.6.2 builds on every architecture canu targets (and
 on armhf and i386 as well).  Every declaration and both struct layouts
 canu touches are identical between 2.4.2 and 2.6.2, so this is a link
 change rather than a port.
 .
 This keeps the same algorithm: align-parasail-driver.H passes the
 scalar parasail_sg_qb_de_trace / parasail_sg_qx_trace entry points, with
 the striped variants commented out upstream.  Those kernels do become
 available once the system library is used, but switching to them is a
 separate question and not part of this change.
 .
 The right place for this upstream is marbl/meryl-utility, which still
 carries the code copy and is still maintained, rather than canu itself.
Bug-Debian: https://bugs.debian.org/1153099
Forwarded: no
Last-Update: 2026-11-09

--- a/src/main.mk
+++ b/src/main.mk
@@ -58,15 +58,6 @@
                 utility/src/math/mt19937ar-v1.C \
                 utility/src/math/sampledDistribution-v1.C \
                 \
-                utility/src/parasail/cpuid.c \
-                utility/src/parasail/cigar.c \
-                utility/src/parasail/memory.c \
-                utility/src/parasail/sg.c \
-                utility/src/parasail/sg_trace.c \
-                utility/src/parasail/sg_qb_de_dispatch.c \
-                utility/src/parasail/sg_qe_db_dispatch.c \
-                utility/src/parasail/sg_qx_dispatch.c \
-                \
                 utility/src/sequence/dnaSeq-v1.C \
                 utility/src/sequence/bufSeqFile-v1.C \
                 utility/src/sequence/htsSeqFile-v1.C \
@@ -178,7 +169,7 @@
 
 SYS_INCDIRS  += $(shell pkg-config --cflags-only-I openssl libcurl liblzma | sed s:-I/:/:g)
 LDFLAGS      += $(shell pkg-config --libs-only-L   openssl libcurl liblzma)
-LDLIBS       += $(shell pkg-config --libs-only-l   openssl libcurl liblzma) -lz -lbz2 -lsnappy -lbacktrace
+LDLIBS       += $(shell pkg-config --libs-only-l   openssl libcurl liblzma) -lz -lbz2 -lsnappy -lbacktrace -lparasail
 
 SUBMAKEFILES := stores/dumpBlob.mk \
                 stores/ovStoreBuild.mk \
--- a/src/utility/src/align/align-parasail-driver.H
+++ b/src/utility/src/align/align-parasail-driver.H
@@ -22,7 +22,7 @@
 
 #include "system.H"
 
-#include "../parasail/parasail.h"
+#include <parasail.h>
 
 //  A simple wrapper around parasail (https://github.com/jeffdaily/parasail).
 //

debian/control, debian/patches/series, debian/rules
====================================================

--- a/debian/control
+++ b/debian/control
@@ -7,6 +7,7 @@
                libboost-dev,
                libmeryl-dev,
                libsnappy-dev,
+               libparasail-dev,
 # For File::Path
                libfilesys-df-perl,
                mhap,
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,4 +4,4 @@
 spelling
 do-not-trust-errno-on-success.patch
 mhap-needs-commons-io.patch
-nonx86.patch
+libparasail
--- a/debian/rules
+++ b/debian/rules
@@ -9,20 +9,12 @@
 export CFLAGS := $(CPPFLAGS) $(CFLAGS)
 export CXXFLAGS := $(CPPFLAGS) $(CXXFLAGS)
 
-ifeq (ppc64el,$(DEB_HOST_ARCH))
-export CFLAGS += -DHAVE_ALTIVEC=1
-export CXXFLAGS += -DHAVE_ALTIVEC=1
-endif
-ifeq (arm64,$(DEB_HOST_ARCH))
-export CFLAGS += -DHAVE_NEON=1
-export CXXFLAGS += -DHAVE_NEON=1
-endif
-
 %:
 	dh $@ --sourcedirectory=src/
 
 override_dh_auto_build:
-	rm -Rf src/utility/src/utility/libbacktrace src/stores/libsnappy
+	rm -Rf src/utility/src/utility/libbacktrace src/stores/libsnappy \
+	       src/utility/src/parasail
 	dh_auto_build
 	find build \
 	-name OverlapMhap.pm \



More information about the Debian-med-packaging mailing list