mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12131 from ethereum/fix-macos-restore-cache-workaround
Update the workaround for restore_cache on macOS not to delete files completely
This commit is contained in:
commit
fcd5af8cb0
@ -160,16 +160,34 @@ defaults:
|
|||||||
- store_test_results: *store_test_results
|
- store_test_results: *store_test_results
|
||||||
- store_artifacts: *artifacts_test_results
|
- store_artifacts: *artifacts_test_results
|
||||||
|
|
||||||
- steps_restore_cache_homebrew_workaround: &steps_restore_cache_homebrew_workaround
|
- steps_homebrew_workaround_before_restore_cache: &steps_homebrew_workaround_before_restore_cache
|
||||||
steps:
|
steps:
|
||||||
- run:
|
- run:
|
||||||
# FIXME: For some reason restore_cache fails saying that it cannot remove the scm/ dir.
|
# Homebrew has recently replaced one of its dirs with a symlink to another.
|
||||||
# The directory contains only two files: `git` (wrapper script over git) and `svn` (symlink
|
# This makes tar used by restore_cache fail - the image contains an older version of
|
||||||
# to `git`). This looks like a bug in restore_cache. Removing scm/ is a workaround.
|
# Homebrew installed where it's a directory and tar refuses to overwrite a dir with a link.
|
||||||
|
# Removing the directory manually is a workaround that works only in case we do have
|
||||||
|
# cached files to restore. If we don't, we still need this dir because it contains
|
||||||
|
# a git wrapper that Homebrew uses to update itself. The solution is to just rename the
|
||||||
|
# dir before restore_cache and renamed it back afterwards.
|
||||||
# See https://github.com/ethereum/solidity/pull/12106 for more details.
|
# See https://github.com/ethereum/solidity/pull/12106 for more details.
|
||||||
name: Workaround for restore_cache + /usr/local/Homebrew/Library/Homebrew/shims/scm/
|
name: Workaround for restore_cache + /usr/local/Homebrew/Library/Homebrew/shims/scm/
|
||||||
command: |
|
command: |
|
||||||
rm -r /usr/local/Homebrew/Library/Homebrew/shims/scm/
|
cd /usr/local/Homebrew/Library/Homebrew/shims/
|
||||||
|
mv scm/ scm-backup/
|
||||||
|
|
||||||
|
- steps_homebrew_workaround_after_restore_cache: &steps_homebrew_workaround_after_restore_cache
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Workaround for restore_cache + /usr/local/Homebrew/Library/Homebrew/shims/scm/
|
||||||
|
command: |
|
||||||
|
cd /usr/local/Homebrew/Library/Homebrew/shims/
|
||||||
|
if ! [[ -e scm/ ]]
|
||||||
|
then
|
||||||
|
mv scm-backup/ scm/
|
||||||
|
else
|
||||||
|
rm -r scm-backup/
|
||||||
|
fi
|
||||||
|
|
||||||
- test_ubuntu1604_clang: &test_ubuntu1604_clang
|
- test_ubuntu1604_clang: &test_ubuntu1604_clang
|
||||||
docker:
|
docker:
|
||||||
@ -638,12 +656,17 @@ jobs:
|
|||||||
- checkout
|
- checkout
|
||||||
- when:
|
- when:
|
||||||
condition: true
|
condition: true
|
||||||
<<: *steps_restore_cache_homebrew_workaround
|
# FIXME: Remove this workaround when CircleCI fixes restore_cache.
|
||||||
|
<<: *steps_homebrew_workaround_before_restore_cache
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- dependencies-osx-{{ arch }}-{{ 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
|
# 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.
|
# WARNING! If you do edit anything here instead, remember to invalidate the cache manually.
|
||||||
|
- when:
|
||||||
|
condition: true
|
||||||
|
# FIXME: Remove this workaround when CircleCI fixes restore_cache.
|
||||||
|
<<: *steps_homebrew_workaround_after_restore_cache
|
||||||
- run:
|
- run:
|
||||||
name: Install build dependencies
|
name: Install build dependencies
|
||||||
command: ./.circleci/osx_install_dependencies.sh
|
command: ./.circleci/osx_install_dependencies.sh
|
||||||
@ -677,10 +700,15 @@ jobs:
|
|||||||
- checkout
|
- checkout
|
||||||
- when:
|
- when:
|
||||||
condition: true
|
condition: true
|
||||||
<<: *steps_restore_cache_homebrew_workaround
|
# FIXME: Remove this workaround when CircleCI fixes restore_cache.
|
||||||
|
<<: *steps_homebrew_workaround_before_restore_cache
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
|
- dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
|
||||||
|
- when:
|
||||||
|
condition: true
|
||||||
|
# FIXME: Remove this workaround when CircleCI fixes restore_cache.
|
||||||
|
<<: *steps_homebrew_workaround_after_restore_cache
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: .
|
at: .
|
||||||
- run: *run_soltest
|
- run: *run_soltest
|
||||||
@ -696,10 +724,15 @@ jobs:
|
|||||||
- checkout
|
- checkout
|
||||||
- when:
|
- when:
|
||||||
condition: true
|
condition: true
|
||||||
<<: *steps_restore_cache_homebrew_workaround
|
# FIXME: Remove this workaround when CircleCI fixes restore_cache.
|
||||||
|
<<: *steps_homebrew_workaround_before_restore_cache
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
|
- dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
|
||||||
|
- when:
|
||||||
|
condition: true
|
||||||
|
# FIXME: Remove this workaround when CircleCI fixes restore_cache.
|
||||||
|
<<: *steps_homebrew_workaround_after_restore_cache
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: .
|
at: .
|
||||||
- run: *run_cmdline_tests
|
- run: *run_cmdline_tests
|
||||||
|
Loading…
Reference in New Issue
Block a user