Skip to content

Commit

Permalink
Fix dependency cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
aarlt committed Jan 22, 2024
1 parent ccef99e commit 717648f
Showing 1 changed file with 44 additions and 4 deletions.
48 changes: 44 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,51 @@ commands:

install_dependencies_osx:
steps:
# FIXME: We used to cache dependencies on macOS but now it takes longer than just installing
# them each time. See https://github.com/ethereum/solidity/issues/12925.
- restore_cache:
keys:
- b_osx-dependencies-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}-flag
- run:
name: Install build dependencies
command: .circleci/osx_install_dependencies.sh
name: Checking dependency flag
command: |
if test -f ~/b_osx-dependencies-flag
then
echo "Dependency flag exists: removing /usr/local and /opt/homebrew directories. These directories will be restored from cache."
sudo rm -rf /usr/local/*
# circleci is providing the circleci cli tools via some kind of symlink magic.
# so we just save the original symlinks and using them later.
mv /opt/homebrew/bin/circleci /tmp/circleci
mv /opt/homebrew/bin/circleci-agent /tmp/circleci-agent
sudo rm -rf /opt/homebrew
sudo mkdir -p /opt/homebrew/bin
sudo chmod 777 /opt/homebrew
sudo chmod 777 /opt/homebrew/bin
mv /tmp/circleci /opt/homebrew/bin/circleci
mv /tmp/circleci-agent /opt/homebrew/bin/circleci-agent
sudo chmod 777 /usr/local
else
echo "Dependency flag didn't exist: installing dependencies."
.circleci/osx_install_dependencies.sh
if test -f /usr/local/lib/libz3.a
then
echo "/usr/local/lib/libz3.a found: setting dependency flag."
touch ~/b_osx-dependencies-flag
else
echo "Dependencies not build."
fi
fi
- save_cache:
key: b_osx-dependencies-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}-flag
paths:
- ~/b_osx-dependencies-flag
- restore_cache:
keys:
- b_osx-dependencies-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
- save_cache:
key: b_osx-dependencies-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
paths:
- /usr/local
- /opt/homebrew


defaults:

Expand Down

0 comments on commit 717648f

Please sign in to comment.