* [bug#65922] [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests
@ 2023-09-13 16:56 Maxim Cournoyer
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 1/4] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
` (6 more replies)
0 siblings, 7 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-13 16:56 UTC (permalink / raw)
To: 65922; +Cc: Maxim Cournoyer, Andreas Enge, 宋文武
Thes series removes Python from the closure of qtbase, both for versions 5.15
and 6.5. It also reinstate a few tests that was made possible thanks to
discussions with upstream following reported the issues.
Changes in v2:
- Also apply fix to qtbase-5 package.
Maxim Cournoyer (4):
gnu: qtbase: Do not capture Python (again).
gnu: qtbase: Add $TZDIR to native search paths.
gnu: qtbase: Reinstate date related tests.
gnu: qtdeclarative: Add a debug output.
gnu/packages/patches/qtbase-use-TZDIR.patch | 162 ++++++++++++++++----
gnu/packages/qt.scm | 54 ++++---
2 files changed, 167 insertions(+), 49 deletions(-)
base-commit: 4cb2e08b8eb1acc824b72ec17b483d7d85b5af68
--
2.41.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH 1/4] gnu: qtbase: Do not capture Python (again).
2023-09-13 16:56 [bug#65922] [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
@ 2023-09-13 16:58 ` Maxim Cournoyer
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 2/4] gnu: qtbase: Add $TZDIR to native search paths Maxim Cournoyer
` (5 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-13 16:58 UTC (permalink / raw)
To: 65922; +Cc: Maxim Cournoyer, Andreas Enge, 宋文武
Fixes <https://issues.guix.gnu.org/65457>.
* gnu/packages/qt.scm (qtbase-5) [arguments]: Add #:disallowed-references
argument to guard against the problem reoccurring in the future.
Add do-not-capture-python phase.
(qtbase) [arguments]: Update do-not-capture-python phase.
---
Changes in v2:
- Also apply fix to qtbase-5 package.
gnu/packages/qt.scm | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index b7e394d663c..a158f8114fe 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -392,7 +392,7 @@ (define-public qtbase-5
fontconfig
freetype
glib
- gtk+ ;for GTK theme support
+ gtk+ ;for GTK theme support
harfbuzz
icu4c
libinput-minimal
@@ -437,7 +437,8 @@ (define-public qtbase-5
vulkan-headers
ruby-2.7))
(arguments
- `(#:configure-flags
+ `(#:disallowed-references ,(list python)
+ #:configure-flags
(let ((out (assoc-ref %outputs "out")))
(list "-verbose"
"-prefix" out
@@ -583,7 +584,16 @@ (define-public qtbase-5
(("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b)
(string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))
(("^\\s*(xcursorLib.setFileName\\(QLatin1String\\(\")(Xcursor\"\\)\\);)" _ a b)
- (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))))))))
+ (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b)))))
+ (add-after 'install 'do-not-capture-python
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; For some reason, patching the file after the
+ ;; patch-source-shebangs phase doesn't work for Qt 5.
+ (substitute*
+ (search-input-file
+ outputs "lib/qt5/mkspecs/features/uikit/devices.py")
+ (((which "python3"))
+ "/usr/bin/env python3")))))))
(native-search-paths
(list (search-path-specification
(variable "QMAKEPATH")
@@ -724,10 +734,12 @@ (define-public qtbase
(substitute* "src/corelib/CMakeLists.txt"
(("/bin/ls")
(search-input-file inputs "bin/ls")))))
+ (delete 'do-not-capture-python) ;move after patch-source-shebangs
(add-after 'patch-source-shebangs 'do-not-capture-python
(lambda _
(substitute* '("mkspecs/features/uikit/devices.py"
- "util/testrunner/qt-testrunner.py")
+ "util/testrunner/qt-testrunner.py"
+ "util/testrunner/sanitizer-testrunner.py")
(((which "python3"))
"/usr/bin/env python3"))))
(replace 'configure
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH 2/4] gnu: qtbase: Add $TZDIR to native search paths.
2023-09-13 16:56 [bug#65922] [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 1/4] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
@ 2023-09-13 16:58 ` Maxim Cournoyer
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 3/4] gnu: qtbase: Reinstate date related tests Maxim Cournoyer
` (4 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-13 16:58 UTC (permalink / raw)
To: 65922; +Cc: Maxim Cournoyer, Andreas Enge, 宋文武
* gnu/packages/qt.scm (qtbase) [native-search-paths]: Add $TZDIR.
---
(no changes since v1)
gnu/packages/qt.scm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index a158f8114fe..8324beef6fc 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -60,6 +60,7 @@ (define-module (gnu packages qt)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix deprecation)
+ #:use-module (guix search-paths)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages bash)
@@ -933,6 +934,7 @@ (define-public qtbase
(search-path-specification
(variable "QT_PLUGIN_PATH")
(files '("lib/qt6/plugins")))
+ $TZDIR
(search-path-specification
(variable "XDG_DATA_DIRS")
(files '("share")))
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH 3/4] gnu: qtbase: Reinstate date related tests.
2023-09-13 16:56 [bug#65922] [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 1/4] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 2/4] gnu: qtbase: Add $TZDIR to native search paths Maxim Cournoyer
@ 2023-09-13 16:58 ` Maxim Cournoyer
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 4/4] gnu: qtdeclarative: Add a debug output Maxim Cournoyer
` (3 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-13 16:58 UTC (permalink / raw)
To: 65922; +Cc: Maxim Cournoyer, Andreas Enge, 宋文武
* gnu/packages/qt.scm (qtbase) [native-inputs]: Add tzdata-for-tests.
[arguments]: Set the TZDIR and TZ environment variables, and reinstate the
tst_qdate, tst_qtimezone and tst_qdatetime tests in the check phase.
* gnu/packages/patches/qtbase-use-TZDIR.patch: Refresh patch with upstream
version.
---
(no changes since v1)
gnu/packages/patches/qtbase-use-TZDIR.patch | 162 ++++++++++++++++----
gnu/packages/qt.scm | 31 ++--
2 files changed, 148 insertions(+), 45 deletions(-)
diff --git a/gnu/packages/patches/qtbase-use-TZDIR.patch b/gnu/packages/patches/qtbase-use-TZDIR.patch
index b6c377b133c..98bf7493e9f 100644
--- a/gnu/packages/patches/qtbase-use-TZDIR.patch
+++ b/gnu/packages/patches/qtbase-use-TZDIR.patch
@@ -1,39 +1,141 @@
-Use $TZDIR to search for time-zone data. Thus avoid depending on package
-"tzdata", which often introduces changes with near-immediate effects, so it's
-important to be able to update it fast.
+From 1075606f8b2f9e153c82f8e50cbd69cea9c72e87 Mon Sep 17 00:00:00 2001
+From: Edward Welbourne <edward.welbourne@qt.io>
+Date: Mon, 11 Sep 2023 11:41:39 +0200
+Subject: [PATCH] Support the TZDIR environment variable
-Based on a patch fron NixOS.
-===================================================================
---- qtbase-opensource-src-5.14.2.orig/src/corelib/time/qtimezoneprivate_tz.cpp
-+++ qtbase-opensource-src-5.15.2/src/corelib/time/qtimezoneprivate_tz.cpp
-@@ -70,7 +70,11 @@
- // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
+On Linux / glibc, this overrides the default system location for the
+zone info. So check for files there first. Break out a function to
+manage the trying of (now three) zoneinfo directories when opening a
+file by name relative to there.
+
+Pick-to: 6.6 6.5
+Task-number: QTBUG-116017
+Change-Id: I1f97107aabd9015c0a5543639870f1d70654ca67
+---
+* Rebased on top of v6.5.2.
+
+ src/corelib/time/qtimezoneprivate_tz.cpp | 73 ++++++++++++++++--------
+ 1 file changed, 49 insertions(+), 24 deletions(-)
+
+diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
+index 067191d816..a8b2fc894e 100644
+--- a/src/corelib/time/qtimezoneprivate_tz.cpp
++++ b/src/corelib/time/qtimezoneprivate_tz.cpp
+@@ -51,17 +51,41 @@ typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
+
+ static bool isTzFile(const QString &name);
+
++// Open a named file under the zone info directory:
++static bool openZoneInfo(QString name, QFile *file)
++{
++ // At least on Linux / glibc (see man 3 tzset), $TZDIR overrides the system
++ // default location for zone info:
++ const QString tzdir = qEnvironmentVariable("TZDIR");
++ if (!tzdir.isEmpty()) {
++ file->setFileName(QDir(tzdir).filePath(name));
++ if (file->open(QIODevice::ReadOnly))
++ return true;
++ }
++ // Try modern system path first:
++ constexpr auto zoneShare = "/usr/share/zoneinfo/"_L1;
++ if (tzdir != zoneShare && tzdir != zoneShare.chopped(1)) {
++ file->setFileName(zoneShare + name);
++ if (file->open(QIODevice::ReadOnly))
++ return true;
++ }
++ // Fall back to legacy system path:
++ constexpr auto zoneLib = "/usr/lib/zoneinfo/"_L1;
++ if (tzdir != zoneLib && tzdir != zoneLib.chopped(1)) {
++ file->setFileName(zoneShare + name);
++ if (file->open(QIODevice::ReadOnly))
++ return true;
++ }
++ return false;
++}
++
+ // Parse zone.tab table for territory information, read directories to ensure we
+ // find all installed zones (many are omitted from zone.tab; even more from
+ // zone1970.tab).
static QTzTimeZoneHash loadTzTimeZones()
{
- QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
-+ // Try TZDIR first, in case we're running on GuixSD.
-+ QString path = QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/zone.tab");
-+ // Fallback to traditional paths in case we are not on GuixSD.
-+ if (!QFile::exists(path))
-+ path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
- if (!QFile::exists(path))
- path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+- if (!QFile::exists(path))
+- path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+-
+- QFile tzif(path);
+- if (!tzif.open(QIODevice::ReadOnly))
++ QFile tzif;
++ if (!openZoneInfo("zone.tab"_L1, &tzif))
+ return QTzTimeZoneHash();
-@@ -645,6 +649,9 @@
+ QTzTimeZoneHash zonesHash;
+@@ -91,6 +115,7 @@ static QTzTimeZoneHash loadTzTimeZones()
+ }
+ }
+
++ const QString path = tzif.fileName();
+ const qsizetype cut = path.lastIndexOf(u'/');
+ Q_ASSERT(cut > 0);
+ const QDir zoneDir = QDir(path.first(cut));
+@@ -761,20 +786,13 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
+ tzif.setFileName(QStringLiteral("/etc/localtime"));
if (!tzif.open(QIODevice::ReadOnly))
- return;
- } else {
-+ // Try TZDIR first, in case we're running on GuixSD.
-+ tzif.setFileName(QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/") + QString::fromLocal8Bit(ianaId));
-+ if (!tzif.open(QIODevice::ReadOnly)) {
- // Open named tz, try modern path first, if fails try legacy path
- tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
- if (!tzif.open(QIODevice::ReadOnly)) {
-@@ -652,6 +659,7 @@
- if (!tzif.open(QIODevice::ReadOnly))
- return;
+ return ret;
+- } else {
+- // Open named tz, try modern path first, if fails try legacy path
+- tzif.setFileName("/usr/share/zoneinfo/"_L1 + QString::fromLocal8Bit(ianaId));
+- if (!tzif.open(QIODevice::ReadOnly)) {
+- tzif.setFileName("/usr/lib/zoneinfo/"_L1 + QString::fromLocal8Bit(ianaId));
+- if (!tzif.open(QIODevice::ReadOnly)) {
+- // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
+- auto check = validatePosixRule(ianaId);
+- if (check.isValid) {
+- ret.m_hasDst = check.hasDst;
+- ret.m_posixRule = ianaId;
+- }
+- return ret;
+- }
++ } else if (!openZoneInfo(QString::fromLocal8Bit(ianaId), &tzif)) {
++ // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
++ auto check = validatePosixRule(ianaId);
++ if (check.isValid) {
++ ret.m_hasDst = check.hasDst;
++ ret.m_posixRule = ianaId;
++ return ret;
}
-+ }
}
- QDataStream ds(&tzif);
+@@ -1317,7 +1335,8 @@ private:
+ {
+ // On most distros /etc/localtime is a symlink to a real file so extract
+ // name from the path
+- const auto zoneinfo = "/zoneinfo/"_L1;
++ const QString tzdir = qEnvironmentVariable("TZDIR");
++ constexpr auto zoneinfo = "/zoneinfo/"_L1;
+ QString path = QStringLiteral("/etc/localtime");
+ long iteration = getSymloopMax();
+ // Symlink may point to another symlink etc. before being under zoneinfo/
+@@ -1325,9 +1344,15 @@ private:
+ // symlink, like America/Montreal pointing to America/Toronto
+ do {
+ path = QFile::symLinkTarget(path);
+- int index = path.indexOf(zoneinfo);
+- if (index >= 0) // Found zoneinfo file; extract zone name from path:
+- return QStringView{ path }.mid(index + zoneinfo.size()).toUtf8();
++ // If it's a zoneinfo file, extract the zone name from its path:
++ int index = tzdir.isEmpty() ? -1 : path.indexOf(tzdir);
++ if (index >= 0) {
++ const auto tail = QStringView{ path }.sliced(index + tzdir.size()).toUtf8();
++ return tail.startsWith(u'/') ? tail.sliced(1) : tail;
++ }
++ index = path.indexOf(zoneinfo);
++ if (index >= 0)
++ return QStringView{ path }.sliced(index + zoneinfo.size()).toUtf8();
+ } while (!path.isEmpty() && --iteration > 0);
+
+ return QByteArray();
+
+base-commit: af457a9f0f7eb1a2a7d11f495da508faab91a442
+--
+2.41.0
+
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 8324beef6fc..d6255248c2a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -747,7 +747,8 @@ (define-public qtbase
(assoc-ref %standard-phases 'configure))
(delete 'check) ;move after patch-prl-files
(add-after 'patch-prl-files 'check
- (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
+ (lambda* (#:key tests? parallel-tests?
+ native-inputs inputs #:allow-other-keys)
(when tests?
;; The tests expect to find the modules provided by this
;; package; extend the environment variables needed to do so.
@@ -770,6 +771,18 @@ (define-public qtbase
;; /tree/src/testlib/qtestblacklist.cpp).
(setenv "QTEST_ENVIRONMENT" "linux ci 32bit")
(setenv "HOME" "/tmp") ;some tests require a writable HOME
+
+ ;; Note: the search path specified for TZDIR is only
+ ;; effective for users of the package, not while it's being
+ ;; built.
+ (setenv "TZDIR" (search-input-directory
+ (or native-inputs inputs) "share/zoneinfo"))
+
+ ;; This is to avoid QTimeZone::systemTimeZone() returning
+ ;; invalid QDate objects due to missing /etc/timezone or
+ ;; /etc/localtime.
+ (setenv "TZ" "Etc/UTC")
+
(invoke
"xvfb-run" "ctest" "--output-on-failure"
"-j" (if parallel-tests?
@@ -783,11 +796,6 @@ (define-public qtbase
;; The 'tst_moc' test fails with "'fi.exists()' returned FALSE".
"tst_moc"
- ;; The 'tst_qdate' test fails because the current time
- ;; is reported as an invalid date (see:
- ;; https://bugreports.qt.io/browse/QTBUG-116017).
- "tst_qdate"
-
;; The qgraphicsview and qopenglwidget tests fail with a
;; segfault for unknown reasons (see:
;; https://bugreports.qt.io/browse/QTBUG-116018).
@@ -826,14 +834,6 @@ (define-public qtbase
;; The 'test_import_plugins' fails with "Could NOT find
;; Qt6MockPlugins1".
"test_import_plugins"
- ;; The 'tst_QTimeZone::systemZone' validates the
- ;; currently set timezone and fails.
- "tst_qtimezone"
- ;; The 'tst_qdatetime' fails with:
- ;; FAIL! : tst_QDateTime::offsetFromUtc() Compared values are not the same
- ;; Actual (dt5.offsetFromUtc()): 0
- ;; Expected (46800) : 46800
- "tst_qdatetime"
;; The tst_QObjectRace::destroyRace is flaky (see:
;; https://bugreports.qt.io/browse/QTBUG-103489).
"tst_qobjectrace"
@@ -910,7 +910,8 @@ (define-public qtbase
(("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)))))))))
(native-inputs
(modify-inputs (package-native-inputs qtbase-5)
- (prepend wayland-protocols
+ (prepend tzdata-for-tests
+ wayland-protocols
xvfb-run)))
(inputs
(modify-inputs (package-inputs qtbase-5)
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH 4/4] gnu: qtdeclarative: Add a debug output.
2023-09-13 16:56 [bug#65922] [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
` (2 preceding siblings ...)
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 3/4] gnu: qtbase: Reinstate date related tests Maxim Cournoyer
@ 2023-09-13 16:58 ` Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
` (2 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-13 16:58 UTC (permalink / raw)
To: 65922; +Cc: Maxim Cournoyer, Andreas Enge, 宋文武
* gnu/packages/qt.scm (qtdeclarative) [outputs]: New field.
---
(no changes since v1)
gnu/packages/qt.scm | 1 +
1 file changed, 1 insertion(+)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index d6255248c2a..ed9d813756a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -1350,6 +1350,7 @@ (define-public qtdeclarative
(base32
"06c7xfqn2a5s2m8j1bcvx3pyjqg1rgqkjvp49737gb4z9vjiz8gk"))
(patches (search-patches "qtdeclarative-disable-qmlcache.patch"))))
+ (outputs '("out" "debug"))
(build-system cmake-build-system)
(arguments
(list
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v2 0/4] Avoid capturing python in qtbase, reinstate tests
2023-09-13 16:56 [bug#65922] [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
` (3 preceding siblings ...)
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 4/4] gnu: qtdeclarative: Add a debug output Maxim Cournoyer
@ 2023-09-13 17:33 ` Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 1/4] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
` (3 more replies)
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 0/5] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
2023-10-16 21:45 ` bug#65922: [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
6 siblings, 4 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-13 17:33 UTC (permalink / raw)
To: 65922
Cc: Maxim Cournoyer, Maxim Cournoyer, Andreas Enge,
宋文武
Thes series removes Python from the closure of qtbase, both for versions 5.15
and 6.5. It also reinstate a few tests that was made possible thanks to
discussions with upstream following reported the issues.
Changes in v2:
- Use old TZDIR patch for qtbase@5 (the new one doesn't apply)
Maxim Cournoyer (4):
gnu: qtbase: Do not capture Python (again).
gnu: qtbase: Add $TZDIR to native search paths.
gnu: qtbase: Reinstate date related tests.
gnu: qtdeclarative: Add a debug output.
gnu/local.mk | 1 +
gnu/packages/patches/qtbase-5-use-TZDIR.patch | 39 +++++
gnu/packages/patches/qtbase-use-TZDIR.patch | 162 ++++++++++++++----
gnu/packages/qt.scm | 56 +++---
4 files changed, 208 insertions(+), 50 deletions(-)
create mode 100644 gnu/packages/patches/qtbase-5-use-TZDIR.patch
base-commit: 4cb2e08b8eb1acc824b72ec17b483d7d85b5af68
--
2.41.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v2 1/4] gnu: qtbase: Do not capture Python (again).
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
@ 2023-09-13 17:33 ` Maxim Cournoyer
2023-09-14 9:07 ` Andreas Enge
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 2/4] gnu: qtbase: Add $TZDIR to native search paths Maxim Cournoyer
` (2 subsequent siblings)
3 siblings, 1 reply; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-13 17:33 UTC (permalink / raw)
To: 65922
Cc: Maxim Cournoyer, Maxim Cournoyer, Andreas Enge,
宋文武
Fixes <https://issues.guix.gnu.org/65457>.
* gnu/packages/qt.scm (qtbase-5) [arguments]: Add #:disallowed-references
argument to guard against the problem reoccurring in the future.
Add do-not-capture-python phase.
(qtbase) [arguments]: Update do-not-capture-python phase.
---
(no changes since v1)
gnu/packages/qt.scm | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index b7e394d663c..a158f8114fe 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -392,7 +392,7 @@ (define-public qtbase-5
fontconfig
freetype
glib
- gtk+ ;for GTK theme support
+ gtk+ ;for GTK theme support
harfbuzz
icu4c
libinput-minimal
@@ -437,7 +437,8 @@ (define-public qtbase-5
vulkan-headers
ruby-2.7))
(arguments
- `(#:configure-flags
+ `(#:disallowed-references ,(list python)
+ #:configure-flags
(let ((out (assoc-ref %outputs "out")))
(list "-verbose"
"-prefix" out
@@ -583,7 +584,16 @@ (define-public qtbase-5
(("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b)
(string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))
(("^\\s*(xcursorLib.setFileName\\(QLatin1String\\(\")(Xcursor\"\\)\\);)" _ a b)
- (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))))))))
+ (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b)))))
+ (add-after 'install 'do-not-capture-python
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; For some reason, patching the file after the
+ ;; patch-source-shebangs phase doesn't work for Qt 5.
+ (substitute*
+ (search-input-file
+ outputs "lib/qt5/mkspecs/features/uikit/devices.py")
+ (((which "python3"))
+ "/usr/bin/env python3")))))))
(native-search-paths
(list (search-path-specification
(variable "QMAKEPATH")
@@ -724,10 +734,12 @@ (define-public qtbase
(substitute* "src/corelib/CMakeLists.txt"
(("/bin/ls")
(search-input-file inputs "bin/ls")))))
+ (delete 'do-not-capture-python) ;move after patch-source-shebangs
(add-after 'patch-source-shebangs 'do-not-capture-python
(lambda _
(substitute* '("mkspecs/features/uikit/devices.py"
- "util/testrunner/qt-testrunner.py")
+ "util/testrunner/qt-testrunner.py"
+ "util/testrunner/sanitizer-testrunner.py")
(((which "python3"))
"/usr/bin/env python3"))))
(replace 'configure
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v2 2/4] gnu: qtbase: Add $TZDIR to native search paths.
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 1/4] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
@ 2023-09-13 17:33 ` Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 3/4] gnu: qtbase: Reinstate date related tests Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 4/4] gnu: qtdeclarative: Add a debug output Maxim Cournoyer
3 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-13 17:33 UTC (permalink / raw)
To: 65922
Cc: Maxim Cournoyer, Maxim Cournoyer, Andreas Enge,
宋文武
* gnu/packages/qt.scm (qtbase) [native-search-paths]: Add $TZDIR.
---
(no changes since v1)
gnu/packages/qt.scm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index a158f8114fe..8324beef6fc 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -60,6 +60,7 @@ (define-module (gnu packages qt)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix deprecation)
+ #:use-module (guix search-paths)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages bash)
@@ -933,6 +934,7 @@ (define-public qtbase
(search-path-specification
(variable "QT_PLUGIN_PATH")
(files '("lib/qt6/plugins")))
+ $TZDIR
(search-path-specification
(variable "XDG_DATA_DIRS")
(files '("share")))
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v2 3/4] gnu: qtbase: Reinstate date related tests.
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 1/4] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 2/4] gnu: qtbase: Add $TZDIR to native search paths Maxim Cournoyer
@ 2023-09-13 17:33 ` Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 4/4] gnu: qtdeclarative: Add a debug output Maxim Cournoyer
3 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-13 17:33 UTC (permalink / raw)
To: 65922
Cc: Maxim Cournoyer, Maxim Cournoyer, Andreas Enge,
宋文武
* gnu/packages/qt.scm (qtbase) [native-inputs]: Add tzdata-for-tests.
[arguments]: Set the TZDIR and TZ environment variables, and reinstate the
tst_qdate, tst_qtimezone and tst_qdatetime tests in the check phase.
(qtbase-5) [source]: Replace qtbase-use-TZDIR.patch with
qtbase-5-use-TZDIR.patch.
* gnu/packages/patches/qtbase-use-TZDIR.patch: Refresh patch with upstream
version, and preserve the old one for qtbase@5 as...
* gnu/packages/patches/qtbase-5-use-TZDIR.patch: ... this.
* gnu/local.mk (dist_patch_DATA): Register new patch.
---
Changes in v2:
- Use old TZDIR patch for qtbase@5 (the new one doesn't apply)
gnu/local.mk | 1 +
gnu/packages/patches/qtbase-5-use-TZDIR.patch | 39 +++++
gnu/packages/patches/qtbase-use-TZDIR.patch | 162 ++++++++++++++----
gnu/packages/qt.scm | 33 ++--
4 files changed, 189 insertions(+), 46 deletions(-)
create mode 100644 gnu/packages/patches/qtbase-5-use-TZDIR.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 4f8637418ad..2d8ddf5716c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1878,6 +1878,7 @@ dist_patch_DATA = \
%D%/packages/patches/qtbase-absolute-runpath.patch \
%D%/packages/patches/qtbase-moc-ignore-gcc-macro.patch \
%D%/packages/patches/qtbase-qmake-use-libname.patch \
+ %D%/packages/patches/qtbase-5-use-TZDIR.patch \
%D%/packages/patches/qtbase-use-TZDIR.patch \
%D%/packages/patches/qtscript-disable-tests.patch \
%D%/packages/patches/quagga-reproducible-build.patch \
diff --git a/gnu/packages/patches/qtbase-5-use-TZDIR.patch b/gnu/packages/patches/qtbase-5-use-TZDIR.patch
new file mode 100644
index 00000000000..b6c377b133c
--- /dev/null
+++ b/gnu/packages/patches/qtbase-5-use-TZDIR.patch
@@ -0,0 +1,39 @@
+Use $TZDIR to search for time-zone data. Thus avoid depending on package
+"tzdata", which often introduces changes with near-immediate effects, so it's
+important to be able to update it fast.
+
+Based on a patch fron NixOS.
+===================================================================
+--- qtbase-opensource-src-5.14.2.orig/src/corelib/time/qtimezoneprivate_tz.cpp
++++ qtbase-opensource-src-5.15.2/src/corelib/time/qtimezoneprivate_tz.cpp
+@@ -70,7 +70,11 @@
+ // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
+ static QTzTimeZoneHash loadTzTimeZones()
+ {
+- QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
++ // Try TZDIR first, in case we're running on GuixSD.
++ QString path = QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/zone.tab");
++ // Fallback to traditional paths in case we are not on GuixSD.
++ if (!QFile::exists(path))
++ path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
+ if (!QFile::exists(path))
+ path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+
+@@ -645,6 +649,9 @@
+ if (!tzif.open(QIODevice::ReadOnly))
+ return;
+ } else {
++ // Try TZDIR first, in case we're running on GuixSD.
++ tzif.setFileName(QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/") + QString::fromLocal8Bit(ianaId));
++ if (!tzif.open(QIODevice::ReadOnly)) {
+ // Open named tz, try modern path first, if fails try legacy path
+ tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
+ if (!tzif.open(QIODevice::ReadOnly)) {
+@@ -652,6 +659,7 @@
+ if (!tzif.open(QIODevice::ReadOnly))
+ return;
+ }
++ }
+ }
+
+ QDataStream ds(&tzif);
diff --git a/gnu/packages/patches/qtbase-use-TZDIR.patch b/gnu/packages/patches/qtbase-use-TZDIR.patch
index b6c377b133c..98bf7493e9f 100644
--- a/gnu/packages/patches/qtbase-use-TZDIR.patch
+++ b/gnu/packages/patches/qtbase-use-TZDIR.patch
@@ -1,39 +1,141 @@
-Use $TZDIR to search for time-zone data. Thus avoid depending on package
-"tzdata", which often introduces changes with near-immediate effects, so it's
-important to be able to update it fast.
+From 1075606f8b2f9e153c82f8e50cbd69cea9c72e87 Mon Sep 17 00:00:00 2001
+From: Edward Welbourne <edward.welbourne@qt.io>
+Date: Mon, 11 Sep 2023 11:41:39 +0200
+Subject: [PATCH] Support the TZDIR environment variable
-Based on a patch fron NixOS.
-===================================================================
---- qtbase-opensource-src-5.14.2.orig/src/corelib/time/qtimezoneprivate_tz.cpp
-+++ qtbase-opensource-src-5.15.2/src/corelib/time/qtimezoneprivate_tz.cpp
-@@ -70,7 +70,11 @@
- // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
+On Linux / glibc, this overrides the default system location for the
+zone info. So check for files there first. Break out a function to
+manage the trying of (now three) zoneinfo directories when opening a
+file by name relative to there.
+
+Pick-to: 6.6 6.5
+Task-number: QTBUG-116017
+Change-Id: I1f97107aabd9015c0a5543639870f1d70654ca67
+---
+* Rebased on top of v6.5.2.
+
+ src/corelib/time/qtimezoneprivate_tz.cpp | 73 ++++++++++++++++--------
+ 1 file changed, 49 insertions(+), 24 deletions(-)
+
+diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
+index 067191d816..a8b2fc894e 100644
+--- a/src/corelib/time/qtimezoneprivate_tz.cpp
++++ b/src/corelib/time/qtimezoneprivate_tz.cpp
+@@ -51,17 +51,41 @@ typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
+
+ static bool isTzFile(const QString &name);
+
++// Open a named file under the zone info directory:
++static bool openZoneInfo(QString name, QFile *file)
++{
++ // At least on Linux / glibc (see man 3 tzset), $TZDIR overrides the system
++ // default location for zone info:
++ const QString tzdir = qEnvironmentVariable("TZDIR");
++ if (!tzdir.isEmpty()) {
++ file->setFileName(QDir(tzdir).filePath(name));
++ if (file->open(QIODevice::ReadOnly))
++ return true;
++ }
++ // Try modern system path first:
++ constexpr auto zoneShare = "/usr/share/zoneinfo/"_L1;
++ if (tzdir != zoneShare && tzdir != zoneShare.chopped(1)) {
++ file->setFileName(zoneShare + name);
++ if (file->open(QIODevice::ReadOnly))
++ return true;
++ }
++ // Fall back to legacy system path:
++ constexpr auto zoneLib = "/usr/lib/zoneinfo/"_L1;
++ if (tzdir != zoneLib && tzdir != zoneLib.chopped(1)) {
++ file->setFileName(zoneShare + name);
++ if (file->open(QIODevice::ReadOnly))
++ return true;
++ }
++ return false;
++}
++
+ // Parse zone.tab table for territory information, read directories to ensure we
+ // find all installed zones (many are omitted from zone.tab; even more from
+ // zone1970.tab).
static QTzTimeZoneHash loadTzTimeZones()
{
- QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
-+ // Try TZDIR first, in case we're running on GuixSD.
-+ QString path = QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/zone.tab");
-+ // Fallback to traditional paths in case we are not on GuixSD.
-+ if (!QFile::exists(path))
-+ path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
- if (!QFile::exists(path))
- path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+- if (!QFile::exists(path))
+- path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+-
+- QFile tzif(path);
+- if (!tzif.open(QIODevice::ReadOnly))
++ QFile tzif;
++ if (!openZoneInfo("zone.tab"_L1, &tzif))
+ return QTzTimeZoneHash();
-@@ -645,6 +649,9 @@
+ QTzTimeZoneHash zonesHash;
+@@ -91,6 +115,7 @@ static QTzTimeZoneHash loadTzTimeZones()
+ }
+ }
+
++ const QString path = tzif.fileName();
+ const qsizetype cut = path.lastIndexOf(u'/');
+ Q_ASSERT(cut > 0);
+ const QDir zoneDir = QDir(path.first(cut));
+@@ -761,20 +786,13 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
+ tzif.setFileName(QStringLiteral("/etc/localtime"));
if (!tzif.open(QIODevice::ReadOnly))
- return;
- } else {
-+ // Try TZDIR first, in case we're running on GuixSD.
-+ tzif.setFileName(QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/") + QString::fromLocal8Bit(ianaId));
-+ if (!tzif.open(QIODevice::ReadOnly)) {
- // Open named tz, try modern path first, if fails try legacy path
- tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
- if (!tzif.open(QIODevice::ReadOnly)) {
-@@ -652,6 +659,7 @@
- if (!tzif.open(QIODevice::ReadOnly))
- return;
+ return ret;
+- } else {
+- // Open named tz, try modern path first, if fails try legacy path
+- tzif.setFileName("/usr/share/zoneinfo/"_L1 + QString::fromLocal8Bit(ianaId));
+- if (!tzif.open(QIODevice::ReadOnly)) {
+- tzif.setFileName("/usr/lib/zoneinfo/"_L1 + QString::fromLocal8Bit(ianaId));
+- if (!tzif.open(QIODevice::ReadOnly)) {
+- // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
+- auto check = validatePosixRule(ianaId);
+- if (check.isValid) {
+- ret.m_hasDst = check.hasDst;
+- ret.m_posixRule = ianaId;
+- }
+- return ret;
+- }
++ } else if (!openZoneInfo(QString::fromLocal8Bit(ianaId), &tzif)) {
++ // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
++ auto check = validatePosixRule(ianaId);
++ if (check.isValid) {
++ ret.m_hasDst = check.hasDst;
++ ret.m_posixRule = ianaId;
++ return ret;
}
-+ }
}
- QDataStream ds(&tzif);
+@@ -1317,7 +1335,8 @@ private:
+ {
+ // On most distros /etc/localtime is a symlink to a real file so extract
+ // name from the path
+- const auto zoneinfo = "/zoneinfo/"_L1;
++ const QString tzdir = qEnvironmentVariable("TZDIR");
++ constexpr auto zoneinfo = "/zoneinfo/"_L1;
+ QString path = QStringLiteral("/etc/localtime");
+ long iteration = getSymloopMax();
+ // Symlink may point to another symlink etc. before being under zoneinfo/
+@@ -1325,9 +1344,15 @@ private:
+ // symlink, like America/Montreal pointing to America/Toronto
+ do {
+ path = QFile::symLinkTarget(path);
+- int index = path.indexOf(zoneinfo);
+- if (index >= 0) // Found zoneinfo file; extract zone name from path:
+- return QStringView{ path }.mid(index + zoneinfo.size()).toUtf8();
++ // If it's a zoneinfo file, extract the zone name from its path:
++ int index = tzdir.isEmpty() ? -1 : path.indexOf(tzdir);
++ if (index >= 0) {
++ const auto tail = QStringView{ path }.sliced(index + tzdir.size()).toUtf8();
++ return tail.startsWith(u'/') ? tail.sliced(1) : tail;
++ }
++ index = path.indexOf(zoneinfo);
++ if (index >= 0)
++ return QStringView{ path }.sliced(index + zoneinfo.size()).toUtf8();
+ } while (!path.isEmpty() && --iteration > 0);
+
+ return QByteArray();
+
+base-commit: af457a9f0f7eb1a2a7d11f495da508faab91a442
+--
+2.41.0
+
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 8324beef6fc..c06f27c03e2 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -365,7 +365,7 @@ (define-public qtbase-5
(base32
"1fcg3kx5akvj0kqxd99h5lv3kv4pw2cj0makmpvhpw90inqnrl60"))
;; Use TZDIR to avoid depending on package "tzdata".
- (patches (search-patches "qtbase-use-TZDIR.patch"
+ (patches (search-patches "qtbase-5-use-TZDIR.patch"
"qtbase-moc-ignore-gcc-macro.patch"
"qtbase-absolute-runpath.patch"))
(modules '((guix build utils)))
@@ -747,7 +747,8 @@ (define-public qtbase
(assoc-ref %standard-phases 'configure))
(delete 'check) ;move after patch-prl-files
(add-after 'patch-prl-files 'check
- (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
+ (lambda* (#:key tests? parallel-tests?
+ native-inputs inputs #:allow-other-keys)
(when tests?
;; The tests expect to find the modules provided by this
;; package; extend the environment variables needed to do so.
@@ -770,6 +771,18 @@ (define-public qtbase
;; /tree/src/testlib/qtestblacklist.cpp).
(setenv "QTEST_ENVIRONMENT" "linux ci 32bit")
(setenv "HOME" "/tmp") ;some tests require a writable HOME
+
+ ;; Note: the search path specified for TZDIR is only
+ ;; effective for users of the package, not while it's being
+ ;; built.
+ (setenv "TZDIR" (search-input-directory
+ (or native-inputs inputs) "share/zoneinfo"))
+
+ ;; This is to avoid QTimeZone::systemTimeZone() returning
+ ;; invalid QDate objects due to missing /etc/timezone or
+ ;; /etc/localtime.
+ (setenv "TZ" "Etc/UTC")
+
(invoke
"xvfb-run" "ctest" "--output-on-failure"
"-j" (if parallel-tests?
@@ -783,11 +796,6 @@ (define-public qtbase
;; The 'tst_moc' test fails with "'fi.exists()' returned FALSE".
"tst_moc"
- ;; The 'tst_qdate' test fails because the current time
- ;; is reported as an invalid date (see:
- ;; https://bugreports.qt.io/browse/QTBUG-116017).
- "tst_qdate"
-
;; The qgraphicsview and qopenglwidget tests fail with a
;; segfault for unknown reasons (see:
;; https://bugreports.qt.io/browse/QTBUG-116018).
@@ -826,14 +834,6 @@ (define-public qtbase
;; The 'test_import_plugins' fails with "Could NOT find
;; Qt6MockPlugins1".
"test_import_plugins"
- ;; The 'tst_QTimeZone::systemZone' validates the
- ;; currently set timezone and fails.
- "tst_qtimezone"
- ;; The 'tst_qdatetime' fails with:
- ;; FAIL! : tst_QDateTime::offsetFromUtc() Compared values are not the same
- ;; Actual (dt5.offsetFromUtc()): 0
- ;; Expected (46800) : 46800
- "tst_qdatetime"
;; The tst_QObjectRace::destroyRace is flaky (see:
;; https://bugreports.qt.io/browse/QTBUG-103489).
"tst_qobjectrace"
@@ -910,7 +910,8 @@ (define-public qtbase
(("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)))))))))
(native-inputs
(modify-inputs (package-native-inputs qtbase-5)
- (prepend wayland-protocols
+ (prepend tzdata-for-tests
+ wayland-protocols
xvfb-run)))
(inputs
(modify-inputs (package-inputs qtbase-5)
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v2 4/4] gnu: qtdeclarative: Add a debug output.
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
` (2 preceding siblings ...)
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 3/4] gnu: qtbase: Reinstate date related tests Maxim Cournoyer
@ 2023-09-13 17:33 ` Maxim Cournoyer
3 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-13 17:33 UTC (permalink / raw)
To: 65922
Cc: Maxim Cournoyer, Maxim Cournoyer, Andreas Enge,
宋文武
* gnu/packages/qt.scm (qtdeclarative) [outputs]: New field.
---
(no changes since v1)
gnu/packages/qt.scm | 1 +
1 file changed, 1 insertion(+)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index c06f27c03e2..ab99f590b25 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -1350,6 +1350,7 @@ (define-public qtdeclarative
(base32
"06c7xfqn2a5s2m8j1bcvx3pyjqg1rgqkjvp49737gb4z9vjiz8gk"))
(patches (search-patches "qtdeclarative-disable-qmlcache.patch"))))
+ (outputs '("out" "debug"))
(build-system cmake-build-system)
(arguments
(list
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v2 1/4] gnu: qtbase: Do not capture Python (again).
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 1/4] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
@ 2023-09-14 9:07 ` Andreas Enge
2023-09-17 2:51 ` Maxim Cournoyer
0 siblings, 1 reply; 21+ messages in thread
From: Andreas Enge @ 2023-09-14 9:07 UTC (permalink / raw)
To: Maxim Cournoyer; +Cc: 宋文武, 65922
Hello,
I just happened to have the time for one patch :)
Am Wed, Sep 13, 2023 at 01:33:13PM -0400 schrieb Maxim Cournoyer:
> * gnu/packages/qt.scm (qtbase-5) [arguments]: Add #:disallowed-references
> argument to guard against the problem reoccurring in the future.
> Add do-not-capture-python phase.
> (qtbase) [arguments]: Update do-not-capture-python phase.
This one looks good, except for indentation there, I think:
> + (substitute*
> + (search-input-file
> + outputs "lib/qt5/mkspecs/features/uikit/devices.py")
> + (((which "python3"))
> + "/usr/bin/env python3")))))))
Andreas
^ permalink raw reply [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v2 1/4] gnu: qtbase: Do not capture Python (again).
2023-09-14 9:07 ` Andreas Enge
@ 2023-09-17 2:51 ` Maxim Cournoyer
2023-09-17 10:12 ` Andreas Enge
0 siblings, 1 reply; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-17 2:51 UTC (permalink / raw)
To: Andreas Enge; +Cc: 宋文武, 65922
Hi Andreas,
Andreas Enge <andreas@enge.fr> writes:
> Hello,
>
> I just happened to have the time for one patch :)
>
> Am Wed, Sep 13, 2023 at 01:33:13PM -0400 schrieb Maxim Cournoyer:
>> * gnu/packages/qt.scm (qtbase-5) [arguments]: Add #:disallowed-references
>> argument to guard against the problem reoccurring in the future.
>> Add do-not-capture-python phase.
>> (qtbase) [arguments]: Update do-not-capture-python phase.
>
> This one looks good, except for indentation there, I think:
>> + (substitute*
>> + (search-input-file
>> + outputs "lib/qt5/mkspecs/features/uikit/devices.py")
>> + (((which "python3"))
>> + "/usr/bin/env python3")))))))
It's actually valid -- I just doubled check :-)
Thanks for taking a peek.
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v2 1/4] gnu: qtbase: Do not capture Python (again).
2023-09-17 2:51 ` Maxim Cournoyer
@ 2023-09-17 10:12 ` Andreas Enge
2023-09-17 12:55 ` Maxim Cournoyer
0 siblings, 1 reply; 21+ messages in thread
From: Andreas Enge @ 2023-09-17 10:12 UTC (permalink / raw)
To: Maxim Cournoyer; +Cc: 宋文武, 65922
Am Sat, Sep 16, 2023 at 10:51:22PM -0400 schrieb Maxim Cournoyer:
> > This one looks good, except for indentation there, I think:
> >> + (substitute*
> >> + (search-input-file
> >> + outputs "lib/qt5/mkspecs/features/uikit/devices.py")
> >> + (((which "python3"))
> >> + "/usr/bin/env python3")))))))
> It's actually valid -- I just doubled check :-)
Hm, I thought that arguments to functions should be aligned, so that
"(search-..." and "(((which" should start in the same column?
And that we would indent by either 1 or 2 (according to arcane rules I
never memorised)?
Andreas
^ permalink raw reply [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v2 1/4] gnu: qtbase: Do not capture Python (again).
2023-09-17 10:12 ` Andreas Enge
@ 2023-09-17 12:55 ` Maxim Cournoyer
0 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-17 12:55 UTC (permalink / raw)
To: Andreas Enge; +Cc: 宋文武, 65922
Hi Andreas,
Andreas Enge <andreas@enge.fr> writes:
> Am Sat, Sep 16, 2023 at 10:51:22PM -0400 schrieb Maxim Cournoyer:
>> > This one looks good, except for indentation there, I think:
>> >> + (substitute*
>> >> + (search-input-file
>> >> + outputs "lib/qt5/mkspecs/features/uikit/devices.py")
>> >> + (((which "python3"))
>> >> + "/usr/bin/env python3")))))))
>> It's actually valid -- I just doubled check :-)
>
> Hm, I thought that arguments to functions should be aligned, so that
> "(search-..." and "(((which" should start in the same column?
> And that we would indent by either 1 or 2 (according to arcane rules I
> never memorised)?
According to our indentation rules in .dir-locals.el:
--8<---------------cut here---------------start------------->8---
(put 'substitute* 'scheme-indent-function 1)
--8<---------------cut here---------------end--------------->8---
Which, following the Emacs documentation for scheme-indent-function then
lisp-indent-function (C-h f scheme-indent-function RET), says (where N
is the 1 argument):
--8<---------------cut here---------------start------------->8---
* an integer N, meaning indent the first N arguments specially
(like ordinary function arguments), and then indent any further
arguments like a body;
--8<---------------cut here---------------end--------------->8---
The indentation produced is because of that special rule.
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v3 0/5] Avoid capturing python in qtbase, reinstate tests
2023-09-13 16:56 [bug#65922] [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
` (4 preceding siblings ...)
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
@ 2023-09-17 17:26 ` Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 1/5] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
` (4 more replies)
2023-10-16 21:45 ` bug#65922: [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
6 siblings, 5 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-17 17:26 UTC (permalink / raw)
To: 65922
Cc: Maxim Cournoyer, Maxim Cournoyer, Andreas Enge,
宋文武
Thes series removes Python from the closure of qtbase, both for versions 5.15
and 6.5. It also reinstate a few tests that was made possible thanks to
discussions with upstream following reported the issues.
Changes in v3:
- New commit
Changes in v2:
- Use old TZDIR patch for qtbase@5 (the new one doesn't apply)
Maxim Cournoyer (5):
gnu: qtbase: Do not capture Python (again).
gnu: qtbase: Add $TZDIR to native search paths.
gnu: qtbase: Reinstate date related tests.
gnu: qtbase: Disable problematic tests on powerpc64le.
gnu: qtdeclarative: Add a debug output.
gnu/local.mk | 1 +
gnu/packages/patches/qtbase-5-use-TZDIR.patch | 39 +++
gnu/packages/patches/qtbase-use-TZDIR.patch | 162 +++++++++---
gnu/packages/qt.scm | 236 ++++++++++--------
4 files changed, 309 insertions(+), 129 deletions(-)
create mode 100644 gnu/packages/patches/qtbase-5-use-TZDIR.patch
base-commit: 4cb2e08b8eb1acc824b72ec17b483d7d85b5af68
--
2.41.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v3 1/5] gnu: qtbase: Do not capture Python (again).
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 0/5] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
@ 2023-09-17 17:26 ` Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 2/5] gnu: qtbase: Add $TZDIR to native search paths Maxim Cournoyer
` (3 subsequent siblings)
4 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-17 17:26 UTC (permalink / raw)
To: 65922
Cc: Maxim Cournoyer, Maxim Cournoyer, Andreas Enge,
宋文武
Fixes <https://issues.guix.gnu.org/65457>.
* gnu/packages/qt.scm (qtbase-5) [arguments]: Add #:disallowed-references
argument to guard against the problem reoccurring in the future.
Add do-not-capture-python phase.
(qtbase) [arguments]: Update do-not-capture-python phase.
---
(no changes since v1)
gnu/packages/qt.scm | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index b7e394d663c..a158f8114fe 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -392,7 +392,7 @@ (define-public qtbase-5
fontconfig
freetype
glib
- gtk+ ;for GTK theme support
+ gtk+ ;for GTK theme support
harfbuzz
icu4c
libinput-minimal
@@ -437,7 +437,8 @@ (define-public qtbase-5
vulkan-headers
ruby-2.7))
(arguments
- `(#:configure-flags
+ `(#:disallowed-references ,(list python)
+ #:configure-flags
(let ((out (assoc-ref %outputs "out")))
(list "-verbose"
"-prefix" out
@@ -583,7 +584,16 @@ (define-public qtbase-5
(("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b)
(string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))
(("^\\s*(xcursorLib.setFileName\\(QLatin1String\\(\")(Xcursor\"\\)\\);)" _ a b)
- (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))))))))
+ (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b)))))
+ (add-after 'install 'do-not-capture-python
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; For some reason, patching the file after the
+ ;; patch-source-shebangs phase doesn't work for Qt 5.
+ (substitute*
+ (search-input-file
+ outputs "lib/qt5/mkspecs/features/uikit/devices.py")
+ (((which "python3"))
+ "/usr/bin/env python3")))))))
(native-search-paths
(list (search-path-specification
(variable "QMAKEPATH")
@@ -724,10 +734,12 @@ (define-public qtbase
(substitute* "src/corelib/CMakeLists.txt"
(("/bin/ls")
(search-input-file inputs "bin/ls")))))
+ (delete 'do-not-capture-python) ;move after patch-source-shebangs
(add-after 'patch-source-shebangs 'do-not-capture-python
(lambda _
(substitute* '("mkspecs/features/uikit/devices.py"
- "util/testrunner/qt-testrunner.py")
+ "util/testrunner/qt-testrunner.py"
+ "util/testrunner/sanitizer-testrunner.py")
(((which "python3"))
"/usr/bin/env python3"))))
(replace 'configure
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v3 2/5] gnu: qtbase: Add $TZDIR to native search paths.
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 0/5] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 1/5] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
@ 2023-09-17 17:26 ` Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 3/5] gnu: qtbase: Reinstate date related tests Maxim Cournoyer
` (2 subsequent siblings)
4 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-17 17:26 UTC (permalink / raw)
To: 65922
Cc: Maxim Cournoyer, Maxim Cournoyer, Andreas Enge,
宋文武
* gnu/packages/qt.scm (qtbase) [native-search-paths]: Add $TZDIR.
---
(no changes since v1)
gnu/packages/qt.scm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index a158f8114fe..8324beef6fc 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -60,6 +60,7 @@ (define-module (gnu packages qt)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix deprecation)
+ #:use-module (guix search-paths)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages bash)
@@ -933,6 +934,7 @@ (define-public qtbase
(search-path-specification
(variable "QT_PLUGIN_PATH")
(files '("lib/qt6/plugins")))
+ $TZDIR
(search-path-specification
(variable "XDG_DATA_DIRS")
(files '("share")))
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v3 3/5] gnu: qtbase: Reinstate date related tests.
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 0/5] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 1/5] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 2/5] gnu: qtbase: Add $TZDIR to native search paths Maxim Cournoyer
@ 2023-09-17 17:26 ` Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 4/5] gnu: qtbase: Disable problematic tests on powerpc64le Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 5/5] gnu: qtdeclarative: Add a debug output Maxim Cournoyer
4 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-17 17:26 UTC (permalink / raw)
To: 65922
Cc: Maxim Cournoyer, Maxim Cournoyer, Andreas Enge,
宋文武
* gnu/packages/qt.scm (qtbase) [native-inputs]: Add tzdata-for-tests.
[arguments]: Set the TZDIR and TZ environment variables, and reinstate the
tst_qdate, tst_qtimezone and tst_qdatetime tests in the check phase.
(qtbase-5) [source]: Replace qtbase-use-TZDIR.patch with
qtbase-5-use-TZDIR.patch.
* gnu/packages/patches/qtbase-use-TZDIR.patch: Refresh patch with upstream
version, and preserve the old one for qtbase@5 as...
* gnu/packages/patches/qtbase-5-use-TZDIR.patch: ... this.
* gnu/local.mk (dist_patch_DATA): Register new patch.
---
(no changes since v2)
Changes in v2:
- Use old TZDIR patch for qtbase@5 (the new one doesn't apply)
gnu/local.mk | 1 +
gnu/packages/patches/qtbase-5-use-TZDIR.patch | 39 +++++
gnu/packages/patches/qtbase-use-TZDIR.patch | 162 ++++++++++++++----
gnu/packages/qt.scm | 33 ++--
4 files changed, 189 insertions(+), 46 deletions(-)
create mode 100644 gnu/packages/patches/qtbase-5-use-TZDIR.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 4f8637418ad..2d8ddf5716c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1878,6 +1878,7 @@ dist_patch_DATA = \
%D%/packages/patches/qtbase-absolute-runpath.patch \
%D%/packages/patches/qtbase-moc-ignore-gcc-macro.patch \
%D%/packages/patches/qtbase-qmake-use-libname.patch \
+ %D%/packages/patches/qtbase-5-use-TZDIR.patch \
%D%/packages/patches/qtbase-use-TZDIR.patch \
%D%/packages/patches/qtscript-disable-tests.patch \
%D%/packages/patches/quagga-reproducible-build.patch \
diff --git a/gnu/packages/patches/qtbase-5-use-TZDIR.patch b/gnu/packages/patches/qtbase-5-use-TZDIR.patch
new file mode 100644
index 00000000000..b6c377b133c
--- /dev/null
+++ b/gnu/packages/patches/qtbase-5-use-TZDIR.patch
@@ -0,0 +1,39 @@
+Use $TZDIR to search for time-zone data. Thus avoid depending on package
+"tzdata", which often introduces changes with near-immediate effects, so it's
+important to be able to update it fast.
+
+Based on a patch fron NixOS.
+===================================================================
+--- qtbase-opensource-src-5.14.2.orig/src/corelib/time/qtimezoneprivate_tz.cpp
++++ qtbase-opensource-src-5.15.2/src/corelib/time/qtimezoneprivate_tz.cpp
+@@ -70,7 +70,11 @@
+ // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
+ static QTzTimeZoneHash loadTzTimeZones()
+ {
+- QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
++ // Try TZDIR first, in case we're running on GuixSD.
++ QString path = QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/zone.tab");
++ // Fallback to traditional paths in case we are not on GuixSD.
++ if (!QFile::exists(path))
++ path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
+ if (!QFile::exists(path))
+ path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+
+@@ -645,6 +649,9 @@
+ if (!tzif.open(QIODevice::ReadOnly))
+ return;
+ } else {
++ // Try TZDIR first, in case we're running on GuixSD.
++ tzif.setFileName(QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/") + QString::fromLocal8Bit(ianaId));
++ if (!tzif.open(QIODevice::ReadOnly)) {
+ // Open named tz, try modern path first, if fails try legacy path
+ tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
+ if (!tzif.open(QIODevice::ReadOnly)) {
+@@ -652,6 +659,7 @@
+ if (!tzif.open(QIODevice::ReadOnly))
+ return;
+ }
++ }
+ }
+
+ QDataStream ds(&tzif);
diff --git a/gnu/packages/patches/qtbase-use-TZDIR.patch b/gnu/packages/patches/qtbase-use-TZDIR.patch
index b6c377b133c..98bf7493e9f 100644
--- a/gnu/packages/patches/qtbase-use-TZDIR.patch
+++ b/gnu/packages/patches/qtbase-use-TZDIR.patch
@@ -1,39 +1,141 @@
-Use $TZDIR to search for time-zone data. Thus avoid depending on package
-"tzdata", which often introduces changes with near-immediate effects, so it's
-important to be able to update it fast.
+From 1075606f8b2f9e153c82f8e50cbd69cea9c72e87 Mon Sep 17 00:00:00 2001
+From: Edward Welbourne <edward.welbourne@qt.io>
+Date: Mon, 11 Sep 2023 11:41:39 +0200
+Subject: [PATCH] Support the TZDIR environment variable
-Based on a patch fron NixOS.
-===================================================================
---- qtbase-opensource-src-5.14.2.orig/src/corelib/time/qtimezoneprivate_tz.cpp
-+++ qtbase-opensource-src-5.15.2/src/corelib/time/qtimezoneprivate_tz.cpp
-@@ -70,7 +70,11 @@
- // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
+On Linux / glibc, this overrides the default system location for the
+zone info. So check for files there first. Break out a function to
+manage the trying of (now three) zoneinfo directories when opening a
+file by name relative to there.
+
+Pick-to: 6.6 6.5
+Task-number: QTBUG-116017
+Change-Id: I1f97107aabd9015c0a5543639870f1d70654ca67
+---
+* Rebased on top of v6.5.2.
+
+ src/corelib/time/qtimezoneprivate_tz.cpp | 73 ++++++++++++++++--------
+ 1 file changed, 49 insertions(+), 24 deletions(-)
+
+diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
+index 067191d816..a8b2fc894e 100644
+--- a/src/corelib/time/qtimezoneprivate_tz.cpp
++++ b/src/corelib/time/qtimezoneprivate_tz.cpp
+@@ -51,17 +51,41 @@ typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
+
+ static bool isTzFile(const QString &name);
+
++// Open a named file under the zone info directory:
++static bool openZoneInfo(QString name, QFile *file)
++{
++ // At least on Linux / glibc (see man 3 tzset), $TZDIR overrides the system
++ // default location for zone info:
++ const QString tzdir = qEnvironmentVariable("TZDIR");
++ if (!tzdir.isEmpty()) {
++ file->setFileName(QDir(tzdir).filePath(name));
++ if (file->open(QIODevice::ReadOnly))
++ return true;
++ }
++ // Try modern system path first:
++ constexpr auto zoneShare = "/usr/share/zoneinfo/"_L1;
++ if (tzdir != zoneShare && tzdir != zoneShare.chopped(1)) {
++ file->setFileName(zoneShare + name);
++ if (file->open(QIODevice::ReadOnly))
++ return true;
++ }
++ // Fall back to legacy system path:
++ constexpr auto zoneLib = "/usr/lib/zoneinfo/"_L1;
++ if (tzdir != zoneLib && tzdir != zoneLib.chopped(1)) {
++ file->setFileName(zoneShare + name);
++ if (file->open(QIODevice::ReadOnly))
++ return true;
++ }
++ return false;
++}
++
+ // Parse zone.tab table for territory information, read directories to ensure we
+ // find all installed zones (many are omitted from zone.tab; even more from
+ // zone1970.tab).
static QTzTimeZoneHash loadTzTimeZones()
{
- QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
-+ // Try TZDIR first, in case we're running on GuixSD.
-+ QString path = QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/zone.tab");
-+ // Fallback to traditional paths in case we are not on GuixSD.
-+ if (!QFile::exists(path))
-+ path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
- if (!QFile::exists(path))
- path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+- if (!QFile::exists(path))
+- path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+-
+- QFile tzif(path);
+- if (!tzif.open(QIODevice::ReadOnly))
++ QFile tzif;
++ if (!openZoneInfo("zone.tab"_L1, &tzif))
+ return QTzTimeZoneHash();
-@@ -645,6 +649,9 @@
+ QTzTimeZoneHash zonesHash;
+@@ -91,6 +115,7 @@ static QTzTimeZoneHash loadTzTimeZones()
+ }
+ }
+
++ const QString path = tzif.fileName();
+ const qsizetype cut = path.lastIndexOf(u'/');
+ Q_ASSERT(cut > 0);
+ const QDir zoneDir = QDir(path.first(cut));
+@@ -761,20 +786,13 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
+ tzif.setFileName(QStringLiteral("/etc/localtime"));
if (!tzif.open(QIODevice::ReadOnly))
- return;
- } else {
-+ // Try TZDIR first, in case we're running on GuixSD.
-+ tzif.setFileName(QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/") + QString::fromLocal8Bit(ianaId));
-+ if (!tzif.open(QIODevice::ReadOnly)) {
- // Open named tz, try modern path first, if fails try legacy path
- tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
- if (!tzif.open(QIODevice::ReadOnly)) {
-@@ -652,6 +659,7 @@
- if (!tzif.open(QIODevice::ReadOnly))
- return;
+ return ret;
+- } else {
+- // Open named tz, try modern path first, if fails try legacy path
+- tzif.setFileName("/usr/share/zoneinfo/"_L1 + QString::fromLocal8Bit(ianaId));
+- if (!tzif.open(QIODevice::ReadOnly)) {
+- tzif.setFileName("/usr/lib/zoneinfo/"_L1 + QString::fromLocal8Bit(ianaId));
+- if (!tzif.open(QIODevice::ReadOnly)) {
+- // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
+- auto check = validatePosixRule(ianaId);
+- if (check.isValid) {
+- ret.m_hasDst = check.hasDst;
+- ret.m_posixRule = ianaId;
+- }
+- return ret;
+- }
++ } else if (!openZoneInfo(QString::fromLocal8Bit(ianaId), &tzif)) {
++ // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
++ auto check = validatePosixRule(ianaId);
++ if (check.isValid) {
++ ret.m_hasDst = check.hasDst;
++ ret.m_posixRule = ianaId;
++ return ret;
}
-+ }
}
- QDataStream ds(&tzif);
+@@ -1317,7 +1335,8 @@ private:
+ {
+ // On most distros /etc/localtime is a symlink to a real file so extract
+ // name from the path
+- const auto zoneinfo = "/zoneinfo/"_L1;
++ const QString tzdir = qEnvironmentVariable("TZDIR");
++ constexpr auto zoneinfo = "/zoneinfo/"_L1;
+ QString path = QStringLiteral("/etc/localtime");
+ long iteration = getSymloopMax();
+ // Symlink may point to another symlink etc. before being under zoneinfo/
+@@ -1325,9 +1344,15 @@ private:
+ // symlink, like America/Montreal pointing to America/Toronto
+ do {
+ path = QFile::symLinkTarget(path);
+- int index = path.indexOf(zoneinfo);
+- if (index >= 0) // Found zoneinfo file; extract zone name from path:
+- return QStringView{ path }.mid(index + zoneinfo.size()).toUtf8();
++ // If it's a zoneinfo file, extract the zone name from its path:
++ int index = tzdir.isEmpty() ? -1 : path.indexOf(tzdir);
++ if (index >= 0) {
++ const auto tail = QStringView{ path }.sliced(index + tzdir.size()).toUtf8();
++ return tail.startsWith(u'/') ? tail.sliced(1) : tail;
++ }
++ index = path.indexOf(zoneinfo);
++ if (index >= 0)
++ return QStringView{ path }.sliced(index + zoneinfo.size()).toUtf8();
+ } while (!path.isEmpty() && --iteration > 0);
+
+ return QByteArray();
+
+base-commit: af457a9f0f7eb1a2a7d11f495da508faab91a442
+--
+2.41.0
+
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 8324beef6fc..c06f27c03e2 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -365,7 +365,7 @@ (define-public qtbase-5
(base32
"1fcg3kx5akvj0kqxd99h5lv3kv4pw2cj0makmpvhpw90inqnrl60"))
;; Use TZDIR to avoid depending on package "tzdata".
- (patches (search-patches "qtbase-use-TZDIR.patch"
+ (patches (search-patches "qtbase-5-use-TZDIR.patch"
"qtbase-moc-ignore-gcc-macro.patch"
"qtbase-absolute-runpath.patch"))
(modules '((guix build utils)))
@@ -747,7 +747,8 @@ (define-public qtbase
(assoc-ref %standard-phases 'configure))
(delete 'check) ;move after patch-prl-files
(add-after 'patch-prl-files 'check
- (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
+ (lambda* (#:key tests? parallel-tests?
+ native-inputs inputs #:allow-other-keys)
(when tests?
;; The tests expect to find the modules provided by this
;; package; extend the environment variables needed to do so.
@@ -770,6 +771,18 @@ (define-public qtbase
;; /tree/src/testlib/qtestblacklist.cpp).
(setenv "QTEST_ENVIRONMENT" "linux ci 32bit")
(setenv "HOME" "/tmp") ;some tests require a writable HOME
+
+ ;; Note: the search path specified for TZDIR is only
+ ;; effective for users of the package, not while it's being
+ ;; built.
+ (setenv "TZDIR" (search-input-directory
+ (or native-inputs inputs) "share/zoneinfo"))
+
+ ;; This is to avoid QTimeZone::systemTimeZone() returning
+ ;; invalid QDate objects due to missing /etc/timezone or
+ ;; /etc/localtime.
+ (setenv "TZ" "Etc/UTC")
+
(invoke
"xvfb-run" "ctest" "--output-on-failure"
"-j" (if parallel-tests?
@@ -783,11 +796,6 @@ (define-public qtbase
;; The 'tst_moc' test fails with "'fi.exists()' returned FALSE".
"tst_moc"
- ;; The 'tst_qdate' test fails because the current time
- ;; is reported as an invalid date (see:
- ;; https://bugreports.qt.io/browse/QTBUG-116017).
- "tst_qdate"
-
;; The qgraphicsview and qopenglwidget tests fail with a
;; segfault for unknown reasons (see:
;; https://bugreports.qt.io/browse/QTBUG-116018).
@@ -826,14 +834,6 @@ (define-public qtbase
;; The 'test_import_plugins' fails with "Could NOT find
;; Qt6MockPlugins1".
"test_import_plugins"
- ;; The 'tst_QTimeZone::systemZone' validates the
- ;; currently set timezone and fails.
- "tst_qtimezone"
- ;; The 'tst_qdatetime' fails with:
- ;; FAIL! : tst_QDateTime::offsetFromUtc() Compared values are not the same
- ;; Actual (dt5.offsetFromUtc()): 0
- ;; Expected (46800) : 46800
- "tst_qdatetime"
;; The tst_QObjectRace::destroyRace is flaky (see:
;; https://bugreports.qt.io/browse/QTBUG-103489).
"tst_qobjectrace"
@@ -910,7 +910,8 @@ (define-public qtbase
(("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)))))))))
(native-inputs
(modify-inputs (package-native-inputs qtbase-5)
- (prepend wayland-protocols
+ (prepend tzdata-for-tests
+ wayland-protocols
xvfb-run)))
(inputs
(modify-inputs (package-inputs qtbase-5)
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v3 4/5] gnu: qtbase: Disable problematic tests on powerpc64le.
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 0/5] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
` (2 preceding siblings ...)
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 3/5] gnu: qtbase: Reinstate date related tests Maxim Cournoyer
@ 2023-09-17 17:26 ` Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 5/5] gnu: qtdeclarative: Add a debug output Maxim Cournoyer
4 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-17 17:26 UTC (permalink / raw)
To: 65922
Cc: Maxim Cournoyer, Maxim Cournoyer, Andreas Enge,
宋文武
* gnu/packages/qt.scm (qtbase) [arguments] [powerpc64le]: Disable the
tst_qpainter, tst_qprocess and tst_qsqlthread tests in the check phase.
---
Changes in v3:
- New commit
gnu/packages/qt.scm | 180 +++++++++++++++++++++++++-------------------
1 file changed, 101 insertions(+), 79 deletions(-)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index c06f27c03e2..8cc1fa7398d 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -792,85 +792,107 @@ (define-public qtbase
(string-append
"("
(string-join
- (list
- ;; The 'tst_moc' test fails with "'fi.exists()' returned FALSE".
- "tst_moc"
-
- ;; The qgraphicsview and qopenglwidget tests fail with a
- ;; segfault for unknown reasons (see:
- ;; https://bugreports.qt.io/browse/QTBUG-116018).
- "tst_qgraphicsview"
- "tst_qopenglwidget"
-
- ;; The 'test_rcc' test fails on a comparison:
- ;; <<<<<< actual
- ;; 0x0,0x0,0x0,0x0,0x0,0x0,0x3,0xe8,
- ;; ======
- ;; 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- ;; >>>>>> expected
- "tst_rcc"
- ;; The 'tst_qtemporarydir' and 'tst_qtemporaryfile'
- ;; tests depend on '/home' not being writable.
- "tst_qtemporarydir"
- "tst_qtemporaryfile"
- ;; The 'tst_qdir' compares two directories which are
- ;; unexpectedly different when inside the build
- ;; container.
- "tst_qdir"
- ;; This checks the last modified time of '/', and fails
- ;; because Epoch 0 is considered to be invalid.
- "tst_qresourceengine"
- ;; The 'tst_qfilesystemwatcher' installs a watcher on
- ;; '/home', which doesn't exist in the build container.
- "tst_qfilesystemwatcher"
- ;; Not all of the tested formats are supported by our
- ;; build of openssl; 871 passed, 122 failed.
- "tst_qsslkey"
- ;; The 'mockplugins' test fail following error: "Unknown
- ;; platform linux-g++", and the other plugin tests
- ;; depend on it.
- "mockplugins"
- "test_plugin_flavor.*"
- ;; The 'test_import_plugins' fails with "Could NOT find
- ;; Qt6MockPlugins1".
- "test_import_plugins"
- ;; The tst_QObjectRace::destroyRace is flaky (see:
- ;; https://bugreports.qt.io/browse/QTBUG-103489).
- "tst_qobjectrace"
- ;; The 'tst_QSettings::fromFile' assumes the data
- ;; location to be relative to the root directory and
- ;; fails.
- "tst_qsettings"
- ;; The 'tst_qaddpreroutine',
- ;; 'test_generating_cpp_exports' and
- ;; 'test_static_resources' tests fail with: "Unknown
- ;; platform linux-g++.
- "tst_qaddpreroutine"
- "test_generating_cpp_exports"
- "test_static_resources"
- ;; The 'tst_qfile' fails since there is no /home in the
- ;; build container.
- "tst_qfile"
- ;; The 'tst_QGlyphRun::mixedScripts' test fails with:
- ;; Actual (glyphRuns.size()): 1
- ;; Expected (2) : 2
- "tst_qglyphrun"
- ;; The 'tst_qx11info' test fails with "Internal error:
- ;; QPA plugin doesn't implement generatePeekerId",
- ;; likely requires a real display.
- "tst_qx11info"
- ;; The 'tst_qgraphicswidget' test fails because "This
- ;; plugin does not support propagateSizeHints".
- "tst_qgraphicswidget"
- ;; The 'tst_qdnslookup' test requires networking.
- "tst_qdnslookup"
- ;; The 'tst_qcompleter' and 'tst_QFiledialog::completer'
- ;; attempt to complete paths they assume exist, such as
- ;; "/home", "/etc" or "/root" and fail.
- "tst_qcompleter"
- "tst_qfiledialog"
- ;; This test is susceptible to the 600 ms timeout used:
- "tst_qpauseanimation") "|") ")")))))
+ (append
+ (list
+ ;; The 'tst_moc' test fails with "'fi.exists()' returned FALSE".
+ "tst_moc"
+
+ ;; The qgraphicsview and qopenglwidget tests fail with a
+ ;; segfault for unknown reasons (see:
+ ;; https://bugreports.qt.io/browse/QTBUG-116018).
+ "tst_qgraphicsview"
+ "tst_qopenglwidget"
+
+ ;; The 'test_rcc' test fails on a comparison:
+ ;; <<<<<< actual
+ ;; 0x0,0x0,0x0,0x0,0x0,0x0,0x3,0xe8,
+ ;; ======
+ ;; 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+ ;; >>>>>> expected
+ "tst_rcc"
+ ;; The 'tst_qtemporarydir' and 'tst_qtemporaryfile'
+ ;; tests depend on '/home' not being writable.
+ "tst_qtemporarydir"
+ "tst_qtemporaryfile"
+ ;; The 'tst_qdir' compares two directories which are
+ ;; unexpectedly different when inside the build
+ ;; container.
+ "tst_qdir"
+ ;; This checks the last modified time of '/', and fails
+ ;; because Epoch 0 is considered to be invalid.
+ "tst_qresourceengine"
+ ;; The 'tst_qfilesystemwatcher' installs a watcher on
+ ;; '/home', which doesn't exist in the build container.
+ "tst_qfilesystemwatcher"
+ ;; Not all of the tested formats are supported by our
+ ;; build of openssl; 871 passed, 122 failed.
+ "tst_qsslkey"
+ ;; The 'mockplugins' test fail following error: "Unknown
+ ;; platform linux-g++", and the other plugin tests
+ ;; depend on it.
+ "mockplugins"
+ "test_plugin_flavor.*"
+ ;; The 'test_import_plugins' fails with "Could NOT find
+ ;; Qt6MockPlugins1".
+ "test_import_plugins"
+ ;; The tst_QObjectRace::destroyRace is flaky (see:
+ ;; https://bugreports.qt.io/browse/QTBUG-103489).
+ "tst_qobjectrace"
+ ;; The 'tst_QSettings::fromFile' assumes the data
+ ;; location to be relative to the root directory and
+ ;; fails.
+ "tst_qsettings"
+ ;; The 'tst_qaddpreroutine',
+ ;; 'test_generating_cpp_exports' and
+ ;; 'test_static_resources' tests fail with: "Unknown
+ ;; platform linux-g++.
+ "tst_qaddpreroutine"
+ "test_generating_cpp_exports"
+ "test_static_resources"
+ ;; The 'tst_qfile' fails since there is no /home in the
+ ;; build container.
+ "tst_qfile"
+ ;; The 'tst_QGlyphRun::mixedScripts' test fails with:
+ ;; Actual (glyphRuns.size()): 1
+ ;; Expected (2) : 2
+ "tst_qglyphrun"
+ ;; The 'tst_qx11info' test fails with "Internal error:
+ ;; QPA plugin doesn't implement generatePeekerId",
+ ;; likely requires a real display.
+ "tst_qx11info"
+
+ ;; The 'tst_qgraphicswidget' test fails because "This
+ ;; plugin does not support propagateSizeHints".
+ "tst_qgraphicswidget"
+ ;; The 'tst_qdnslookup' test requires networking.
+ "tst_qdnslookup"
+ ;; The 'tst_qcompleter' and 'tst_QFiledialog::completer'
+ ;; attempt to complete paths they assume exist, such as
+ ;; "/home", "/etc" or "/root" and fail.
+ "tst_qcompleter"
+ "tst_qfiledialog"
+ ;; This test is susceptible to the 600 ms timeout used:
+ "tst_qpauseanimation")
+ #$@(if (target-ppc64le?)
+ #~((list
+ ;; The 'tst_QPainter::fpe_radialGradients'
+ ;; test fails with a 'Floating point
+ ;; exception' error on powerpc64le (see:
+ ;; https://bugreports.qt.io/browse/QTBUG-117113).
+ "tst_qpainter"
+
+ ;; The 'startStopStartStopBuffers' test fails
+ ;; on the powerpc64le architecture (see:
+ ;; https://bugreports.qt.io/browse/QTBUG-80953).
+ "tst_qprocess"
+
+ ;; The 'tst_QSqlThread::readWriteThreading'
+ ;; test may fail with an sqlite related error,
+ ;; "'Unable to fetch row' || 'database is
+ ;; locked'" (see:
+ ;; https://bugreports.qt.io/browse/QTBUG-117114).
+ "tst_qsqlthread"))
+ #~())) "|") ")")))))
(replace 'patch-mkspecs
(lambda* (#:key outputs #:allow-other-keys)
(let* ((archdata (search-input-directory outputs "lib/qt6"))
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [bug#65922] [qt-team PATCH v3 5/5] gnu: qtdeclarative: Add a debug output.
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 0/5] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
` (3 preceding siblings ...)
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 4/5] gnu: qtbase: Disable problematic tests on powerpc64le Maxim Cournoyer
@ 2023-09-17 17:26 ` Maxim Cournoyer
4 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-09-17 17:26 UTC (permalink / raw)
To: 65922
Cc: Maxim Cournoyer, Maxim Cournoyer, Andreas Enge,
宋文武
* gnu/packages/qt.scm (qtdeclarative) [outputs]: New field.
---
(no changes since v1)
gnu/packages/qt.scm | 1 +
1 file changed, 1 insertion(+)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 8cc1fa7398d..87de296013f 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -1372,6 +1372,7 @@ (define-public qtdeclarative
(base32
"06c7xfqn2a5s2m8j1bcvx3pyjqg1rgqkjvp49737gb4z9vjiz8gk"))
(patches (search-patches "qtdeclarative-disable-qmlcache.patch"))))
+ (outputs '("out" "debug"))
(build-system cmake-build-system)
(arguments
(list
--
2.41.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* bug#65922: [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests
2023-09-13 16:56 [bug#65922] [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
` (5 preceding siblings ...)
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 0/5] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
@ 2023-10-16 21:45 ` Maxim Cournoyer
6 siblings, 0 replies; 21+ messages in thread
From: Maxim Cournoyer @ 2023-10-16 21:45 UTC (permalink / raw)
To: 65922-done; +Cc: Andreas Enge, 宋文武
Hi,
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
> Thes series removes Python from the closure of qtbase, both for versions 5.15
> and 6.5. It also reinstate a few tests that was made possible thanks to
> discussions with upstream following reported the issues.
>
> Changes in v2:
> - Also apply fix to qtbase-5 package.
>
> Maxim Cournoyer (4):
> gnu: qtbase: Do not capture Python (again).
> gnu: qtbase: Add $TZDIR to native search paths.
> gnu: qtbase: Reinstate date related tests.
> gnu: qtdeclarative: Add a debug output.
Now merged.
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2023-10-16 21:47 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-13 16:56 [bug#65922] [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 1/4] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 2/4] gnu: qtbase: Add $TZDIR to native search paths Maxim Cournoyer
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 3/4] gnu: qtbase: Reinstate date related tests Maxim Cournoyer
2023-09-13 16:58 ` [bug#65922] [qt-team PATCH 4/4] gnu: qtdeclarative: Add a debug output Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 1/4] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
2023-09-14 9:07 ` Andreas Enge
2023-09-17 2:51 ` Maxim Cournoyer
2023-09-17 10:12 ` Andreas Enge
2023-09-17 12:55 ` Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 2/4] gnu: qtbase: Add $TZDIR to native search paths Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 3/4] gnu: qtbase: Reinstate date related tests Maxim Cournoyer
2023-09-13 17:33 ` [bug#65922] [qt-team PATCH v2 4/4] gnu: qtdeclarative: Add a debug output Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 0/5] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 1/5] gnu: qtbase: Do not capture Python (again) Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 2/5] gnu: qtbase: Add $TZDIR to native search paths Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 3/5] gnu: qtbase: Reinstate date related tests Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 4/5] gnu: qtbase: Disable problematic tests on powerpc64le Maxim Cournoyer
2023-09-17 17:26 ` [bug#65922] [qt-team PATCH v3 5/5] gnu: qtdeclarative: Add a debug output Maxim Cournoyer
2023-10-16 21:45 ` bug#65922: [qt-team PATCH 0/4] Avoid capturing python in qtbase, reinstate tests Maxim Cournoyer
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).