Skip to content

depends: Allow building Qt packages after interruption#34713

Merged
fanquake merged 1 commit intobitcoin:masterfrom
hebasto:260302-qt-mkdir
Mar 5, 2026
Merged

depends: Allow building Qt packages after interruption#34713
fanquake merged 1 commit intobitcoin:masterfrom
hebasto:260302-qt-mkdir

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Mar 2, 2026

If a build is interrupted, a standard mkdir command may fail if the directory already exists. Switching to mkdir -p ensures the build can resume gracefully.

Fix #34712.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 2, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK sedited

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

@ghost
Copy link

ghost commented Mar 2, 2026

I took a quick look at the failure mode shown in the issue log. Changing mkdir to mkdir -p does avoid the immediate “File exists” error, but I’m not sure it fully covers the interrupted-build case.

If the job gets killed while qtbase/qttranslations/qttools/cmake are being populated, those directories can be left half-extracted. On the rerun, mkdir -p will continue without failing, but the build may now proceed using a partially extracted tree, which could later show up as harder-to-trace configure or build errors.

One possible alternative would be to make the extract step explicitly restart-safe by clearing those directories before re-extracting, for example in both depends/packages/native_qt.mk and depends/packages/qt.mk:

$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
rm -rf qtbase qttranslations qttools cmake && \
mkdir qtbase && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \
mkdir qttranslations && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \
mkdir qttools && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \
mkdir cmake && \
cp ...

This does mean a rerun may redo the extraction work, but it guarantees that rerunning make starts from a clean extracted state instead of whatever was left behind after the interruption.

I tried this locally by interrupting the depends build during extraction and rerunning make, and it resumed cleanly using this approach as well.

@DrahtBot DrahtBot removed the CI failed label Mar 3, 2026
@hebasto
Copy link
Member Author

hebasto commented Mar 4, 2026

I took a quick look at the failure mode shown in the issue log. Changing mkdir to mkdir -p does avoid the immediate “File exists” error, but I’m not sure it fully covers the interrupted-build case.

If the job gets killed while qtbase/qttranslations/qttools/cmake are being populated, those directories can be left half-extracted. On the rerun, mkdir -p will continue without failing, but the build may now proceed using a partially extracted tree, which could later show up as harder-to-trace configure or build errors.

One possible alternative would be to make the extract step explicitly restart-safe by clearing those directories before re-extracting, for example in both depends/packages/native_qt.mk and depends/packages/qt.mk:

$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
rm -rf qtbase qttranslations qttools cmake && \
mkdir qtbase && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \
mkdir qttranslations && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \
mkdir qttools && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \
mkdir cmake && \
cp ...

This does mean a rerun may redo the extraction work, but it guarantees that rerunning make starts from a clean extracted state instead of whatever was left behind after the interruption.

I tried this locally by interrupting the depends build during extraction and rerunning make, and it resumed cleanly using this approach as well.

I'll leave the branch as is for now, as it follows the current defaults:

$(1)_extract_cmds ?= mkdir -p $$($(1)_extract_dir) && echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_TAR) --no-same-owner --strip-components=1 -xf $$($(1)_source)

Copy link
Contributor

@sedited sedited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 2a7a4f6

@fanquake fanquake merged commit fc39a4f into bitcoin:master Mar 5, 2026
51 of 52 checks passed
@hebasto hebasto deleted the 260302-qt-mkdir branch March 5, 2026 14:58
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Mar 5, 2026
@fanquake fanquake mentioned this pull request Mar 5, 2026
@fanquake
Copy link
Member

fanquake commented Mar 5, 2026

Backported to 30.x in #34689.

fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Mar 9, 2026
fanquake added a commit that referenced this pull request Mar 11, 2026
49a777d doc: update release notes for v30.x (fanquake)
0f9e08f doc: update build guides pre v31 (fanquake)
597ac36 doc: Fix `fee` field in `getblock` RPC result (nervana21)
47ed306 depends: Allow building Qt packages after interruption (Hennadii Stepanov)
d221d1c psbt: validate pubkeys in MuSig2 pubnonce/partial sig deserialization (tboy1337)
e1210ac doc: Improve dependencies.md IPC documentation (Ryan Ofsky)
c17a5cd test: Add missing timeout_factor to zmq socket (MarcoFalke)
3042509 netif: fix compilation warning in QueryDefaultGatewayImpl() (MarcoFalke)
475a5b0 refactor: Use static_cast<decltype(...)> to suppress integer sanitizer warning (MarcoFalke)
7220ee3 util: Fix UB in SetStdinEcho when ENOTTY (MarcoFalke)

Pull request description:

  Backports:
  * #34093
  * #34219
  * #34597
  * #34690
  * #34702
  * #34706
  * #34713
  * #34789

ACKs for top commit:
  marcofleon:
    ACK 49a777d

Tree-SHA512: b4ce54860b7306b22de75bb093ad574110875253e4ea3ca96a736809c8291dea1144a617c8791f36618d8e367022709ba5cf84ca0e450ef6d76394ab80f22e2f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: interrupted Qt build cannot be restarted

4 participants