Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 737914 - dev-qt/qtcore-5.15 sets timezone to UTC when /etc/localtime is not a symbolic link
Summary: dev-qt/qtcore-5.15 sets timezone to UTC when /etc/localtime is not a symbolic...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL: https://archives.gentoo.org/gentoo-de...
Whiteboard:
Keywords: UPSTREAM
: 739668 (view as bug list)
Depends on:
Blocks: 734600
  Show dependency tree
 
Reported: 2020-08-18 15:56 UTC by Markus
Modified: 2022-01-19 17:01 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus 2020-08-18 15:56:13 UTC
Checked in qtbase 5.15 at ./src/corelib/time/qtimezoneprivate_tz.cpp
The systems timezone is detected by $TZ or by reading the target of the sym-link /etc/localtime or by /etc/TZ.
None of those is valid in my system, so UTC is selected: According to the handbook I set the timezone in /etc/timezone and sys-libs/timezone-data copies the right file to /etc/timezone.

As workaround I used "ln -s /etc/timezone /etc/TZ".

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2020-08-19 08:49:36 UTC
I checked that on a Ubuntu system where /etc/timezone is a text file containing "Europe/Amsterdam" (in my case) and where /etc/localtime is the usual symlink. It looks like QTzTimeZonePrivate::systemTimeZoneId only checks for the symbolic link, indeed.
Comment 3 Herbert Wantesh 2020-09-19 18:39:31 UTC
copying the zonefile to /etc/localtime is a good idea, as /usr could be on a separate partition. How about creating the 

/etc/TZ -> /etc/timezone softlink by default?
Comment 4 Andreas Sturmlechner gentoo-dev 2020-10-04 17:57:21 UTC
So, what can we do here?
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2020-10-09 21:04:37 UTC
(In reply to Andreas Sturmlechner from comment #4)
> So, what can we do here?

https://github.com/qt/qtbase/commit/87b07a60da183a60a7e7c79e5daa3ab69a03b4c3

How about just backporting this?

(I want a pony.)
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2020-10-10 11:00:48 UTC
(In reply to Andreas K. Hüttel from comment #5)
> (In reply to Andreas Sturmlechner from comment #4)
> > So, what can we do here?
> 
> https://github.com/qt/qtbase/commit/87b07a60da183a60a7e7c79e5daa3ab69a03b4c3
> 
> How about just backporting this?
> 
> (I want a pony.)

Unfortunately that's not the full solution.
(The digital clock now doesnt even appear anymore...)
Comment 7 Larry the Git Cow gentoo-dev 2020-10-10 17:40:04 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8cc44eb4b719129f109dfa623efd5420d1665b63

commit 8cc44eb4b719129f109dfa623efd5420d1665b63
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2020-10-10 17:39:33 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2020-10-10 17:40:00 +0000

    dev-qt/qtcore: Revert timezone handling to 5.14 state
    
    This is an obvious workaround, until we and upstream have
    decided what to do...
    
    Closes: https://bugs.gentoo.org/737914
    Package-Manager: Portage-3.0.4, Repoman-3.0.1
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 dev-qt/qtcore/files/qtcore-5.15.1-timezone-1.patch | 271 +++++++++++++++++++++
 dev-qt/qtcore/files/qtcore-5.15.1-timezone-2.patch |  47 ++++
 dev-qt/qtcore/qtcore-5.15.1-r1.ebuild              | 104 ++++++++
 3 files changed, 422 insertions(+)
Comment 8 Andreas Sturmlechner gentoo-dev 2020-10-10 17:49:04 UTC
*** Bug 739668 has been marked as a duplicate of this bug. ***
Comment 9 Andreas Sturmlechner gentoo-dev 2022-01-19 11:49:23 UTC
Lars, nvm if I remember incorrectly but please test the linked upstream qtbase MR (patches against qtcore) if you still have a system with separate /usr and/or /etc/{timezone,localtime} as file.
Comment 10 Larry the Git Cow gentoo-dev 2022-01-19 16:50:31 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/qt.git/commit/?id=99ee62b2dd16d747c666d86a12c005c5c356dbe9

commit 99ee62b2dd16d747c666d86a12c005c5c356dbe9
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2022-01-19 16:49:25 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2022-01-19 16:49:39 +0000

    dev-qt/qtcore: Drop obsolete downstream reverts
    
    Upstream MR was merged:
    https://invent.kde.org/qt/qt/qtbase/-/merge_requests/111
    
    QTBUG: https://bugreports.qt.io/browse/QTBUG-87326
    
    Bug: https://bugs.gentoo.org/737914
    Package-Manager: Portage-3.0.30, Repoman-3.0.3
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 dev-qt/qtcore/files/qtcore-5.15.1-timezone-1.patch | 271 ---------------------
 dev-qt/qtcore/files/qtcore-5.15.1-timezone-2.patch |  47 ----
 dev-qt/qtcore/qtcore-5.15.2.9999.ebuild            |   3 +-
 3 files changed, 1 insertion(+), 320 deletions(-)
Comment 11 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2022-01-19 16:58:49 UTC
(In reply to Andreas Sturmlechner from comment #9)
> Lars, nvm if I remember incorrectly but please test the linked upstream
> qtbase MR (patches against qtcore) if you still have a system with separate
> /usr and/or /etc/{timezone,localtime} as file.

Hi Andreas,

sorry for not responding earlier, my day was quite stuffed with online meetings.
If you still want to have it tested, I can do so tomorrow...
Comment 12 Andreas Sturmlechner gentoo-dev 2022-01-19 17:01:14 UTC
Wouldn't hurt before we cut a new snapshot, but take your time.

It is rather easy by adding qt overlay and building qtcore-5.15.2.9999 instead of latest snapshot in ::gentoo.