Control: tags -1 + patch fixed-upstream

Hi,

The s390x FTBFS in 2.2.6-1 is a big-endian bug, and upstream has
already fixed it:


https://github.com/bbuchfink/diamond/commit/093dafab9f9ecf2a0666ddd0dda48e9eff29b7c6
  (https://github.com/bbuchfink/diamond/pull/986, merged 2026-09-26, not
  in any release yet)

DatabaseFile::is_diamond_db() reads the .dmnd magic number as raw bytes
and does not convert it from the on-disk little-endian format. On s390x
the comparison fails, so diamond treats the database as FASTA, and the
build-time test fails with:

  Opening the database... Error: Error opening file test/C.faa.diamond. No
such file or directory

The commit adds the missing byteswap there and in read_seqinfo().

We have applied it in Ubuntu on top of 2.2.5-2, together with a backport
of the 2.2.6 generic FingerPrint code. The s390x build now passes, and
all 20 diamond blastp runs in debian/tests/diamond-calls complete.

The commit applies to 2.2.6 unchanged; it is the same code that Ubuntu
tested on 2.2.5. Adding it as a patch to 2.2.6-1 should fix s390x and
unblock the migration.

The patch with a DEP-3 header is attached.

Cheers,
Sebastien
Description: Add missing byteswaps when reading .dmnd databases
 is_diamond_db() read the magic number as raw bytes without converting
 it from the on-disk little-endian format, so on big-endian (s390x)
 every DIAMOND database was rejected and then opened as FASTA, failing
 with "No such file or directory". read_seqinfo() had the same problem.
Author: Pranav Karuvally
Origin: upstream, https://github.com/bbuchfink/diamond/commit/093dafab9f9ecf2a0666ddd0dda48e9eff29b7c6
Bug: https://github.com/bbuchfink/diamond/pull/986
Bug-Debian: https://bugs.debian.org/1148077
Last-Update: 2026-10-08
---
Index: diamond-aligner-2.2.5/src/legacy/dmnd/dmnd.cpp
===================================================================
--- diamond-aligner-2.2.5.orig/src/legacy/dmnd/dmnd.cpp
+++ diamond-aligner-2.2.5/src/legacy/dmnd/dmnd.cpp
@@ -111,7 +111,7 @@ void serialize(File& file, const Sequenc
 
 SequenceFile::SeqInfo DatabaseFile::read_seqinfo() {
 	SeqInfo r;
-	file_.read(r);
+	file_ >> r;
 	pos_array_offset += SeqInfo::SIZE;
 	return r;
 }
@@ -407,6 +407,7 @@ bool DatabaseFile::is_diamond_db(const s
 	File db_file(file_name, "rb");
 	uint64_t magic_number = 0;
 	db_file.read_max(&magic_number, sizeof(uint64_t));
+	magic_number = big_endian_byteswap(magic_number);
 	bool r = (magic_number == ReferenceHeader::MAGIC_NUMBER);
 	db_file.close();
 	return r;
@@ -640,4 +641,4 @@ void DatabaseFile::print_info() const {
 	*message_stream << "(type: " << to_string(type()) << ", ";
 	*message_stream << "sequences: " << sequence_count().value() << ", ";
 	*message_stream << "letters: " << letters().value() << ", build version: " << ref_header.build << ')' << endl;
-}
\ No newline at end of file
+}

Reply via email to