Skip to content

Commit a58868d

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 32692d2 commit a58868d

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
@@ -56,7 +56,6 @@ script: |
5656
HOST_CXXFLAGS="-O2 -g"
5757
HOST_LDFLAGS_BASE="-static-libstdc++ -Wl,-O2"
5858
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_HOST_PROGS=""
4343
FAKETIME_PROGS="ar ranlib date dmg xorrisofs"
4444
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_CFLAGS="-O2 -g -fno-ident"
3939
HOST_CXXFLAGS="-O2 -g -fno-ident"
4040
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
@@ -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
@@ -365,12 +365,12 @@ translate: $(srcdir)/qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCO
365365
$(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
366366
@test -f $(RCC)
367367
@cp -f $< $(@D)/temp_$(<F)
368-
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin_locale $(@D)/temp_$(<F) > $@
368+
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin_locale --format-version 1 $(@D)/temp_$(<F) > $@
369369
@rm $(@D)/temp_$(<F)
370370

371371
$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_FONTS) $(RES_ICONS) $(RES_ANIMATION)
372372
@test -f $(RCC)
373-
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< > $@
373+
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin --format-version 1 $< > $@
374374

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

0 commit comments

Comments
 (0)