Skip to content

Commit f17d340

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 e16f872 commit f17d340

File tree

6 files changed

+2
-8
lines changed

6 files changed

+2
-8
lines changed

contrib/gitian-descriptors/gitian-linux.yml

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

contrib/gitian-descriptors/gitian-osx.yml

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

contrib/gitian-descriptors/gitian-win.yml

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

contrib/guix/libexec/build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ case "$HOST" in
175175
esac
176176

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

depends/packages/qt.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ $(package)_config_opts_aarch64_android += -android-arch arm64-v8a
172172
$(package)_config_opts_armv7a_android += -android-arch armeabi-v7a
173173
$(package)_config_opts_x86_64_android += -android-arch x86_64
174174
$(package)_config_opts_i686_android += -android-arch i686
175-
176-
$(package)_build_env += QT_RCC_SOURCE_DATE_OVERRIDE=1
177175
endef
178176

179177
define $(package)_fetch_cmds

src/Makefile.qt.include

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

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

374374
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)