Can't checksum multiple files with slashes in the file path


#1

If you have a cache key based on multiple files for a checksum, then the config parser throws an error:

      - restore_cache:
          key: figwheel-{{ checksum "plugin/project.clj" }}-{{ checksum "sidecar/project.clj }}-{{ checksum "support/project.clj }}

Error computing cache key: template: cacheKey:1: bad character U+002F '/'

It seems as if there is more than one / in checksum calculations then this throws an error.

See https://circleci.com/gh/danielcompton/lein-figwheel/21 for the full build details. The project still builds even though the cache key fails.


#2

I’m not familiar with this particular shortcoming, but I’ve suggested a general workaround for cache checksums here.


#3

Thanks, I ended up running

shasum sidecar/project.clj plugin/project.clj support/project.clj > checksum.tmp

and using the checksum of checksum.tmp as the cache key.


#4

Hey it looks like you’ve got an error with the checksum in that you are missing end-quotes on the second 2 instances of checksum. I’m doing this and it worked fine.


closed #5

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.