diff options
| -rw-r--r-- | meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch | 77 | 
1 files changed, 70 insertions, 7 deletions
| diff --git a/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch b/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch index 02b5244f3a..152667661e 100644 --- a/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch +++ b/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch | |||
| @@ -1,23 +1,86 @@ | |||
| 1 | From c9bd05e8f0ad805b81625cfa717d06071cfd9b48 Mon Sep 17 00:00:00 2001 | 1 | From c9bd05e8f0ad805b81625cfa717d06071cfd9b48 Mon Sep 17 00:00:00 2001 | 
| 2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> | 
| 3 | Date: Wed, 16 Oct 2024 22:52:38 -0700 | 3 | Date: Wed, 16 Oct 2024 22:52:38 -0700 | 
| 4 | Subject: [PATCH] unix-common.mk: Ensuring Sequential Execution of rm and ln commands | 4 | Subject: [PATCH] unix-common.mk: Avoid race condition between mutliple make calls running in parallel | 
| 5 | 5 | ||
| 6 | With high parallel execution, it results in race condition where | 6 | With high parallel execution, it results in race condition where | 
| 7 | its trying to create symlink while the original symlink while rm is | 7 | its trying to create symlink while the original symlink while rm is | 
| 8 | not done deleting the existing file yet. | 8 | not done deleting the existing file yet. | 
| 9 | 9 | ||
| 10 | force sequential execution by adding dependencies between the steps | 10 | The issue is that submake for libxmlrpc_util.so is called 12 times | 
| 11 | or combining them into a single shell command | 11 | which can run in parallel and then some of them will try to create | 
| 12 | target link at the same time (after both already finished rm call). | ||
| 12 | 13 | ||
| 13 | Here, && ensures that the ln -s command only runs after rm -f target | 14 | Use -f which should be supported even by relatively old ln and | 
| 14 | successfully completes. | 15 | should avoid the need for rm (and hopefully will avoid this race) | 
| 16 | |||
| 17 | For libutil++ it calls "all" and "libxmlrpc_util++.so" only once, | ||
| 18 | but for libutil it calls "all" and then 12 times libxmlrpc_util.so | ||
| 19 | (after-clean-j1.log is the make output with -n and -j1 instead of | ||
| 20 | -j70), still trying to figure out why, my autofoo is rusty :). | ||
| 21 | |||
| 22 | Ideally we should prevent calling it 12 times, but until we figure | ||
| 23 | out why we can at least avoid the random build failures. | ||
| 24 | |||
| 25 | Another interesting fact is that I haven't seen this issue until | ||
| 26 | the upgrade to 1.60.03 from 1.59.01 from: | ||
| 27 | https://lists.openembedded.org/g/openembedded-devel/message/112706 | ||
| 28 | but I don't see any changes which should cause this in the git since | ||
| 29 | 1.59.01, but the gentoo bug report is against 1.54.06 already. | ||
| 30 | |||
| 31 | martin@jama /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable $ grep -A 1 lib/libutil++/Makefile after-clean-j1.log | ||
| 32 | make -C libutil++/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil++/Makefile \ | ||
| 33 | all | ||
| 34 | -- | ||
| 35 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil++/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil++/Makefile \ | ||
| 36 | libxmlrpc_util++.so | ||
| 37 | |||
| 38 | martin@jama /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable $ grep -A 1 lib/libutil/Makefile after-clean-j1.log | ||
| 39 | make -C libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 40 | all | ||
| 41 | -- | ||
| 42 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 43 | libxmlrpc_util.so | ||
| 44 | -- | ||
| 45 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 46 | libxmlrpc_util.so | ||
| 47 | -- | ||
| 48 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 49 | libxmlrpc_util.so | ||
| 50 | -- | ||
| 51 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 52 | libxmlrpc_util.so | ||
| 53 | -- | ||
| 54 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 55 | libxmlrpc_util.so | ||
| 56 | -- | ||
| 57 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 58 | libxmlrpc_util.so | ||
| 59 | -- | ||
| 60 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 61 | libxmlrpc_util.so | ||
| 62 | -- | ||
| 63 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 64 | libxmlrpc_util.so | ||
| 65 | -- | ||
| 66 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 67 | libxmlrpc_util.so | ||
| 68 | -- | ||
| 69 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 70 | libxmlrpc_util.so | ||
| 71 | -- | ||
| 72 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 73 | libxmlrpc_util.so | ||
| 74 | -- | ||
| 75 | make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \ | ||
| 76 | libxmlrpc_util.so | ||
| 15 | 77 | ||
| 16 | Similar error reported here [1] | 78 | Similar error reported here [1] | 
| 17 | 79 | ||
| 18 | [1] https://bugs.gentoo.org/932835 | 80 | [1] https://bugs.gentoo.org/932835 | 
| 19 | 81 | ||
| 20 | Upstream-Status: Pending | 82 | Upstream-Status: Pending | 
| 83 | Signed-off-by: Martin Jansa <martin.jansa@gmail.com> | ||
| 21 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 84 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 
| 22 | --- | 85 | --- | 
| 23 | unix-common.mk | 6 ++---- | 86 | unix-common.mk | 6 ++---- | 
| @@ -33,14 +96,14 @@ index 6954faf5..983c48cd 100644 | |||
| 33 | $(SHLIB_LE_TARGETS):%:%.$(MAJ) | 96 | $(SHLIB_LE_TARGETS):%:%.$(MAJ) | 
| 34 | - rm -f $@ | 97 | - rm -f $@ | 
| 35 | - $(LN_S) $< $@ | 98 | - $(LN_S) $< $@ | 
| 36 | + rm -f $@ && $(LN_S) $< $@ | 99 | + $(LN_S) -f $< $@ | 
| 37 | 100 | ||
| 38 | SONAME_TARGETS = $(SHLIB_LE_TARGETS:%=%.$(MAJ)) | 101 | SONAME_TARGETS = $(SHLIB_LE_TARGETS:%=%.$(MAJ)) | 
| 39 | 102 | ||
| 40 | $(SONAME_TARGETS):%:%.$(MIN) | 103 | $(SONAME_TARGETS):%:%.$(MIN) | 
| 41 | - rm -f $@ | 104 | - rm -f $@ | 
| 42 | - $(LN_S) $< $@ | 105 | - $(LN_S) $< $@ | 
| 43 | + rm -f $@ && $(LN_S) $< $@ | 106 | + $(LN_S) -f $< $@ | 
| 44 | 107 | ||
| 45 | .PHONY: $(SHLIB_INSTALL_TARGETS) | 108 | .PHONY: $(SHLIB_INSTALL_TARGETS) | 
| 46 | .PHONY: install-shared-libraries | 109 | .PHONY: install-shared-libraries | 
