From c74564086ca0540d2744861f7db2d8731da7ed41 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Fri, 25 Sep 2020 15:52:31 -0400 Subject: [PATCH 1/3] Buildsystem: permit to pass CPUS=X to make to force a number of CPUS to be used if desired, else the default is detected in Makefile and pushed to submodules. If nothing specified, uses nproc and pass it to submodules. CircleCI forced to CPUS=2 --- .circleci/config.yml | 16 ++++++++-------- Makefile | 2 +- modules/coreboot | 4 ++-- modules/linuxboot | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ba440d4..23d00724 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,7 +50,7 @@ jobs: # command: | # ./build/make-4.2.1/make \ # CROSS=/cross/bin/x86_64-linux-musl- \ -# --load 2 \ +# CPUS=2 \ # V=1 \ # BOARD=qemu-linuxboot \ # @@ -63,7 +63,7 @@ jobs: name: x230-flash #We delete build/make-4.2.1/ directory until issue #799 is fixed. command: | - rm -rf build/x230-flash/* build/log/* && make --load 2 \ + rm -rf build/x230-flash/* build/log/* && make CPUS=2 \ V=1 \ BOARD=x230-flash || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -81,7 +81,7 @@ jobs: - run: name: t430-flash command: | - rm -rf build/t430-flash/* build/log/* && make --load 2 \ + rm -rf build/t430-flash/* build/log/* && make CPUS=2 \ V=1 \ BOARD=t430-flash || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -99,7 +99,7 @@ jobs: - run: name: t430 command: | - rm -rf build/t430/* build/log/* && make --load 2 \ + rm -rf build/t430/* build/log/* && make CPUS=2 \ V=1 \ BOARD=t430 || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -117,7 +117,7 @@ jobs: - run: name: x230 command: | - rm -rf build/x230/* build/log/* && make --load 2 \ + rm -rf build/x230/* build/log/* && make CPUS=2 \ V=1 \ BOARD=x230 || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -135,7 +135,7 @@ jobs: - run: name: x230-hotp-verification command: | - rm -rf build/x230-hotp-verification/* build/log/* && make --load 2 \ + rm -rf build/x230-hotp-verification/* build/log/* && make CPUS=2 \ V=1 \ BOARD=x230-hotp-verification || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -153,7 +153,7 @@ jobs: - run: name: librem_mini-NoTPM command: | - rm -rf build/librem_mini-NoTPM/* build/log/* && make --load 2 \ + rm -rf build/librem_mini-NoTPM/* build/log/* && make CPUS=2 \ V=1 \ BOARD=librem_mini-NoTPM || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -171,7 +171,7 @@ jobs: - run: name: qemu-coreboot command: | - rm -rf build/qemu-coreboot/* build/log/* && make --load 2 \ + rm -rf build/qemu-coreboot/* build/log/* && make CPUS=2 \ V=1 \ BOARD=qemu-coreboot || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h diff --git a/Makefile b/Makefile index fd76b057..42fad6e0 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ INSTALL := $(pwd)/install log_dir := $(build)/log # Controls how many parallel jobs are invoked in subshells -CPUS := $(shell nproc) +CPUS ?= $(shell nproc) #MAKE_JOBS ?= -j$(CPUS) --max-load 16 # Create the log directory if it doesn't already exist diff --git a/modules/coreboot b/modules/coreboot index f9134dac..04d8f943 100644 --- a/modules/coreboot +++ b/modules/coreboot @@ -67,12 +67,12 @@ $(COREBOOT_TOOLCHAIN): else COREBOOT_TOOLCHAIN="$(build)/$(coreboot_base_dir)/.xcompile" $(COREBOOT_TOOLCHAIN): $(build)/$(coreboot_base_dir)/.canary - $(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=`nproc` crossgcc-i386 + $(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=$$CPUS crossgcc-i386 endif $(build)/$(coreboot_dir)/.configured: $(COREBOOT_IASL) $(COREBOOT_TOOLCHAIN) $(COREBOOT_IASL): $(build)/$(coreboot_base_dir)/.canary - $(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=`nproc` iasl + $(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=$$CPUS iasl # Force a rebuild if the inputs have changed $(build)/$(coreboot_dir)/.build: \ diff --git a/modules/linuxboot b/modules/linuxboot index 4e04a9e3..57ea31a2 100644 --- a/modules/linuxboot +++ b/modules/linuxboot @@ -21,7 +21,7 @@ linuxboot_configure := \ if [ "$(linuxboot_board)" = "qemu" ]; then \ echo >&2 "Pre-building edk2 OVMF" ; \ ( cd $(build)/$(linuxboot_base_dir)/edk2/OvmfPkg ; \ - ./build.sh -n `nproc` \ + ./build.sh -n $$CPUS \ ) || exit 1 ; \ fi ; \ touch .config ; \ From c47425709f169c38f1c1e8b4ddc01c04bbf84133 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Fri, 25 Sep 2020 15:56:27 -0400 Subject: [PATCH 2/3] CircleCI: we pass CPUS=2 to CPUS=4 since the logic calculation for threads/memory is 1/1024Mb, CircleCI supposedly reserving 4Gb for medium (free). Build time will increase, unfortunately, when compared to nproc returning 32 cores. --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 23d00724..c582b397 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,7 +50,7 @@ jobs: # command: | # ./build/make-4.2.1/make \ # CROSS=/cross/bin/x86_64-linux-musl- \ -# CPUS=2 \ +# CPUS=4 \ # V=1 \ # BOARD=qemu-linuxboot \ # @@ -63,7 +63,7 @@ jobs: name: x230-flash #We delete build/make-4.2.1/ directory until issue #799 is fixed. command: | - rm -rf build/x230-flash/* build/log/* && make CPUS=2 \ + rm -rf build/x230-flash/* build/log/* && make CPUS=4 \ V=1 \ BOARD=x230-flash || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -81,7 +81,7 @@ jobs: - run: name: t430-flash command: | - rm -rf build/t430-flash/* build/log/* && make CPUS=2 \ + rm -rf build/t430-flash/* build/log/* && make CPUS=4 \ V=1 \ BOARD=t430-flash || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -99,7 +99,7 @@ jobs: - run: name: t430 command: | - rm -rf build/t430/* build/log/* && make CPUS=2 \ + rm -rf build/t430/* build/log/* && make CPUS=4 \ V=1 \ BOARD=t430 || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -117,7 +117,7 @@ jobs: - run: name: x230 command: | - rm -rf build/x230/* build/log/* && make CPUS=2 \ + rm -rf build/x230/* build/log/* && make CPUS=4 \ V=1 \ BOARD=x230 || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -135,7 +135,7 @@ jobs: - run: name: x230-hotp-verification command: | - rm -rf build/x230-hotp-verification/* build/log/* && make CPUS=2 \ + rm -rf build/x230-hotp-verification/* build/log/* && make CPUS=4 \ V=1 \ BOARD=x230-hotp-verification || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -153,7 +153,7 @@ jobs: - run: name: librem_mini-NoTPM command: | - rm -rf build/librem_mini-NoTPM/* build/log/* && make CPUS=2 \ + rm -rf build/librem_mini-NoTPM/* build/log/* && make CPUS=4 \ V=1 \ BOARD=librem_mini-NoTPM || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h @@ -171,7 +171,7 @@ jobs: - run: name: qemu-coreboot command: | - rm -rf build/qemu-coreboot/* build/log/* && make CPUS=2 \ + rm -rf build/qemu-coreboot/* build/log/* && make CPUS=4 \ V=1 \ BOARD=qemu-coreboot || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ no_output_timeout: 3h From e3c81a94f801e28c112db2ab919f35bb609eb441 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Fri, 25 Sep 2020 16:00:07 -0400 Subject: [PATCH 3/3] CircleCI: changing order of build boards, since we want to test coreboot 4.12 built boards currently failing for lack of memory in other builds (make error 137). --- .circleci/config.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c582b397..bd0806e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,6 +59,24 @@ jobs: # - store-artifacts: # path: build/qemu-linuxboot/hashes.txt + - run: + name: librem_mini-NoTPM + command: | + rm -rf build/librem_mini-NoTPM/* build/log/* && make CPUS=4 \ + V=1 \ + BOARD=librem_mini-NoTPM || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ + no_output_timeout: 3h + - run: + name: Ouput librem_mini-NoTPM hashes + command: | + cat build/librem_mini-NoTPM/hashes.txt \ + - run: + name: Archiving build logs for librem_mini-NoTPM + command: | + tar zcvf build/librem_mini-NoTPM/logs.tar.gz build/log/* + - store-artifacts: + path: build/librem_mini-NoTPM + - run: name: x230-flash #We delete build/make-4.2.1/ directory until issue #799 is fixed. @@ -150,24 +168,6 @@ jobs: - store-artifacts: path: build/x230-hotp-verification - - run: - name: librem_mini-NoTPM - command: | - rm -rf build/librem_mini-NoTPM/* build/log/* && make CPUS=4 \ - V=1 \ - BOARD=librem_mini-NoTPM || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \ - no_output_timeout: 3h - - run: - name: Ouput librem_mini-NoTPM hashes - command: | - cat build/librem_mini-NoTPM/hashes.txt \ - - run: - name: Archiving build logs for librem_mini-NoTPM - command: | - tar zcvf build/librem_mini-NoTPM/logs.tar.gz build/log/* - - store-artifacts: - path: build/librem_mini-NoTPM - - run: name: qemu-coreboot command: |