Bug 1262746 - kf5-sonnet-core: /usr/share/kf5/sonnet/trigrams.map multilib conflict
Summary: kf5-sonnet-core: /usr/share/kf5/sonnet/trigrams.map multilib conflict
Alias: None
Product: Fedora
Classification: Fedora
Component: kf5-sonnet
Version: 22
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2015-09-14 09:17 UTC by Ambrogio
Modified: 2015-09-16 23:48 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-09-16 12:58:52 UTC
Type: Bug

Attachments (Terms of Use)

Description Ambrogio 2015-09-14 09:17:26 UTC
Description of problem:
dnf update is unable to update the kf5 sonnet component:

Version-Release number of selected component (if applicable):
Actually installed:


packages available:
 kf5-sonnet-core     i686       5.13.0-1.fc22        updates     147 k
 kf5-sonnet-core     x86_64     5.13.0-1.fc22        updates     147 k
 kf5-sonnet-ui       i686       5.13.0-1.fc22        updates     230 k
 kf5-sonnet-ui       x86_64     5.13.0-1.fc22        updates     228 k

How reproducible:
It was already present in last update, but solved with a force installation.

Steps to Reproduce:
1. dnf update
2. errors returned. No update performed

Actual results:
Esecuzione del controllo di transazione
Test di transazione eseguito con successo.
Test di transazione in corso
Errore: Errore nel controllo transazione:
  file /usr/share/kf5/sonnet/trigrams.map conflicts between attempted installs of kf5-sonnet-core-5.13.0-1.fc22.i686 and kf5-sonnet-core-5.13.0-1.fc22.x86_64

Expected results:

Additional info:

Comment 1 Rex Dieter 2015-09-14 10:33:48 UTC
Looks like some sort of multilib conflict.

Comment 2 Kevin Kofler 2015-09-14 11:21:28 UTC
> * parsetrigrams.cpp
> *
> * Parse a set of trigram files into a QHash, and serialize to stdout.

This needs the same QT_HASH_SEED workaround as the Qt documentation multilib conflicts.

Comment 3 Kevin Kofler 2015-09-14 11:22:31 UTC
I'm starting to think we need to think of a way to set QT_HASH_SEED globally for all RPM builds.

Comment 4 Rex Dieter 2015-09-14 11:24:57 UTC
We can certainly consider adding that to our standard %cmake_kf5 macro

Comment 5 Rex Dieter 2015-09-14 11:39:41 UTC
* Mon Sep 14 2015 Rex Dieter <rdieter@fedoraproject.org> 5.13.0-2
- QT_HASH_SEED=0, to workaround multilib conflicts (#1262746)

Comment 6 Rex Dieter 2015-09-14 11:55:11 UTC
Darn, that didn't seem to help, the produced trigrams.map is still different (according to diff and rpm) even after setting QT_HASH_SEED=0 during the build.

Comment 7 Kevin Kofler 2015-09-14 12:16:53 UTC
Try this change to data/parsetrigrams.cpp:
>    QStringList files = td.entryList(QDir::Files);
+ files.sort() // ← add this here (line 48)
>    Q_FOREACH (const QString& fname, files) {

Comment 8 Kevin Kofler 2015-09-14 12:17:33 UTC
(in addition to the QT_HASH_SEED=0 trick, which is also needed)

Comment 9 Rex Dieter 2015-09-14 13:12:34 UTC
This patch didn't help either  :(

diff -up sonnet-5.13.0/data/parsetrigrams.cpp.multilib sonnet-5.13.0/data/parsetrigrams.cpp
--- sonnet-5.13.0/data/parsetrigrams.cpp.multilib       2015-08-04 06:47:13.000000000 -0500
+++ sonnet-5.13.0/data/parsetrigrams.cpp        2015-09-14 07:42:41.906870766 -0500
@@ -45,6 +45,7 @@ int main(int argc, char **argv)
     QHash< QString, QHash<QString,int> > models;
     QStringList files = td.entryList(QDir::Files);
+    files.sort();
     Q_FOREACH (const QString& fname, files) {

Comment 10 Kevin Kofler 2015-09-14 19:06:14 UTC
Hard to tell what else can be non-deterministic. :-( I'm going to have a closer look at the files.

Comment 11 Kevin Kofler 2015-09-14 19:12:03 UTC
At least in kf5-sonnet-5.13.0-2.fc24, the issue is indeed an ordering issue.

Comment 12 Kevin Kofler 2015-09-14 19:20:30 UTC
What you can try, which should also obviate the need both for QT_HASH_SEED and for the files.sort() patch (so you should be able to remove both of those), is to replace all uses of QHash in parsetrigrams.cpp with QMap:
sed -i -e 's/QHash/QMap/g' data/parsetrigrams.cpp
They have the same QDataStream representation, so the code that reads the .map file should not care either way, and QMap has a fixed ordering.

Comment 13 Rex Dieter 2015-09-15 18:52:37 UTC
OK, that hack worked, thanks.

Comment 14 Rex Dieter 2015-09-15 18:55:45 UTC
* Tue Sep 15 2015 Rex Dieter <rdieter@fedoraproject.org> 5.13.0-3
- try harder, use QMap instead of QHash to workaround multilib conflicts (#1262746)


This change will get rolled into kf5-5.14.0 updates coming soon (probably over the next few days)

Comment 15 Kevin Kofler 2015-09-16 02:54:23 UTC
You forgot to "git add sonnet-5.13.0-multilib.patch".

Comment 16 Daniel Vrátil 2015-09-16 12:58:52 UTC
Added the missing patch to 5.14.0-1 build

Comment 17 Kevin Kofler 2015-09-16 23:48:11 UTC
You also need to replace the #included header file. It's just luck that it compiles that way. (Something else must be dragging in <QMap>.) Really, I don't understand why you don't just use my one-line sed, which does a reliable global search&replace and never needs to be rebased.

Note You need to log in before you can comment on or make changes to this bug.