From #13406, changed travis job target for Mac to all deploy, but this could cause a race condition.
Simply add .NOTPARALLEL to avoid it.
Related jobs:
https://travis-ci.org/bitcoin/bitcoin/jobs/391863281
https://travis-ci.org/bitcoin/bitcoin/jobs/391907335
Close #13469
Avoid concurrency issue when make multiple target #13465
pull ken2812221 wants to merge 1 commits into bitcoin:master from ken2812221:no_parallel changing 1 files +2 −2-
ken2812221 commented at 12:59 AM on June 14, 2018: contributor
- fanquake added the label Build system on Jun 14, 2018
-
fanquake commented at 1:21 AM on June 14, 2018: member
From make: Special Targets:
.NOTPARALLEL
If .NOTPARALLEL is mentioned as a target, then this invocation of make will be run serially, even if the ā-jā option is given. Any recursively invoked make command will still run recipes in parallel (unless its makefile also contains this target). Any prerequisites on this target are ignored.
- fanquake requested review from theuni on Jun 14, 2018
-
laanwj commented at 11:23 AM on June 14, 2018: member
Will this make the entire build non-parallel? If so, that would be bad.
-
ken2812221 commented at 11:54 AM on June 14, 2018: contributor
Will this make the entire build non-parallel? If so, that would be bad.
As @fanquake posted
Any recursively invoked make command will still run recipes in parallel
The code building targets are still can run in parallel because they are in src/Makefile, this change only affect the target in the top Makefile.
-
laanwj commented at 3:55 PM on June 14, 2018: member
ok utACK from me in that case
-
theuni commented at 5:06 PM on June 14, 2018: member
If there's a race condition, something's broken. We should clarify the dependencies rather than serializing. Any idea where things break down?
-
theuni commented at 5:34 PM on June 14, 2018: member
I think that this should be enough to fix it. Untested:
diff --git a/Makefile.am b/Makefile.am index 8a8debb..3a725d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -95,7 +95,7 @@ $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS) $(MKDIR_P) $(@D) $(INSTALL_DATA) $< $@ -$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN) +$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: all-recursive $(MKDIR_P) $(@D) STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@I believe the issue is that the top-level calls a sub-make for all, as well as for src/qt/bitcoin-qt, and those end up racing. Solve that by having deploy depend on the sub-make already being complete, which also matches the way the Windows dependencies are handled.
As a side-effect, this makes
make deploydo what you wanted it to do in the beginning :) - ken2812221 force-pushed on Jun 14, 2018
-
Avoid concurrency issue cf01fd6f9c
- ken2812221 force-pushed on Jun 14, 2018
-
ken2812221 commented at 11:32 PM on June 14, 2018: contributor
@theuni Fixed
-
promag commented at 11:56 PM on June 14, 2018: member
utACK cf01fd6, makes sense!
-
theuni commented at 5:09 PM on June 15, 2018: member
@ken2812221 Thanks!
Tested locally. I can easily reproduce the racy build failure in master, and this appears to fix it.
- theuni approved
- MarcoFalke referenced this in commit 81069a75bd on Jun 15, 2018
- MarcoFalke merged this on Jun 15, 2018
- MarcoFalke closed this on Jun 15, 2018
- ken2812221 deleted the branch on Jun 15, 2018
- PastaPastaPasta referenced this in commit 965d601285 on Jul 7, 2020
- MarcoFalke locked this on Sep 8, 2021