GNU bug report logs - #34165
[PATCH] gnu: bitcoin-core: Make bitcoin-qt deterministic.

Previous Next

Package: guix-patches;

Reported by: Carl Dong <contact <at> carldong.me>

Date: Mon, 21 Jan 2019 20:26:03 UTC

Owned by: bavier <at> member.fsf.org

Severity: normal

Tags: patch

Done: Danny Milosavljevic <dannym <at> scratchpost.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34165 in the body.
You can then email your comments to 34165 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#34165; Package guix-patches. (Mon, 21 Jan 2019 20:26:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carl Dong <contact <at> carldong.me>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 21 Jan 2019 20:26:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carl Dong <contact <at> carldong.me>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [PATCH] gnu: bitcoin-core: Make bitcoin-qt deterministic.
Date: Mon, 21 Jan 2019 19:55:35 +0000
From 2b3162dde22a5d44eb5910b0fcfa07318f935aaf Mon Sep 17 00:00:00 2001
From: Carl Dong <accounts <at> carldong.me>
Date: Mon, 21 Jan 2019 14:51:57 -0500
Subject: [PATCH] gnu: bitcoin-core: Make bitcoin-qt deterministic.

* gnu/packages/finance.scm: Make bitcoin-qt deterministic.
---
 gnu/packages/finance.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 468388797..96df919c4 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -115,6 +115,9 @@
                          "/bin/lupdate"))
        #:phases
         (modify-phases %standard-phases
+          (add-before 'configure 'qt-time
+           (lambda _
+            (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1"))) ; Make QT deterministic
           (add-before 'check 'set-home
            (lambda _
             (setenv "HOME" (getenv "TMPDIR"))))))) ; Tests write to $HOME.
--
2.20.1





Reply sent to Danny Milosavljevic <dannym <at> scratchpost.org>:
You have taken responsibility. (Tue, 22 Jan 2019 14:29:02 GMT) Full text and rfc822 format available.

Notification sent to Carl Dong <contact <at> carldong.me>:
bug acknowledged by developer. (Tue, 22 Jan 2019 14:29:02 GMT) Full text and rfc822 format available.

Message #10 received at 34165-done <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Carl Dong <contact <at> carldong.me>
Cc: 34165-done <at> debbugs.gnu.org
Subject: Re: [bug#34165] [PATCH] gnu: bitcoin-core: Make bitcoin-qt
 deterministic.
Date: Tue, 22 Jan 2019 15:28:15 +0100
[Message part 1 (text/plain, inline)]
Thanks!

Pushed this as commit 99629e5a110a9a91151bd0e63a1805446996a3c8 to guix master.
[Message part 2 (application/pgp-signature, inline)]

Owner recorded as bavier <at> member.fsf.org. Request was from Eric Bavier <ericbavier <at> centurylink.net> to control <at> debbugs.gnu.org. (Tue, 22 Jan 2019 15:15:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org, bavier <at> member.fsf.org:
bug#34165; Package guix-patches. (Wed, 23 Jan 2019 09:08:02 GMT) Full text and rfc822 format available.

Message #15 received at 34165 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Carl Dong <contact <at> carldong.me>
Cc: 34165 <at> debbugs.gnu.org
Subject: Re: [bug#34165] [PATCH] gnu: bitcoin-core: Make bitcoin-qt
 deterministic.
Date: Wed, 23 Jan 2019 10:07:06 +0100
Hi!

Carl Dong <contact <at> carldong.me> skribis:

>>From 2b3162dde22a5d44eb5910b0fcfa07318f935aaf Mon Sep 17 00:00:00 2001
> From: Carl Dong <accounts <at> carldong.me>
> Date: Mon, 21 Jan 2019 14:51:57 -0500
> Subject: [PATCH] gnu: bitcoin-core: Make bitcoin-qt deterministic.

[...]

> +          (add-before 'configure 'qt-time
> +           (lambda _
> +            (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1"))) ; Make QT deterministic

Looking at this and the upstream commit¹, I’m thinking maybe we should
do the same in other Qt applications.  Any idea how we can identify
applications where it’s needed?

Thanks,
Ludo’.

¹ https://github.com/qt/qtbase/commit/38271e9298dcf48652a6e2e08414a940a97867fa




Information forwarded to guix-patches <at> gnu.org, bavier <at> member.fsf.org:
bug#34165; Package guix-patches. (Fri, 25 Jan 2019 10:31:01 GMT) Full text and rfc822 format available.

Message #18 received at 34165 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 34165 <at> debbugs.gnu.org, Carl Dong <contact <at> carldong.me>
Subject: Re: [bug#34165] [PATCH] gnu: bitcoin-core: Make bitcoin-qt
 deterministic.
Date: Wed, 23 Jan 2019 15:41:43 +0100
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi!
>
> Carl Dong <contact <at> carldong.me> skribis:
>
>>>From 2b3162dde22a5d44eb5910b0fcfa07318f935aaf Mon Sep 17 00:00:00 2001
>> From: Carl Dong <accounts <at> carldong.me>
>> Date: Mon, 21 Jan 2019 14:51:57 -0500
>> Subject: [PATCH] gnu: bitcoin-core: Make bitcoin-qt deterministic.
>
> [...]
>
>> +          (add-before 'configure 'qt-time
>> +           (lambda _
>> +            (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1"))) ; Make QT deterministic
>
> Looking at this and the upstream commit¹, I’m thinking maybe we should
> do the same in other Qt applications.  Any idea how we can identify
> applications where it’s needed?
>
> ¹
> https://github.com/qt/qtbase/commit/38271e9298dcf48652a6e2e08414a940a97867fa

This is a bit unfortunate.  It seems to me that the original intent of
the patch was to support SOURCE_DATE_EPOCH as the commit message
mentions that variable’s specification.  Pity that it is now a custom Qt
variable.

This probably should be used for all packages that generate resource
files, which I assume are most non-trivial applications.  I think it’s
fine to add it to all packages using qtbase.

--
Ricardo





Information forwarded to guix-patches <at> gnu.org, bavier <at> member.fsf.org:
bug#34165; Package guix-patches. (Sat, 26 Jan 2019 18:08:02 GMT) Full text and rfc822 format available.

Message #21 received at 34165 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 34165 <at> debbugs.gnu.org,
 Carl Dong <contact <at> carldong.me>
Subject: Re: [bug#34165] [PATCH] gnu: bitcoin-core: Make bitcoin-qt
 deterministic.
Date: Sat, 26 Jan 2019 20:07:48 +0200
[Message part 1 (text/plain, inline)]
On Wed, Jan 23, 2019 at 03:41:43PM +0100, Ricardo Wurmus wrote:
> 
> 
> This is a bit unfortunate.  It seems to me that the original intent of
> the patch was to support SOURCE_DATE_EPOCH as the commit message
> mentions that variable’s specification.  Pity that it is now a custom Qt
> variable.
> 

We could just add it in to the gnu-build-system and set the variable in
all events. Or patch qt/qtbase to accept SOURCE_DATE_EPOCH in place of
their own variable.

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org, bavier <at> member.fsf.org:
bug#34165; Package guix-patches. (Sun, 27 Jan 2019 22:40:01 GMT) Full text and rfc822 format available.

Message #24 received at 34165 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 34165 <at> debbugs.gnu.org,
 Carl Dong <contact <at> carldong.me>
Subject: Re: [bug#34165] [PATCH] gnu: bitcoin-core: Make bitcoin-qt
 deterministic.
Date: Sun, 27 Jan 2019 23:39:07 +0100
Efraim Flashner <efraim <at> flashner.co.il> skribis:

> On Wed, Jan 23, 2019 at 03:41:43PM +0100, Ricardo Wurmus wrote:
>> 
>> 
>> This is a bit unfortunate.  It seems to me that the original intent of
>> the patch was to support SOURCE_DATE_EPOCH as the commit message
>> mentions that variable’s specification.  Pity that it is now a custom Qt
>> variable.
>> 
>
> We could just add it in to the gnu-build-system and set the variable in
> all events. Or patch qt/qtbase to accept SOURCE_DATE_EPOCH in place of
> their own variable.

Either way is fine with me.  Adding it to the ‘set-SOURCE-DATE-EPOCH’
phase in ‘core-updates’ would be reasonable IMO.

Ludo’.




Information forwarded to guix-patches <at> gnu.org, bavier <at> member.fsf.org:
bug#34165; Package guix-patches. (Mon, 28 Jan 2019 11:08:02 GMT) Full text and rfc822 format available.

Message #27 received at 34165 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 34165 <at> debbugs.gnu.org,
 Carl Dong <contact <at> carldong.me>
Subject: Re: [bug#34165] [PATCH] gnu: bitcoin-core: Make bitcoin-qt
 deterministic.
Date: Mon, 28 Jan 2019 12:07:20 +0100
[Message part 1 (text/plain, inline)]
Hi,

> > https://github.com/qt/qtbase/commit/38271e9298dcf48652a6e2e08414a940a97867fa  
> 
> This is a bit unfortunate.  It seems to me that the original intent of
> the patch was to support SOURCE_DATE_EPOCH as the commit message
> mentions that variable’s specification.  Pity that it is now a custom Qt
> variable.

I asked them and they said [1]:

>There was a policy to prefix variables with QT_ and I did not want to discuss more with the reviewer.
>But later, this was merged:
>https://codereview.qt-project.org/#/c/243636/4/src/tools/rcc/rcc.cpp,unified

[1] https://github.com/qt/qtbase/commit/38271e9298dcf48652a6e2e08414a940a97867fa#commitcomment-32085478

https://codereview.qt-project.org/#/c/243636/4/src/tools/rcc/rcc.cpp,unified contains the following patch:

...
228	228	         const QDateTime lastModified = m_fileInfo.lastModified();
	229	229	         quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0);
	230	230	         static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong(
);
	231	231	         if (sourceDate != 0)
	232	232	             lastmod = sourceDate;
		233	+        static const quint64 sourceDate2 = 1000 * qgetenv("SOURCE_DATE_EPOCH").toULongLong();
		234	+        if (sourceDate2 != 0)
		235	+            lastmod = sourceDate2;
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org, bavier <at> member.fsf.org:
bug#34165; Package guix-patches. (Mon, 28 Jan 2019 13:40:02 GMT) Full text and rfc822 format available.

Message #30 received at 34165 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 34165 <at> debbugs.gnu.org,
 Carl Dong <contact <at> carldong.me>
Subject: Re: [bug#34165] [PATCH] gnu: bitcoin-core: Make bitcoin-qt
 deterministic.
Date: Mon, 28 Jan 2019 14:39:35 +0100
Hi Danny,

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> [1] https://github.com/qt/qtbase/commit/38271e9298dcf48652a6e2e08414a940a97867fa#commitcomment-32085478
>
> https://codereview.qt-project.org/#/c/243636/4/src/tools/rcc/rcc.cpp,unified contains the following patch:
>
> ...
> 228	228	         const QDateTime lastModified = m_fileInfo.lastModified();
> 	229	229	         quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0);
> 	230	230	         static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong(
> );
> 	231	231	         if (sourceDate != 0)
> 	232	232	             lastmod = sourceDate;
> 		233	+        static const quint64 sourceDate2 = 1000 * qgetenv("SOURCE_DATE_EPOCH").toULongLong();
> 		234	+        if (sourceDate2 != 0)
> 		235	+            lastmod = sourceDate2;

Nice, so maybe we don’t need to change anything and just wait for the
next Qt version?

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 26 Feb 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 53 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.