From: Prarit Bhargava <pra...@redhat.com>

redhat/configs/process_configs.sh: Fix race with tools generation

Kernel builds are occasionally failing with (for example):

Processing 
/home/prarit/rpmbuild/BUILD/kernel-5.17/linux-5.17.0-0.test.fc35.x86_64/configs/kernel-5.17.0-s390x.config
 ...
Processing 
/home/prarit/rpmbuild/BUILD/kernel-5.17/linux-5.17.0-0.test.fc35.x86_64/configs/kernel-5.17.0-x86_64-debug.config
 ...
Processing 
/home/prarit/rpmbuild/BUILD/kernel-5.17/linux-5.17.0-0.test.fc35.x86_64/configs/kernel-5.17.0-x86_64.config
 ...
/bin/sh: line 1: scripts/basic/fixdep: Text file busy
make[1]: *** [scripts/Makefile.host:95: scripts/basic/fixdep] Error 126
make[1]: *** Deleting file 'scripts/basic/fixdep'
make: *** [Makefile:559: scripts_basic] Error 2
/bin/sh: line 1: scripts/basic/fixdep: Text file busy
make[1]: *** [scripts/Makefile.host:95: scripts/basic/fixdep] Error 126
make[1]: *** Deleting file 'scripts/basic/fixdep'
make: *** [Makefile:559: scripts_basic] Error 2

This occurs because the makes are conflicting with one another to create
the same files.  This can be fixed by having the first make run on it's
own, and then having the remainder run in parallel.

Signed-off-by: Prarit Bhargava <pra...@redhat.com>

diff --git a/redhat/configs/process_configs.sh 
b/redhat/configs/process_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/process_configs.sh
+++ b/redhat/configs/process_configs.sh
@@ -304,6 +304,11 @@ function process_configs()
        count=0
        for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}${SUBARCH}"*.config
        do
+               if [ "$count" -eq 0 ]; then
+                       # do the first one by itself so that tools are built
+                       process_config "$cfg" "$count"
+                       continue
+               fi
                process_config "$cfg" "$count" &
                waitpids[${count}]=$!
                ((count++))

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1673
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to