From fe71f1cac102667d4a519143cc7667ac4bdebfe0 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Wed, 2 Aug 2023 14:11:42 -0400 Subject: [PATCH] CircleCI & Makefile: fixes needed for coreboot-git/cache reuse CircleCI: depend on NV41 for save_cache Makefile: consider that coreboot-git is now shared between forks on x86 (Nitrokey/Purism share build/x86/coreboot-git now) Addressesses requested change at https://github.com/osresearch/heads/pull/1417#pullrequestreview-1555716074 --- .circleci/config.yml | 12 ++++++------ Makefile | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ccafa7e3a..dc860e79c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -215,7 +215,7 @@ workflows: # version. The last board in the sequence is the dependency # for the parallel boards built at the end, and also save_cache. - # Coreboot 4.19 + # coreboot 4.19 - build_and_persist: name: x230-hotp-maximized target: x230-hotp-maximized @@ -223,7 +223,7 @@ workflows: requires: - prep_env - # Coreboot 4.17 + # coreboot-git librems - build_and_persist: name: librem_14 target: librem_14 @@ -231,7 +231,7 @@ workflows: requires: - x230-hotp-maximized - # Coreboot Nitropads + # coreboot-git Nitropads on top of coreboot-git librems - build_and_persist: name: nitropad-nv41 target: nitropad-nv41 @@ -239,7 +239,7 @@ workflows: requires: - librem_14 - # Coreboot for Talos (PPC) + # coreboot-git Talos II (PPC) - build_and_persist: name: talos-2 arch: ppc64 @@ -251,7 +251,6 @@ workflows: #Cache one workspace per architecture. Make sure workspace caches are chainloaded and the last in chain for an arch is saved. - save_cache: requires: - - librem_14 - talos-2 - nitropad-nv41 @@ -506,7 +505,7 @@ workflows: requires: - x230-hotp-maximized -#Coreboot 4.17 boards +#coreboot-git librem boards - build: name: librem_13v2 target: librem_13v2 @@ -549,6 +548,7 @@ workflows: requires: - librem_14 +#coreboot-git Nitrokey NV - build: name: nitropad-ns50 target: nitropad-ns50 diff --git a/Makefile b/Makefile index b7ecd5905..35fe6578d 100644 --- a/Makefile +++ b/Makefile @@ -302,7 +302,9 @@ define define_module = echo -n '$($1_repo)|$($1_commit_hash)' > "$$@"; \ elif [ "$$$$(cat "$$@")" != '$($1_repo)|$($1_commit_hash)' ]; then \ echo "Switching $1 to $($1_repo) at $($1_commit_hash)" && \ - git -C "$(build)/$($1_base_dir)" fetch $($1_repo) $($1_commit_hash) && \ + git -C "$(build)/$($1_base_dir)" reset --hard HEAD^ && \ + git -C "$(build)/$($1_base_dir)" remote set-url origin $($1_repo) && \ + git -C "$(build)/$($1_base_dir)" checkout origin > /dev/null 2>&1 && \ git -C "$(build)/$($1_base_dir)" reset --hard $($1_commit_hash) && \ git -C "$(build)/$($1_base_dir)" clean -df && \ git -C "$(build)/$($1_base_dir)" clean -dffx payloads util/cbmem && \