diff options
author | James Addison <jay@jp-hosting.net> | 2023-12-30 21:20:41 +0000 |
---|---|---|
committer | James Addison <jay@jp-hosting.net> | 2024-01-01 13:26:18 +0000 |
commit | f11d7e4af73ca474ab71310961b155f6c9bc71da (patch) | |
tree | 61eb805a1a5690c1f2d605f657a7afe38d68d933 /src/assistant/qhelpgenerator/main.cpp | |
parent | e66b37641bee97d0e52931ee73d1ba9ac609a7d0 (diff) |
qhelpgenerator: localize SOURCE_DATE_EPOCH to UTC
The SOURCE_DATE_EPOCH environment variable is used as an anchor
timestamp that software builds can use when they embed timestamps
that refer to the build-time into their build artifacts.
The value of the variable is specified[1] as an integer number of
seconds since the Unix epoch (1970-01-01T00:00:00Z).
To ensure that the value is interpreted correctly, and to ensure
that the resulting timestamps embedded by qhelpgenerator cannot
drift with the build environment's timezone settings, we should
store the SOURCE_DATE_EPOCH in QDateTime instances that have a UTC
timezone.
[1] - https://reproducible-builds.org/specs/source-date-epoch/
Task-number: QTBUG-62697
Change-Id: I24a79088886adf9334cd7c3c6f723eb9f064007d
Pick-to: 6.6 6.7
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Diffstat (limited to 'src/assistant/qhelpgenerator/main.cpp')
-rw-r--r-- | src/assistant/qhelpgenerator/main.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/assistant/qhelpgenerator/main.cpp b/src/assistant/qhelpgenerator/main.cpp index cad0095c4..ca5549974 100644 --- a/src/assistant/qhelpgenerator/main.cpp +++ b/src/assistant/qhelpgenerator/main.cpp @@ -92,6 +92,7 @@ int generateCollectionFile(const QByteArray &data, const QString &basePath, cons if (!config.filesToRegister().isEmpty()) { if (Q_UNLIKELY(qEnvironmentVariableIsSet("SOURCE_DATE_EPOCH"))) { QDateTime dt; + dt.setTimeZone(QTimeZone::UTC); dt.setSecsSinceEpoch(qEnvironmentVariableIntValue("SOURCE_DATE_EPOCH")); CollectionConfiguration::updateLastRegisterTime(helpEngine, dt); } else { |