From 24c8a608c491de8886f8c55c0955d116c42607eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Thu, 7 Oct 2021 18:09:18 +0200 Subject: [PATCH 1/2] Include OS and CPU architecture in CircleCI cache keys --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4706fe6c0..a859b8464 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -627,14 +627,14 @@ jobs: - checkout - restore_cache: keys: - - dependencies-osx-{{ checksum ".circleci/osx_install_dependencies.sh" }} + - dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }} # DO NOT EDIT between here and save_cache, but rather edit ./circleci/osx_install_dependencies.sh # WARNING! If you do edit anything here instead, remember to invalidate the cache manually. - run: name: Install build dependencies command: ./.circleci/osx_install_dependencies.sh - save_cache: - key: dependencies-osx-{{ checksum ".circleci/osx_install_dependencies.sh" }} + key: dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }} paths: - /usr/local/bin - /usr/local/sbin @@ -663,7 +663,7 @@ jobs: - checkout - restore_cache: keys: - - dependencies-osx-{{ checksum ".circleci/osx_install_dependencies.sh" }} + - dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }} - attach_workspace: at: . - run: *run_soltest @@ -679,7 +679,7 @@ jobs: - checkout - restore_cache: keys: - - dependencies-osx-{{ checksum ".circleci/osx_install_dependencies.sh" }} + - dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }} - attach_workspace: at: . - run: *run_cmdline_tests @@ -886,14 +886,14 @@ jobs: - checkout - restore_cache: keys: - - dependencies-win-{{ checksum "scripts/install_deps.ps1" }} + - dependencies-win-{{ arch }}-{{ checksum "scripts/install_deps.ps1" }} # DO NOT EDIT between here and save_cache, but rather edit .\scripts\install_deps.ps1 # WARNING! If you do edit anything here instead, remember to invalidate the cache manually. - run: name: "Installing dependencies" command: .\scripts\install_deps.ps1 - save_cache: - key: dependencies-win-{{ checksum "scripts/install_deps.ps1" }} + key: dependencies-win-{{ arch }}-{{ checksum "scripts/install_deps.ps1" }} paths: - .\deps - run: From cd225740724954f724365caedc008f2cdd58cfb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Mon, 11 Oct 2021 19:58:05 +0200 Subject: [PATCH 2/2] Workaround for CircleCI not being able to restore cached /usr/local/Homebrew --- .circleci/config.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a859b8464..5ed903ac5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -160,6 +160,17 @@ defaults: - store_test_results: *store_test_results - store_artifacts: *artifacts_test_results + - steps_restore_cache_homebrew_workaround: &steps_restore_cache_homebrew_workaround + steps: + - run: + # FIXME: For some reason restore_cache fails saying that it cannot remove the scm/ dir. + # The directory contains only two files: `git` (wrapper script over git) and `svn` (symlink + # to `git`). This looks like a bug in restore_cache. Removing scm/ is a workaround. + # See https://github.com/ethereum/solidity/pull/12106 for more details. + name: Workaround for restore_cache + /usr/local/Homebrew/Library/Homebrew/shims/scm/ + command: | + rm -r /usr/local/Homebrew/Library/Homebrew/shims/scm/ + - test_ubuntu1604_clang: &test_ubuntu1604_clang docker: - image: << pipeline.parameters.ubuntu-1604-clang-ossfuzz-docker-image >> @@ -625,6 +636,9 @@ jobs: MAKEFLAGS: -j 5 steps: - checkout + - when: + condition: true + <<: *steps_restore_cache_homebrew_workaround - restore_cache: keys: - dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }} @@ -661,6 +675,9 @@ jobs: TERM: xterm steps: - checkout + - when: + condition: true + <<: *steps_restore_cache_homebrew_workaround - restore_cache: keys: - dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }} @@ -677,6 +694,9 @@ jobs: TERM: xterm steps: - checkout + - when: + condition: true + <<: *steps_restore_cache_homebrew_workaround - restore_cache: keys: - dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}