目前,我CircleCI 2.0
对项目的缓存策略Elixir
如下:
- restore_cache:
keys:
- v1-mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }}
- v1-mix-cache-{{ .Branch }}
- v1-mix-cache
- v1-build-cache-{{ .Branch }}
- v1-build-cache
- save_cache:
key: v1-mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }}
paths: deps
- save_cache:
key: v1-mix-cache-{{ .Branch }}
paths: deps
- save_cache:
key: v1-mix-cache
paths: deps
- save_cache:
key: v1-build-cache-{{ .Branch }}
paths: _build
- save_cache:
key: v1-build-cache
paths: _build
但是,它有时会导致以下错误:
===> Compiling certifi
=ERROR REPORT==== 12-Jul-2018::15:37:40 ===
Loading of /home/circleci/project/_build/test/lib/parse_trans/ebin/parse_trans.beam failed: badfile
=ERROR REPORT==== 12-Jul-2018::15:37:40 ===
beam/beam_load.c(1863): Error loading module parse_trans:
This BEAM file was compiled for a later version of the run-time system than 20.
To fix this, please recompile this module with an 20 compiler.
(Use of opcode 162; this emulator supports only up to 159.)
===> Compiling src/certifi.erl failed
有时我们会得到:
** (UndefinedFunctionError) function :hackney.request/5 is undefined (module :hackney is not available)
/home/circleci/project/_build/test/lib/hackney/ebin/hackney.beam failed: :badfile
12:44:02.665 [error] beam/beam_load.c(1863): Error loading module hackney:
This BEAM file was compiled for a later version of the run-time system than 20.
To fix this, please recompile this module with an 20 compiler.
(Use of opcode 162; this emulator supports only up to 159.)
当然,一切都是缓存问题,因为当我们在没有缓存的情况下重新运行构建时,一切都按预期工作。
这不会每次都发生,但有时会出现不同的错误。
你有任何可靠的Elixir
项目缓存策略吗?