Skip to content

Commit 7e7c5fa

Browse files
[build] Fix compilation deadlock issue
Why I did it If the previous compilation exited abnormally during the installation process, the subsequent compilation process(ex: make target/xxx.bin SONIC_BUILD_JOBS=4) may enter a deadlock state because the file lock(`$(DEBS_PATH)/dpkg_lock`) may not be deleted. How I did it Try to deleted the file lock before starting compilation. How to verify it The compilation always be OK though the previous compilation exited abnormally during the installation process. Signed-off-by: Long Wu <[email protected]>
1 parent 0327fd7 commit 7e7c5fa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

slave.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ endif
379379
export RUST_CROSS_COMPILE_TARGET
380380
endif
381381

382+
# try to remove the lock to avoid residual lock from previous abnormal exits.
383+
$(shell [ -d $(DEBS_PATH)/dpkg_lock ] && rm -d $(DEBS_PATH)/dpkg_lock)
384+
382385
###############################################################################
383386
## Routing stack related exports
384387
###############################################################################

0 commit comments

Comments
 (0)