From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 2BjcLXDqAWXt2gAA9RJhRA:P1 (envelope-from ) for ; Wed, 13 Sep 2023 18:59:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2BjcLXDqAWXt2gAA9RJhRA (envelope-from ) for ; Wed, 13 Sep 2023 18:59:28 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 56D5C64312 for ; Wed, 13 Sep 2023 18:59:28 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=cUzQ+5+4; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694624368; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=t4iv9XSOREb5XDgrciR/Isy3gPeaNil721EVP6WSK2M=; b=d3JHhso6SD8n6SE8Pfn99RHetv/tbAc6qenCVOCFYa/q73Nmw+9XcgMcOe6B85Ex0iytHQ Vlq1BUI+/ulGchbe+5WHBjp83thqpJVQB3oI3gXdBrtZoIkYF/rarYPFavjRBkFwZ8agMS 1RuhaeZjG8OCLNFny/n7MTu3mbuqpH3nDxHCmoTshUB3Wq301Jet5xoQIPNjXu9e0qKmZD mIDhNiVrwAfuMKMnd1nAl8ljvwh5guB7g3byzNHd1QXc3FZjFmIYvfhCW0fqZC3JPrTbMo uIDmroFzRtjiFO02xbZIcceKm4NMAinj6RW/ckHLfSBH+VqP5ZzGUYUhm65img== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694624368; a=rsa-sha256; cv=none; b=pXpLv9Ka8GZOcqh3aSd2Qqe07mQsOC7ZGBsNrV6kAVTdh6SKIybBXS9ELRfdIvhKkWbmo8 F9z8JPI2tLSMogK1+Y5oA9vYlyRRjGvqiGnbdr/7WEDmzSQ7bC+8yLa5SUa2M/VhXcSWEu R8iqXSv7dhppBwSpldRT1ICoefqHTZ5oaX50HNpKb4808A2/6kcSOKUZ/uENvCywMnuA8V pjvjuxu30BcPk7oKzynjUY0/+9eJC/2DWBxKx/CzcgCRzinnnyAiGiy3gcjDs+P+hzD4TM cVMCUndDVYQNWdfcZHg6ytJFcKP14Y5XO5FmqoxAew8M3QsKy/qyIGjcNWn2jA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=cUzQ+5+4; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgTCm-0002eR-I0; Wed, 13 Sep 2023 12:59:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qgTCd-0002Se-QB for guix-patches@gnu.org; Wed, 13 Sep 2023 12:59:00 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qgTCd-0004s8-I6 for guix-patches@gnu.org; Wed, 13 Sep 2023 12:58:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qgTCh-0002TA-L7; Wed, 13 Sep 2023 12:59:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65922] [qt-team PATCH 3/4] gnu: qtbase: Reinstate date related tests. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: andreas@enge.fr, iyzsong@envs.net, guix-patches@gnu.org Resent-Date: Wed, 13 Sep 2023 16:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65922 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65922@debbugs.gnu.org Cc: Maxim Cournoyer , Andreas Enge , =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= X-Debbugs-Original-Xcc: Andreas Enge , =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Received: via spool by 65922-submit@debbugs.gnu.org id=B65922.16946243349450 (code B ref 65922); Wed, 13 Sep 2023 16:59:03 +0000 Received: (at 65922) by debbugs.gnu.org; 13 Sep 2023 16:58:54 +0000 Received: from localhost ([127.0.0.1]:35847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgTCX-0002SH-W2 for submit@debbugs.gnu.org; Wed, 13 Sep 2023 12:58:54 -0400 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]:52624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgTCR-0002RN-63 for 65922@debbugs.gnu.org; Wed, 13 Sep 2023 12:58:50 -0400 Received: by mail-qv1-xf2c.google.com with SMTP id 6a1803df08f44-655de2a5121so298726d6.1 for <65922@debbugs.gnu.org>; Wed, 13 Sep 2023 09:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694624316; x=1695229116; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t4iv9XSOREb5XDgrciR/Isy3gPeaNil721EVP6WSK2M=; b=cUzQ+5+4Dj1S6LV2ZNSlkDYkGEgs7cPjHvXotl9rsvMrZpUTeEMSUAWtVYGAfLjcja SZKsDPqFzppJW7PkoKvpRHWPr2LyHRSn4gXiqiI0ke9qTKfEAOElVjHJf8XtwEoCQhSR /ri1nGgI5S/C3g/stMb4rqWJO/0bShfxODl2X9vC27fNrMcWX/Vq4OWOZ8z5QM2HnWUY NvHkjuI30zm+eIjGNdvb48Eq/oZ3OwukPLhItabvyAjesr6x8ihCvKzX/WWdGmYZ3WkT s+r79sAib3hjT0TnsxQIN7ouVGqFHP8uw9Cso6j/es5WB70jRPTYBPjnTfNpUp7CLYQ6 FtGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694624316; x=1695229116; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t4iv9XSOREb5XDgrciR/Isy3gPeaNil721EVP6WSK2M=; b=BWpqyEXiOyoflvmstr/cK6trr3zkiB8kKT+eMmQfMPYu1kp+gRvReDySuTAFl38N/L 2A2MDRCuBY3sVShlaESjTc6vI+0oqjYB5YOTWYi2t5W72TOpxtsWt6meeeaKVh6MLLq/ dzHK4mCNW0Em/wCy90dC/y7czSfXmWOlBSXS2993ORR08UpyClAfIaTnHwadrBiWrogM 8SI5YIWHqZeZrOUU9ZKWI8FgWXSwMGymst5ftA1IpGGkjG4JEjzUU4fKuYdaKiT+Irtx ozsjg6D0LV4B3XC9SpelBhXtCw8ZOj6vMAtzBaJGlCrww4OE//PeCQft7IV15iQ1ppoi Ywsg== X-Gm-Message-State: AOJu0YxpD9iXLEjFsulAeSgNXy2L4bummk83jqtRvkb3qtGoEIAG4wPZ 4EZPRKX2k5b0O+L/RWqQzQUXfnNRYLg= X-Google-Smtp-Source: AGHT+IEjHB07GtXEZiY44WcAAk9JrTpZ0w9qxEhgPgKaMYJSbXpp9y4fn4QJKSzQh6YmFdlX3+0IRw== X-Received: by 2002:a05:6214:4607:b0:64f:82d2:26fe with SMTP id oq7-20020a056214460700b0064f82d226femr3594369qvb.39.1694624316063; Wed, 13 Sep 2023 09:58:36 -0700 (PDT) Received: from localhost.localdomain (dsl-149-165.b2b2c.ca. [66.158.149.165]) by smtp.gmail.com with ESMTPSA id d13-20020a0cf0cd000000b0063fbfbde4adsm4526644qvl.129.2023.09.13.09.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 09:58:35 -0700 (PDT) From: Maxim Cournoyer Date: Wed, 13 Sep 2023 12:58:23 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 7.72 X-Spam-Score: 7.72 X-Migadu-Queue-Id: 56D5C64312 X-Migadu-Scanner: mx0.migadu.com X-TUID: aTxRLZmfHUk2 * 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 +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 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