Skip to content

Commit 712d9b4

Browse files
hebastofanquake
andcommitted
build: Makes rcc output always deterministic
The Qt Resource Compiler (rcc) has a command-line option `--format-version` which has the default value 2. The only difference from `--format-version 1` is adding a last modified timestamp to the output file. That, in turn, forces us to use `QT_RCC_SOURCE_DATE_OVERRIDE=1` to get deterministic builds. This change makes rcc output always deterministic by using `--format-version 1` option that makes usage of the `QT_RCC_SOURCE_DATE_OVERRIDE` needless. Also it improves interaction with ccache. Co-authored-by: fanquake <[email protected]>
1 parent 585cbe2 commit 712d9b4

File tree

6 files changed

+2
-7
lines changed

6 files changed

+2
-7
lines changed

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ script: |
5656
HOST_LDFLAGS_BASE="-static-libstdc++ -Wl,-O2"
5757
5858
export QT_RCC_TEST=1
59-
export QT_RCC_SOURCE_DATE_OVERRIDE=1
6059
export TZ="UTC"
6160
export BUILD_DIR="$PWD"
6261
mkdir -p ${WRAP_DIR}

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ script: |
4242
FAKETIME_PROGS="ar ranlib date dmg xorrisofs"
4343
4444
export QT_RCC_TEST=1
45-
export QT_RCC_SOURCE_DATE_OVERRIDE=1
4645
export TZ="UTC"
4746
export BUILD_DIR="$PWD"
4847
mkdir -p ${WRAP_DIR}

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ script: |
3838
HOST_CXXFLAGS="-O2 -g -fno-ident"
3939
4040
export QT_RCC_TEST=1
41-
export QT_RCC_SOURCE_DATE_OVERRIDE=1
4241
export TZ="UTC"
4342
export BUILD_DIR="$PWD"
4443
mkdir -p ${WRAP_DIR}

contrib/guix/libexec/build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ esac
176176

177177
# Environment variables for determinism
178178
export QT_RCC_TEST=1
179-
export QT_RCC_SOURCE_DATE_OVERRIDE=1
180179
export TAR_OPTIONS="--owner=0 --group=0 --numeric-owner --mtime='@${SOURCE_DATE_EPOCH}' --sort=name"
181180
export TZ="UTC"
182181
case "$HOST" in

depends/packages/qt.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ $(package)_config_opts_x86_64_android += -android-arch x86_64
174174
$(package)_config_opts_i686_android += -android-arch i686
175175

176176
$(package)_build_env = QT_RCC_TEST=1
177-
$(package)_build_env += QT_RCC_SOURCE_DATE_OVERRIDE=1
178177
endef
179178

180179
define $(package)_fetch_cmds

src/Makefile.qt.include

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,13 @@ translate: $(srcdir)/qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCO
360360
$(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
361361
@test -f $(RCC)
362362
@cp -f $< $(@D)/temp_$(<F)
363-
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin_locale $(@D)/temp_$(<F) | \
363+
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin_locale --format-version 1 $(@D)/temp_$(<F) | \
364364
$(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@
365365
@rm $(@D)/temp_$(<F)
366366

367367
$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_FONTS) $(RES_ICONS) $(RES_ANIMATION)
368368
@test -f $(RCC)
369-
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \
369+
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin --format-version 1 $< | \
370370
$(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@
371371

372372
CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno qt/temp_bitcoin_locale.qrc

0 commit comments

Comments
 (0)