Bug 1262746
| Summary: | kf5-sonnet-core: /usr/share/kf5/sonnet/trigrams.map multilib conflict | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Ambrogio <ambrogio.de.lorenzo> |
| Component: | kf5-sonnet | Assignee: | Rex Dieter <rdieter> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 22 | CC: | dvratil, jgrulich, kevin, ltinkl, rdieter, than |
| Target Milestone: | --- | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-09-16 12:58:52 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Ambrogio
2015-09-14 09:17:26 UTC
Looks like some sort of multilib conflict. > * 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.
I'm starting to think we need to think of a way to set QT_HASH_SEED globally for all RPM builds. We can certainly consider adding that to our standard %cmake_kf5 macro %changelog * Mon Sep 14 2015 Rex Dieter <rdieter> 5.13.0-2 - QT_HASH_SEED=0, to workaround multilib conflicts (#1262746) 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. 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) { (in addition to the QT_HASH_SEED=0 trick, which is also needed) 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) {
Hard to tell what else can be non-deterministic. :-( I'm going to have a closer look at the files. At least in kf5-sonnet-5.13.0-2.fc24, the issue is indeed an ordering issue. 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. OK, that hack worked, thanks. %changelog * Tue Sep 15 2015 Rex Dieter <rdieter> 5.13.0-3 - try harder, use QMap instead of QHash to workaround multilib conflicts (#1262746) closing->rawhide This change will get rolled into kf5-5.14.0 updates coming soon (probably over the next few days) You forgot to "git add sonnet-5.13.0-multilib.patch". Added the missing patch to 5.14.0-1 build 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. |