[Skiboot] [PATCH] external/ffspart: Avoid makefile race condition

Reza Arbab arbab at linux.ibm.com
Wed Feb 5 01:49:01 AEDT 2025


In ffspart we assign this make variable:

  FFSPART_VERSION ?= $(shell ./make_version.sh $(EXE))

However, ./make_version.sh is actually a make target, and whether it
exists or not at the time of this assignment is by chance, depending on
how the make concurrency works out.

In practice, this intermittently causes CI build failure:

  make -j${MAKE_J} check
  + make -j4 check
  ...
     [ RUN-TEST ]   check-ffspart
  ...
  make[1]: ./make_version.sh: No such file or directory
  ...
  make[1]: *** [Makefile:13: check] Error 1
  make[1]: Entering directory '/build/external/ffspart'
  ...
  running test/tests/00-usage
  running test/tests/01-param-sanity
  Fatal error, cannot execute binary './ffspart'. Did you make?
  make[1]: Leaving directory '/build/external/ffspart'
  make: *** [/build/external/Makefile.check:21: check-ffspart] Error 2
  make: *** Waiting for unfinished jobs....

The rule for make_version.sh is just a symlink:

  make_version.sh:
  	$(Q_LN)ln -sf ../../make_version.sh

To avoid the race, call make_version.sh from its actual location instead
of relying on the link to be created. The same thing was done for gard
in commit 8ab0caf26de9 ("external/gard: Fix make dist target").

Signed-off-by: Reza Arbab <arbab at linux.ibm.com>
---
 external/ffspart/rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/external/ffspart/rules.mk b/external/ffspart/rules.mk
index e006dc5b7cb1..cbbd4a85279e 100644
--- a/external/ffspart/rules.mk
+++ b/external/ffspart/rules.mk
@@ -15,7 +15,7 @@ sbindir = $(prefix)/sbin
 
 CC	= $(CROSS_COMPILE)gcc
 
-FFSPART_VERSION ?= $(shell ./make_version.sh $(EXE))
+FFSPART_VERSION ?= $(shell ../../make_version.sh $(EXE))
 
 version.c: make_version.sh .version
 	@(if [ "a$(FFSPART_VERSION)" = "a" ]; then \
-- 
2.43.5



More information about the Skiboot mailing list