radxa-repo / bsp

Radxa BSP Build Tool
https://radxa-repo.github.io/bsp/
GNU General Public License v3.0
31 stars 44 forks source link

build failing with --dirty option #86

Open Sfinx opened 4 months ago

Sfinx commented 4 months ago

./bsp --dirty linux rk356x radxa-cm3-io

  LD      vmlinux.o
  MODPOST vmlinux.symvers
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
  LD      .tmp_vmlinux.kallsyms1
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
  LD      .tmp_vmlinux.kallsyms1
  KSYMS   .tmp_vmlinux.kallsyms1.S
make: *** [Makefile:1311: vmlinux] Error 1
make: *** Waiting for unfinished jobs....
  KSYMS   .tmp_vmlinux.kallsyms1.S
aarch64-linux-gnu-nm: '.tmp_vmlinux.kallsyms1': No such file
make[3]: *** [Makefile:1311: vmlinux] Error 1
make[2]: *** [debian/rules:7: build-arch] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
make[1]: *** [scripts/Makefile.package:83: bindeb-pkg] Error 2
make: *** [Makefile:1671: bindeb-pkg] Error 2
make: Leaving directory '/home/rus/rpi/radxa-cm3/bsp/.src-rk356x/linux'
bsp
RadxaYuntian commented 4 months ago

--dirty is currently broken for linux target. I haven't had time to check what is causing it but it is working for U-Boot. There is a workaround in the above link that only reset the kconfig setting.

Sfinx commented 4 months ago

It do not related to kconfig at all. The problem is that dirty launch several processes which build the same target => race => fail. This patch fix dirty builds for me :

diff --git a/lib/linux.sh b/lib/linux.sh
index 7b2a56f..8b90311 100644
--- a/lib/linux.sh
+++ b/lib/linux.sh
@@ -22,7 +22,7 @@ bsp_prepare() {
 bsp_make() {
     local kernelversion="$(bsp_version)"

-    make -C "$TARGET_DIR" -j$(nproc) \
+    make -C "$TARGET_DIR" -j1 \
         ARCH=$BSP_ARCH CROSS_COMPILE=$CROSS_COMPILE HOSTCC=${CROSS_COMPILE}gcc \
         KDEB_COMPRESS="xz" KDEB_CHANGELOG_DIST="unstable" DPKG_FLAGS=$BSP_DPKG_FLAGS \
         LOCALVERSION=-$PKG_REVISION-$FORK KERNELRELEASE=$kernelversion-$PKG_REVISION-$FORK KDEB_PKGVERSION=$kernelversion-${PKG_REVISION}${SOURCE_GITREV:+-$SOURCE_GITREV} \
RadxaYuntian commented 4 months ago

This disables parallel building right?

Sfinx commented 4 months ago

correct. and build always succeed with -j1