From 55775c1d2b71f8fc33de8004a6c4d0b6d1fe6790 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Thu, 25 Nov 2021 10:38:15 -0500 Subject: [PATCH] CircleCI: add large ressource class for free tier as defined under https://support.circleci.com/hc/en-us/articles/4410707277083-Context-deadline-exceeded-after-1-hour-Build-timed-out-Free-tier-only- Readd https://github.com/osresearch/heads/pull/984 without cache Change CPUS=16 to -j16 in CircleCI config Add kgpe-d16 musl-cross target prior of having kgpe-d16 depend on musl-cross target (To try to have musl-cross step successfull under 1h CircleCI new limit) CircleCI: add a subcommand that can follow a target (to build musl-cross-make now and coreboot version specific musl-cross later) Output of hashes is now optional --- .circleci/config.yml | 39 +++++++++++++++++++++++++++++++-------- Makefile | 2 +- modules/musl-cross | 12 +++++++----- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 67db29f00..e1b51538b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,8 @@ commands: parameters: target: type: string + subcommand: + type: string steps: - run: name: Install dependencies @@ -14,7 +16,7 @@ commands: - run: name: Make Board command: | - rm -rf build/<>/* build/log/* && make CPUS=16 V=1 BOARD=<> || touch ./tmpDir/failed_build + rm -rf build/<>/* build/log/* && make -j16 V=1 BOARD=<> <> || touch ./tmpDir/failed_build no_output_timeout: 3h - run: name: Output build failing logs @@ -23,7 +25,7 @@ commands: - run: name: Output hashes command: | - cat build/<>/hashes.txt \ + cat build/<>/hashes.txt || echo "No hashes for this build step..."\ - run: name: Archiving build logs. command: | @@ -35,6 +37,7 @@ jobs: prep_env: docker: - image: debian:10 + resource_class: large steps: - run: name: Install dependencies @@ -98,14 +101,18 @@ jobs: build_and_persist: docker: - image: debian:10 + resource_class: large parameters: target: type: string + subcommand: + type: string steps: - attach_workspace: at: ~/ - build_board: - target: <> + target: <> + subcommand: <> - persist_to_workspace: root: ~/ paths: @@ -117,11 +124,14 @@ jobs: parameters: target: type: string + subcommand: + type: string steps: - attach_workspace: at: ~/ - build_board: - target: <> + target: <> + subcommand: <> save_cache: docker: @@ -131,17 +141,22 @@ jobs: at: ~/ - save_cache: #Generate cache for the same musl-cross module definition if hash is not previously existing + #CircleCI removed their wildcard support, so we have to list precise versions to cache in directory names key: heads-musl-cross-{{ checksum "./tmpDir/musl-cross.sha256sums" }}{{ .Environment.CACHE_VERSION }} paths: - crossgcc - - build/musl-cross-* + - build/musl-cross-38e52db8358c043ae82b346a2e6e66bc86a53bc1 - save_cache: #Generate cache for the same coreboot mnd musl-cross-make modules definition if hash is not previously existing + #CircleCI removed their wildcard support, so we have to list precise versions to cache in directory names key: heads-coreboot-musl-cross-{{ checksum "./tmpDir/coreboot_musl-cross.sha256sums" }}{{ .Environment.CACHE_VERSION }} paths: - - build/coreboot-* + - build/coreboot-4.11 + - build/coreboot-4.13 + - build/coreboot-4.14 + - build/coreboot-4.15 - crossgcc - - build/musl-cross-* + - build/musl-cross-38e52db8358c043ae82b346a2e6e66bc86a53bc1 - save_cache: #Generate cache for the exact same modules definitions if hash is not previously existing key: heads-modules-and-patches-{{ checksum "./tmpDir/all_modules_and_patches.sha256sums" }}{{ .Environment.CACHE_VERSION }} @@ -161,12 +176,20 @@ workflows: # version. The last board in the sequence is the dependency # for the parallel boards built at the end, and also save_cache. + # Prerequisites + - build_and_persist: + name: musl-cross + target: kgpe-d16_workstation + subcommand: musl-cross + requires: + - prep_env + # Coreboot 4.11 - build_and_persist: name: kgpe-d16_workstation target: kgpe-d16_workstation requires: - - prep_env + - musl-cross # Coreboot 4.13 - build_and_persist: diff --git a/Makefile b/Makefile index 4073aa162..73e36190b 100644 --- a/Makefile +++ b/Makefile @@ -530,7 +530,7 @@ endif $(COREBOOT_UTIL_DIR)/cbmem/cbmem \ $(COREBOOT_UTIL_DIR)/superiotool/superiotool \ $(COREBOOT_UTIL_DIR)/inteltool/inteltool \ -: $(build)/$(coreboot_base_dir)/.canary +: $(build)/$(coreboot_base_dir)/.canary musl-cross +$(call do,MAKE,$(notdir $@),\ $(MAKE) -C "$(dir $@)" $(CROSS_TOOLS) \ ) diff --git a/modules/musl-cross b/modules/musl-cross index 2f05c51f6..e6940dacc 100644 --- a/modules/musl-cross +++ b/modules/musl-cross @@ -31,13 +31,15 @@ musl-cross_libraries := \ else -# Force a full build of the cross compiler -# have to build both x86_64 and i386 versions for coreboot +# Force a full build of the cross compiler for x86_64 +# (do not build i386 since coreboot uses its own compiler) musl-cross_configure := \ - /bin/echo -e >> Makefile 'both:' ; \ - /bin/echo -e >> Makefile '\t$$$$(MAKE) TARGET=x86_64-linux-musl install' ; \ - /bin/echo -e >> Makefile '\t$$$$(MAKE) TARGET=i386-linux-musl install' ; \ + /bin/echo -e >> Makefile 'both: musl-x86_64' ; \ + /bin/echo -e >> Makefile 'musl-x86_64: extract_all' ; \ + /bin/echo -e >> Makefile '\t$$$$''(MAKE) TARGET=x86_64-linux-musl install' ; \ + /bin/echo -e >> Makefile 'musl-i386: extract_all' ; \ + /bin/echo -e >> Makefile '\t$$$$''(MAKE) TARGET=i386-linux-musl install' ; \ CROSS_PATH ?= $(pwd)/crossgcc